summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2020-08-19 01:19:49 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 09:05:36 +0100
commitd09f63a3a7b641f96fe30aefbb2b724cede72207 (patch)
tree68cfebc5f7de36cf9823cfdcdcb8235c03029f43 /drivers/usb
parent528808a3b332d908c9848d4c194746cf1bebaef1 (diff)
downloadlinux-stable-d09f63a3a7b641f96fe30aefbb2b724cede72207.tar.gz
linux-stable-d09f63a3a7b641f96fe30aefbb2b724cede72207.tar.bz2
linux-stable-d09f63a3a7b641f96fe30aefbb2b724cede72207.zip
usb: gadget: u_ether: enable qmult on SuperSpeed Plus as well
[ Upstream commit 4eea21dc67b0c6ba15ae41b1defa113a680a858e ] 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: 04617db7aa68 ("usb: gadget: add SS descriptors to Ethernet gadget") Reviewed-by: Maciej Żenczykowski <maze@google.com> Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Signed-off-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/function/u_ether.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index d5fbc2352029..589d1f5fb575 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -97,7 +97,7 @@ struct eth_dev {
static inline int qlen(struct usb_gadget *gadget, unsigned qmult)
{
if (gadget_is_dualspeed(gadget) && (gadget->speed == USB_SPEED_HIGH ||
- gadget->speed == USB_SPEED_SUPER))
+ gadget->speed >= USB_SPEED_SUPER))
return qmult * DEFAULT_QLEN;
else
return DEFAULT_QLEN;