All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Phil Sutter <phil@nwl.cc>
Cc: netdev@vger.kernel.org,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	Cong Wang <cwang@twopensource.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	David Miller <davem@davemloft.net>
Subject: Re: [net-next PATCH 2/3] net: sched: set tx_queue_len to default when changing noqueue device's qdisc
Date: Wed, 29 Jul 2015 23:10:22 +0200	[thread overview]
Message-ID: <20150729211022.GG32705@breakpoint.cc> (raw)
In-Reply-To: <1438203103-27013-3-git-send-email-phil@nwl.cc>

Phil Sutter <phil@nwl.cc> wrote:
> Virtual interfaces don't necessarily need a qdisc attached to them. This
> is signalled by setting dev->tx_queue_len to zero upon initialisation. The
> problems begin when a user still adds a qdisc, as then the special value
> is used as a regular one causing massive packet drops as soon as the
> device sees a bit of traffic load.
> 
> This patch solves the issue by setting tx_queue_len to the global
> default for physical devices if it is zero and a qdisc is added. Another
> benefit of this is that veth devices can default to noqueue while still
> preserving the expected behaviour when adding a qdisc.
> 
> The drawback of this patch is that the noqueue state won't be restored
> after a user has removed the custom qdisc, as the information about
> whether this is legitimate for the given device is lost.
> 
> Signed-off-by: Phil Sutter <phil@nwl.cc>
> ---
>  net/sched/sch_api.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index f06aa01..79b8900 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -1315,6 +1315,10 @@ graft:
>  			qdisc_destroy(q);
>  		return err;
>  	}
> +	/* circumvent noqueue hack for virtual interfaces if
> +	 * user desires to use a qdisc on it */
> +	if (!dev->tx_queue_len)
> +		dev->tx_queue_len = CONFIG_DEFAULT_TX_QUEUE_LEN;

The comment should tell you that this isn't pretty :-)

How about making tx_queue_len really the tx_queue_len, and some
not some "yeah, if its zero don't assign a queue"?

IOW, why not specifically annotate virtual devices so they do not get a
queue, ever (unless configured?)

That would allow to leave every default setting just the way they are,
and it would not muck with people assigning e.g. htb to veth since
the txqlen would be untouched.

But aside from that, I think your suggested hack would work.

  parent reply	other threads:[~2015-07-29 21:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29 20:51 [net-next PATCH 0/3] Backwards-compatible noqueue in virtual interfaces Phil Sutter
2015-07-29 20:51 ` [net-next PATCH 1/3] net: make default tx_queue_len configurable Phil Sutter
2015-07-29 20:51   ` [net-next PATCH 2/3] net: sched: set tx_queue_len to default when changing noqueue device's qdisc Phil Sutter
2015-07-29 20:51     ` [net-next PATCH 3/3] veth: don't assign a qdisc to veth Phil Sutter
2015-07-29 21:10     ` Florian Westphal [this message]
2015-07-29 21:10     ` [net-next PATCH 2/3] net: sched: set tx_queue_len to default when changing noqueue device's qdisc Eric Dumazet
2015-07-29 22:08       ` Phil Sutter
2015-07-29 21:06   ` [net-next PATCH 1/3] net: make default tx_queue_len configurable Florian Westphal
2015-07-29 21:34     ` Phil Sutter
2015-07-29 21:37       ` David Miller
2015-08-11 15:48         ` Jesper Dangaard Brouer
2015-08-11 16:23           ` Phil Sutter
2015-08-12  1:13             ` Alexei Starovoitov
2015-08-12 14:55               ` Eric Dumazet
2015-08-13  1:13               ` Phil Sutter
2015-08-13 13:10                 ` Jesper Dangaard Brouer
2015-08-13 15:06                   ` Phil Sutter
2015-07-29 23:10 ` [net-next PATCH 0/3] Backwards-compatible noqueue in virtual interfaces Cong Wang

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=20150729211022.GG32705@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=brouer@redhat.com \
    --cc=cwang@twopensource.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=phil@nwl.cc \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.