Re: [PATCH v2 1/2] net: sched: make default fifo qdiscs appear in the dump

From: Jiri Kosina
Date: Wed Mar 08 2017 - 10:35:45 EST


On Wed, 8 Mar 2017, Eric Dumazet wrote:

> > +++ b/net/sched/sch_qfq.c
> > @@ -494,6 +494,8 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
> > goto destroy_class;
> > }
> >
> > + if (cl->qdisc != &noop_qdisc)
> > + qdisc_hash_add(cl->qdisc, true);
>
>
> Please move the test in qdisc_hash_add() instead of copy/pasting it all
> over the places ?

Well, qdisc_hash_add() has a WARN_ON() (inherited from what
qdisc_list_add() used to do) for that particular case to catch cases where
singleton qdisc would make it there from other places by mistake. By
putting this test there we'll effectively giving up on this warning should
it ever point to a bug.

Thanks,

--
Jiri Kosina
SUSE Labs