netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, brouer@redhat.com
Subject: Re: [net-next PATCH 2/3] net: sched: allocate a handle to default qdiscs
Date: Fri, 21 Aug 2015 19:08:13 +0200	[thread overview]
Message-ID: <20150821170813.GA26535@orbit.nwl.cc> (raw)
In-Reply-To: <1440173698.6610.78.camel@edumazet-glaptop2.roam.corp.google.com>

On Fri, Aug 21, 2015 at 09:14:58AM -0700, Eric Dumazet wrote:
[...]
> > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> > index 1fb65f9..ab614ee 100644
> > --- a/net/sched/sch_generic.c
> > +++ b/net/sched/sch_generic.c
> > @@ -634,6 +634,11 @@ struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
> >  	if (IS_ERR(sch))
> >  		goto errout;
> >  	sch->parent = parentid;
> > +#ifdef CONFIG_NET_SCHED
> > +	sch->handle = qdisc_alloc_handle(dev_queue->dev);
> > +	if (!sch->handle)
> > +		goto errout;
> > +#endif
> >  
> >  	if (!ops->init || ops->init(sch, NULL) == 0)
> >  		return sch;
> 
> This might break HTB setups with more than 32768 classes ?

Urgh. Thanks for noticing this!

> The pfifo qdisc that gets attached had no handle.

Yes, looks like I need to leave qdisc_create_dflt() alone. It is
possible, by doing the above twice in sch_generic.c (once in
attach_one_default_qdisc(), and in attach_default_qdiscs() as well).

> qdisc_alloc_handle() has a limited range.

Yes, I noticed this. Handles aren't reused in a running system either,
which might contribute to this problem in other situations.

V2 will follow, thanks again.

Cheers, Phil

  reply	other threads:[~2015-08-21 17:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21 15:58 [net-next PATCH 0/3] net: sched: allow switching qdisc to noqueue intuitively Phil Sutter
2015-08-21 15:58 ` [net-next PATCH 1/3] net: sched: make noqueue_qdisc non-static Phil Sutter
2015-08-21 15:58 ` [net-next PATCH 2/3] net: sched: allocate a handle to default qdiscs Phil Sutter
2015-08-21 16:14   ` Eric Dumazet
2015-08-21 17:08     ` Phil Sutter [this message]
2015-08-21 15:58 ` [net-next PATCH 3/3] net: sched: fall back to noqueue when removing root qdisc Phil Sutter

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=20150821170813.GA26535@orbit.nwl.cc \
    --to=phil@nwl.cc \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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).