From: Jarek Poplawski <jarkao2@gmail.com>
To: Patrick McHardy <kaber@trash.net>
Cc: David Miller <davem@davemloft.net>,
enrico@superclick.com, netdev@vger.kernel.org
Subject: Re: [PATCH][NET_SCHED] sch_api: fix qdisc_tree_decrease_qlen() loop
Date: Tue, 15 Apr 2008 21:29:24 +0200 [thread overview]
Message-ID: <20080415192924.GA3755@ami.dom.local> (raw)
In-Reply-To: <20080415182541.GA3708@ami.dom.local>
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.
prev parent reply other threads:[~2008-04-15 19:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-11 18:37 HTB and ingress scheduler SMP Soft Lockup in 2.6.23-2.6.25-rc8 Enrico Demarin
2008-04-13 7:51 ` Patrick McHardy
2008-04-13 19:20 ` Enrico Demarin
2008-04-14 7:14 ` Patrick McHardy
2008-04-14 7:15 ` Patrick McHardy
2008-04-14 7:20 ` Patrick McHardy
2008-04-14 7:51 ` Patrick McHardy
2008-04-13 12:10 ` Jarek Poplawski
2008-04-14 20:26 ` [PATCH][NET_SCHED] sch_api: fix qdisc_tree_decrease_qlen() loop Jarek Poplawski
2008-04-14 20:28 ` Patrick McHardy
2008-04-14 22:11 ` David Miller
2008-04-15 5:32 ` Jarek Poplawski
2008-04-15 12:37 ` Patrick McHardy
2008-04-15 13:00 ` Jarek Poplawski
2008-04-15 13:09 ` Patrick McHardy
2008-04-15 13:10 ` Patrick McHardy
2008-04-15 17:41 ` Jarek Poplawski
2008-04-15 18:25 ` Jarek Poplawski
2008-04-15 19:29 ` Jarek Poplawski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080415192924.GA3755@ami.dom.local \
--to=jarkao2@gmail.com \
--cc=davem@davemloft.net \
--cc=enrico@superclick.com \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).