[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080415192924.GA3755@ami.dom.local>
Date: Tue, 15 Apr 2008 21:29:24 +0200
From: Jarek Poplawski <jarkao2@...il.com>
To: Patrick McHardy <kaber@...sh.net>
Cc: David Miller <davem@...emloft.net>, enrico@...erclick.com,
netdev@...r.kernel.org
Subject: Re: [PATCH][NET_SCHED] sch_api: fix qdisc_tree_decrease_qlen() loop
On Tue, Apr 15, 2008 at 08:25:41PM +0200, Jarek Poplawski wrote:
> On Tue, Apr 15, 2008 at 07:41:44PM +0200, Jarek Poplawski wrote:
> > On Tue, Apr 15, 2008 at 03:09:53PM +0200, Patrick McHardy wrote:
...
> > > diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> > > index fc8708a..c486e9d 100644
> > > --- a/net/sched/sch_api.c
> > > +++ b/net/sched/sch_api.c
> > > @@ -386,7 +386,7 @@ void qdisc_tree_decrease_qlen(struct Qdisc *sch, unsigned int n)
> > > if (n == 0)
> > > return;
> > > while ((parentid = sch->parent)) {
> > > - if (TC_H_MAJ(parentid) == TC_H_MAJ(TC_H_INGRESS))
> > > + if (parentid == TC_H_INGRESS)
> >
> > Maybe like this?:
> > + if (parentid == TC_H_ROOT || parentid == TC_H_INGRESS)
>
> Still wrong! Rather this:
>
> while ((parentid = sch->parent)) {
> if (parentid == TC_H_ROOT)
> return;
...Hmm... it seems to be enough?! (At least with current ingress
functionality.)
>
> sch = qdisc_lookup(sch->dev, TC_H_MAJ(parentid));
> if (!sch || sch->parentid == TC_H_INGRESS) {
> ...
...and here WARN_ON() instead of if (): root is never looked up, so we
can't get NULL nor ingress here; if we have non-ingress ffff:0000
we'll get it (and ingress can't co-exist).
Jarek P.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists