Re: [PATCH 2/2] net: sched: avoid duplicates in qdisc dump

From: Cong Wang
Date: Thu Aug 18 2016 - 21:43:03 EST


On Tue, Aug 16, 2016 at 2:53 PM, Jiri Kosina <jikos@xxxxxxxxxx> wrote:
> From: Jiri Kosina <jkosina@xxxxxxx>
>
> tc_dump_qdisc() performs dumping of the per-device qdiscs in two phases;
> first, the "standard" dev->qdisc is being dumped. Second, if there is/are
> ingress queue(s), they are being dumped as well.
>
> After conversion of netdevice's qdisc linked-list into hashtable, these
> two sets are not in two disjunctive sets/lists any more, but are both
> "reachable" directly from netdevice's hashtable. As a consequence, the
> "full-depth" dump of the ingress qdiscs results in immediately hitting the
> netdevice hashtable again, and duplicating the dump that has already been
> performed for dev->qdisc.
> What in fact needs to be dumped in case of ingress queue is "just" the
> top-level ingress qdisc, as everything else has been dumped already.

Doesn't this mean we can now just remove the ingress case from
tc_dump_qdisc() and simply iterate the whole hash table?