summaryrefslogtreecommitdiffstats
path: root/net/core/net-sysfs.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2017-05-17 13:30:44 +0300
committerDavid S. Miller <davem@davemloft.net>2017-05-18 10:19:30 -0400
commit0cd2950357e31a96be03b531b4b11fe1df812c9f (patch)
treeb9587e64729dee6f52b5c07867c1acc3df805fe1 /net/core/net-sysfs.c
parent64f5102dcb811b27d673eccc8cc0d76ce90981a4 (diff)
downloadop-kernel-dev-0cd2950357e31a96be03b531b4b11fe1df812c9f.zip
op-kernel-dev-0cd2950357e31a96be03b531b4b11fe1df812c9f.tar.gz
net: make struct net_device::tx_queue_len unsigned int
4 billion packet queue is something unthinkable so use 32-bit value for now. Space savings on x86_64: add/remove: 0/0 grow/shrink: 3/70 up/down: 16/-131 (-115) function old new delta change_tx_queue_len 94 108 +14 qdisc_create 1176 1177 +1 alloc_netdev_mqs 1124 1125 +1 xenvif_alloc 533 532 -1 x25_asy_setup 167 166 -1 ... tun_queue_resize 945 940 -5 pfifo_fast_enqueue 167 162 -5 qfq_init_qdisc 168 158 -10 tap_queue_resize 810 799 -11 transmit 719 698 -21 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/net-sysfs.c')
-rw-r--r--net/core/net-sysfs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 65ea0ff..58e6cc7 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -323,7 +323,11 @@ NETDEVICE_SHOW_RW(flags, fmt_hex);
static int change_tx_queue_len(struct net_device *dev, unsigned long new_len)
{
- int res, orig_len = dev->tx_queue_len;
+ unsigned int orig_len = dev->tx_queue_len;
+ int res;
+
+ if (new_len != (unsigned int)new_len)
+ return -ERANGE;
if (new_len != orig_len) {
dev->tx_queue_len = new_len;
@@ -349,7 +353,7 @@ static ssize_t tx_queue_len_store(struct device *dev,
return netdev_store(dev, attr, buf, len, change_tx_queue_len);
}
-NETDEVICE_SHOW_RW(tx_queue_len, fmt_ulong);
+NETDEVICE_SHOW_RW(tx_queue_len, fmt_dec);
static int change_gro_flush_timeout(struct net_device *dev, unsigned long val)
{
OpenPOWER on IntegriCloud