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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index c4e8059acdd324441e0d069f6878bbfcab5a0cc7..8d0e4eb72103d9b074131e13e31830cb266eadba 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1874,6 +1874,7 @@ static int tc_dump_qdisc_root(struct Qdisc *root, struct sk_buff *skb, static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) { const struct nlmsghdr *nlh = cb->nlh; + const struct tcmsg *tcm = nlmsg_data(nlh); struct net *net = sock_net(skb->sk); struct nlattr *tca[TCA_MAX + 1]; struct { @@ -1892,6 +1893,9 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) if (err < 0) return err; + if (!ctx->ifindex) + ctx->ifindex = tcm->tcm_ifindex; + s_ifindex = ctx->ifindex; s_q_idx = ctx->q_idx; @@ -1899,8 +1903,13 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) struct netdev_queue *dev_queue; struct Qdisc *q; - if (ctx->ifindex > s_ifindex) + if (ctx->ifindex > s_ifindex) { + if (tcm->tcm_ifindex) { + ctx->ifindex = ULONG_MAX; + break; + } s_q_idx = 0; + } q_idx = 0; netdev_lock_ops(dev); -- 2.54.0.545.g6539524ca2-goog