Skip to content

Commit 452c447

Browse files
Ming Leidavem330
Ming Lei
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a88c32a commit 452c447

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/net/usb/usbnet.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,15 @@ void usbnet_update_max_qlen(struct usbnet *dev)
355355
dev->rx_qlen = MAX_QUEUE_MEMORY / dev->rx_urb_size;
356356
dev->tx_qlen = MAX_QUEUE_MEMORY / dev->hard_mtu;
357357
break;
358+
case USB_SPEED_SUPER:
359+
/*
360+
* Not take default 5ms qlen for super speed HC to
361+
* save memory, and iperf tests show 2.5ms qlen can
362+
* work well
363+
*/
364+
dev->rx_qlen = 5 * MAX_QUEUE_MEMORY / dev->rx_urb_size;
365+
dev->tx_qlen = 5 * MAX_QUEUE_MEMORY / dev->hard_mtu;
366+
break;
358367
default:
359368
dev->rx_qlen = dev->tx_qlen = 4;
360369
}

0 commit comments

Comments
 (0)