[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161104093526.GM5640@orbyte.nwl.cc>
Date: Fri, 4 Nov 2016 10:35:26 +0100
From: Phil Sutter <phil@....cc>
To: Jesper Dangaard Brouer <brouer@...hat.com>
Cc: netdev@...r.kernel.org, Robert Olsson <robert@...julf.se>,
Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [net-next PATCH 3/3] qdisc: catch misconfig of attaching qdisc
to tx_queue_len zero device
Hi,
On Thu, Nov 03, 2016 at 02:56:11PM +0100, Jesper Dangaard Brouer wrote:
[...]
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index 206dc24add3a..f337f1bdd1d4 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -960,6 +960,17 @@ static struct Qdisc *qdisc_create(struct net_device *dev,
>
> sch->handle = handle;
>
> + /* This exist to keep backward compatible with a userspace
> + * loophole, what allowed userspace to get IFF_NO_QUEUE
> + * facility on older kernels by setting tx_queue_len=0 (prior
> + * to qdisc init), and then forgot to reinit tx_queue_len
> + * before again attaching a qdisc.
> + */
> + if ((dev->priv_flags & IFF_NO_QUEUE) && (dev->tx_queue_len == 0)) {
> + dev->tx_queue_len = DEFAULT_TX_QUEUE_LEN;
> + netdev_info(dev, "Caught tx_queue_len zero misconfig\n");
> + }
I wonder why this is limited to IFF_NO_QUEUE devices. Do you think there
is a valid use case for physical ones?
Also, if we sanitize here, couldn't we then just get rid of the
sanitization you're fixing in patch 2?
Apart from that, ACK to all the patches. Thanks for cleaning up my mess!
:)
Cheers, Phil
Powered by blists - more mailing lists