Skip to content

Commit d0a81f6

Browse files
netoptimizerdavem330
authored andcommitted
net: make default TX queue length a defined constant
The default TX queue length of Ethernet devices have been a magic constant of 1000, ever since the initial git import. Looking back in historical trees[1][2] the value used to be 100, with the same comment "Ethernet wants good queues". The commit[3] that changed this from 100 to 1000 didn't describe why, but from conversations with Robert Olsson it seems that it was changed when Ethernet devices went from 100Mbit/s to 1Gbit/s, because the link speed increased x10 the queue size were also adjusted. This value later caused much heartache for the bufferbloat community. This patch merely moves the value into a defined constant. [1] https://git.kernel.org/cgit/linux/kernel/git/davem/netdev-vger-cvs.git/ [2] https://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/ [3] https://git.kernel.org/tglx/history/c/98921832c232 Signed-off-by: Jesper Dangaard Brouer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fc13fd3 commit d0a81f6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

include/net/pkt_sched.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include <linux/if_vlan.h>
77
#include <net/sch_generic.h>
88

9+
#define DEFAULT_TX_QUEUE_LEN 1000
10+
911
struct qdisc_walker {
1012
int stop;
1113
int skip;

net/ethernet/eth.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#include <net/dsa.h>
6363
#include <net/flow_dissector.h>
6464
#include <linux/uaccess.h>
65+
#include <net/pkt_sched.h>
6566

6667
__setup("ether=", netdev_boot_setup);
6768

@@ -359,7 +360,7 @@ void ether_setup(struct net_device *dev)
359360
dev->min_mtu = ETH_MIN_MTU;
360361
dev->max_mtu = ETH_DATA_LEN;
361362
dev->addr_len = ETH_ALEN;
362-
dev->tx_queue_len = 1000; /* Ethernet wants good queues */
363+
dev->tx_queue_len = DEFAULT_TX_QUEUE_LEN;
363364
dev->flags = IFF_BROADCAST|IFF_MULTICAST;
364365
dev->priv_flags |= IFF_TX_SKB_SHARING;
365366

0 commit comments

Comments
 (0)