summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/usbnet.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-07-25 07:47:54 +0200
committerDavid S. Miller <davem@davemloft.net>2013-07-28 05:10:57 +0200
commit452c447a497dce3c9faeb9ac7f2e1ff39232876b (patch)
tree1ef4704e1598a67974e6ca000b1cb1d2a4105c53 /drivers/net/usb/usbnet.c
parentUSBNET: centralize computing of max rx/tx qlen (diff)
downloadlinux-452c447a497dce3c9faeb9ac7f2e1ff39232876b.tar.xz
linux-452c447a497dce3c9faeb9ac7f2e1ff39232876b.zip
USBNET: increase max rx/tx qlen for improving USB3 thoughtput
The default RX_QLEN()/TX_QLEN() didn't consider super speed USB device, so only max 4 URBs are scheduled at the same time for tx/rx, then USB3 NIC can't perform very well. With this patch, both rx and tx thoughput are increased more than 100Mbps when doing iperf test on ax88179_178a USB 3.0 NIC. Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r--drivers/net/usb/usbnet.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index d74de074a438..e4811d7b5af1 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -355,6 +355,15 @@ void usbnet_update_max_qlen(struct usbnet *dev)
dev->rx_qlen = MAX_QUEUE_MEMORY / dev->rx_urb_size;
dev->tx_qlen = MAX_QUEUE_MEMORY / dev->hard_mtu;
break;
+ case USB_SPEED_SUPER:
+ /*
+ * Not take default 5ms qlen for super speed HC to
+ * save memory, and iperf tests show 2.5ms qlen can
+ * work well
+ */
+ dev->rx_qlen = 5 * MAX_QUEUE_MEMORY / dev->rx_urb_size;
+ dev->tx_qlen = 5 * MAX_QUEUE_MEMORY / dev->hard_mtu;
+ break;
default:
dev->rx_qlen = dev->tx_qlen = 4;
}