Commit 7ff14c5
usbnet: Add support for Byte Queue Limits (BQL)
In the current implementation, usbnet uses a fixed tx_qlen of:
USB2: 60 * 1518 bytes = 91.08 KB
USB3: 60 * 5 * 1518 bytes = 454.80 KB
Such large transmit queues can be problematic, especially for cellular
modems. For example, with a typical celluar link speed of 10 Mbit/s, a
fully occupied USB3 transmit queue results in:
454.80 KB / (10 Mbit/s / 8 bit/byte) = 363.84 ms
of additional latency.
This patch adds support for Byte Queue Limits (BQL) [1] to dynamically
manage the transmit queue size and reduce latency without sacrificing
throughput.
Testing was performed on various devices using the usbnet driver for
packet transmission:
- DELOCK 66045: USB3 to 2.5 GbE adapter (ax88179_178a)
- DELOCK 61969: USB2 to 1 GbE adapter (asix)
- Quectel RM520: 5G modem (qmi_wwan)
- USB2 Android tethering (cdc_ncm)
No performance degradation was observed for iperf3 TCP or UDP traffic,
while latency for a prioritized ping application was significantly
reduced. For example, using the USB3 to 2.5 GbE adapter, which was fully
utilized by iperf3 UDP traffic, the prioritized ping was improved from
1.6 ms to 0.6 ms. With the same setup but with a 100 Mbit/s Ethernet
connection, the prioritized ping was improved from 35 ms to 5 ms.
[1] https://lwn.net/Articles/469652/
Signed-off-by: Simon Schippers <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>1 parent 23c52b5 commit 7ff14c5
2 files changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
831 | 831 | | |
832 | 832 | | |
833 | 833 | | |
| 834 | + | |
834 | 835 | | |
835 | 836 | | |
836 | 837 | | |
| |||
939 | 940 | | |
940 | 941 | | |
941 | 942 | | |
| 943 | + | |
942 | 944 | | |
943 | 945 | | |
944 | 946 | | |
| |||
1500 | 1502 | | |
1501 | 1503 | | |
1502 | 1504 | | |
| 1505 | + | |
1503 | 1506 | | |
1504 | 1507 | | |
1505 | 1508 | | |
| |||
1563 | 1566 | | |
1564 | 1567 | | |
1565 | 1568 | | |
| 1569 | + | |
1566 | 1570 | | |
1567 | 1571 | | |
1568 | 1572 | | |
| |||
1574 | 1578 | | |
1575 | 1579 | | |
1576 | 1580 | | |
| 1581 | + | |
| 1582 | + | |
1577 | 1583 | | |
1578 | 1584 | | |
1579 | 1585 | | |
| |||
1584 | 1590 | | |
1585 | 1591 | | |
1586 | 1592 | | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
1587 | 1597 | | |
1588 | 1598 | | |
1589 | 1599 | | |
| |||
1755 | 1765 | | |
1756 | 1766 | | |
1757 | 1767 | | |
| 1768 | + | |
1758 | 1769 | | |
1759 | 1770 | | |
1760 | 1771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
0 commit comments