Skip to content

Commit a813104

Browse files
Phil Sutterdavem330
authored andcommitted
IFF_NO_QUEUE: Fix for drivers not calling ether_setup()
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: 348e343 ("net: sched: drop all special handling of tx_queue_len == 0") Tested-by: Mathieu Desnoyers <[email protected]> Signed-off-by: Phil Sutter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d13b161 commit a813104

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/core/dev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7422,8 +7422,10 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
74227422
dev->priv_flags = IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM;
74237423
setup(dev);
74247424

7425-
if (!dev->tx_queue_len)
7425+
if (!dev->tx_queue_len) {
74267426
dev->priv_flags |= IFF_NO_QUEUE;
7427+
dev->tx_queue_len = 1;
7428+
}
74277429

74287430
dev->num_tx_queues = txqs;
74297431
dev->real_num_tx_queues = txqs;

0 commit comments

Comments
 (0)