netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen.hemminger@vyatta.com>
To: David Miller <davem@davemloft.net>
Cc: kaber@trash.net, netdev@vger.kernel.org
Subject: Re: [PATCH] net: trap attempts to modify noop qdisc
Date: Thu, 7 Aug 2008 10:22:42 -0700	[thread overview]
Message-ID: <20080807102242.7d365eff@extreme> (raw)
In-Reply-To: <20080806.233703.193701199.davem@davemloft.net>

On Wed, 06 Aug 2008 23:37:03 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <stephen.hemminger@vyatta.com>
> Date: Wed, 6 Aug 2008 23:15:16 -0700
> 
> > On Wed, 06 Aug 2008 23:11:59 -0700 (PDT)
> > David Miller <davem@davemloft.net> wrote:
> > 
> > > From: Stephen Hemminger <stephen.hemminger@vyatta.com>
> > > Date: Wed, 6 Aug 2008 23:08:50 -0700
> > > 
> > > > Since noop qdisc is a singleton, it shouldn't end up with any other
> > > > qdisc's on it's list, and it shouldn't be deleted.
> > > > 
> > > > Dave, this should help you find the bug.
> > > 
> > > Thanks.
> > 
> > I think the root of your problem (bad pun) is that the new code
> > is assuming that changes to the root are done with parent handle of 0,
> > but the API is for the parent handle to be TC_H_ROOT (0xFFFFFFFFU).
> 
> This is what I just committed to net-2.6, please give it a whirl.
> 
> pkt_sched: Fix "parent is root" test in qdisc_create().
> 
> As noticed by Stephen Hemminger, the root qdisc is denoted by
> TC_H_ROOT, not zero.
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  net/sched/sch_api.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index 4840aff..83b23b5 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -792,7 +792,7 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue,
>  				goto err_out3;
>  			}
>  		}
> -		if (parent && !(sch->flags & TCQ_F_INGRESS))
> +		if ((parent != TC_H_ROOT) && !(sch->flags & TCQ_F_INGRESS))
>  			list_add_tail(&sch->list, &dev_queue->qdisc->list);
>  
>  		return sch;

Thanks, that fixes it.

You still might want to add a BUG_ON there for anything that is internal qdisc.

      parent reply	other threads:[~2008-08-07 17:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-07  1:02 sfq dump broken in 2.6.27-rc1 Stephen Hemminger
2008-08-07  1:13 ` David Miller
2008-08-07  3:20   ` Stephen Hemminger
2008-08-07  3:22     ` David Miller
2008-08-07  6:08       ` [PATCH] net: trap attempts to modify noop qdisc Stephen Hemminger
2008-08-07  6:11         ` David Miller
2008-08-07  6:15           ` Stephen Hemminger
2008-08-07  6:18             ` David Miller
     [not found]             ` <20080806.233703.193701199.davem@davemloft.net>
2008-08-07 17:22               ` Stephen Hemminger [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=20080807102242.7d365eff@extreme \
    --to=stephen.hemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --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).