Skip to content

Commit 4eea21d

Browse files
lcolittifelipebalbi
authored andcommitted
usb: gadget: u_ether: enable qmult on SuperSpeed Plus as well
The u_ether driver has a qmult setting that multiplies the transmit queue length (which by default is 2). The intent is that it should be enabled at high/super speed, but because the code does not explicitly check for USB_SUPER_PLUS, it is disabled at that speed. Fix this by ensuring that the queue multiplier is enabled for any wired link at high speed or above. Using >= for USB_SPEED_* constants seems correct because it is what the gadget_is_xxxspeed functions do. The queue multiplier substantially helps performance at higher speeds. On a direct SuperSpeed Plus link to a Linux laptop, iperf3 single TCP stream: Before (qmult=1): 1.3 Gbps After (qmult=5): 3.2 Gbps Fixes: 04617db ("usb: gadget: add SS descriptors to Ethernet gadget") Reviewed-by: Maciej Żenczykowski <[email protected]> Signed-off-by: Lorenzo Colitti <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent d98ef43 commit 4eea21d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/gadget/function/u_ether.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ struct eth_dev {
9393
static inline int qlen(struct usb_gadget *gadget, unsigned qmult)
9494
{
9595
if (gadget_is_dualspeed(gadget) && (gadget->speed == USB_SPEED_HIGH ||
96-
gadget->speed == USB_SPEED_SUPER))
96+
gadget->speed >= USB_SPEED_SUPER))
9797
return qmult * DEFAULT_QLEN;
9898
else
9999
return DEFAULT_QLEN;

0 commit comments

Comments
 (0)