There is no point dumping qdiscs for all devices when user space wants them for a single device: tc -s -d qdisc show dev eth1 Signed-off-by: Eric Dumazet --- net/sched/sch_api.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index cf3d01dd6b268741a6e4674954940e09dff139a4..dd0edc9bd4610ec865fc97a81f801a7da020667b 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1884,6 +1884,7 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) unsigned long ifindex; int q_idx; } *ctx = (void *)cb->ctx; + const struct tcmsg *tcm; struct net_device *dev; int s_q_idx, q_idx; int err; @@ -1894,6 +1895,9 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) rtm_tca_policy, cb->extack); if (err < 0) return err; + tcm = nlmsg_data(nlh); + if (tcm->tcm_ifindex && !ctx->ifindex) + ctx->ifindex = tcm->tcm_ifindex; s_q_idx = ctx->q_idx; @@ -1901,6 +1905,9 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) struct netdev_queue *dev_queue; struct Qdisc *q; + if (tcm->tcm_ifindex && ctx->ifindex != tcm->tcm_ifindex) + break; + q_idx = 0; netdev_lock_ops(dev); -- 2.54.0.545.g6539524ca2-goog