Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755586AbcCAXze (ORCPT ); Tue, 1 Mar 2016 18:55:34 -0500 Received: from mail333.us4.mandrillapp.com ([205.201.137.77]:34623 "EHLO mail333.us4.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753340AbcCAXzO (ORCPT ); Tue, 1 Mar 2016 18:55:14 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=T8yIbV2jPBD9nPPW27PRlEar3davtSxIwXg8UyyxFw2mSBYIfqeHv5leWF9z7fZgcdjmKSciEi9I 6mDxAYpGBXsXj8ZibbvsTg19qgAlmr9QxO//k9zs+J/fAlqy1r+pnfplXfjskdXEpZWUc12t9urk OzG9ZecmFj29hc5p9Q4=; From: Greg Kroah-Hartman Subject: [PATCH 4.4 043/342] IFF_NO_QUEUE: Fix for drivers not calling ether_setup() X-Mailer: git-send-email 2.7.2 To: Cc: Greg Kroah-Hartman , , Mathieu Desnoyers , Phil Sutter , "David S. Miller" Message-Id: <20160301234529.360828289@linuxfoundation.org> In-Reply-To: <20160301234527.990448862@linuxfoundation.org> References: <20160301234527.990448862@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.985b0a8294174fa2a5691af997582a38 X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:53:57 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1787 Lines: 46 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Phil Sutter [ Upstream commit a813104d923339144078939175faf4e66aca19b4 ] My implementation around IFF_NO_QUEUE driver flag assumed that leaving tx_queue_len untouched (specifically: not setting it to zero) by drivers would make it possible to assign a regular qdisc to them without having to worry about setting tx_queue_len to a useful value. This was only partially true: I overlooked that some drivers don't call ether_setup() and therefore not initialize tx_queue_len to the default value of 1000. Consequently, removing the workarounds in place for that case in qdisc implementations which cared about it (namely, pfifo, bfifo, gred, htb, plug and sfb) leads to problems with these specific interface types and qdiscs. Luckily, there's already a sanitization point for drivers setting tx_queue_len to zero, which can be reused to assign the fallback value most qdisc implementations used, which is 1. Fixes: 348e3435cbefa ("net: sched: drop all special handling of tx_queue_len == 0") Tested-by: Mathieu Desnoyers Signed-off-by: Phil Sutter Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/net/core/dev.c +++ b/net/core/dev.c @@ -7128,8 +7128,10 @@ struct net_device *alloc_netdev_mqs(int dev->priv_flags = IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM; setup(dev); - if (!dev->tx_queue_len) + if (!dev->tx_queue_len) { dev->priv_flags |= IFF_NO_QUEUE; + dev->tx_queue_len = 1; + } dev->num_tx_queues = txqs; dev->real_num_tx_queues = txqs;