Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp160998pxx; Wed, 28 Oct 2020 01:08:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi86y8ZTdPgLW2KfHAK/e7t/lut9npwTKbrOUDO/+vt4yY3j3CnsbEGVPlL6fPTr9OrDVl X-Received: by 2002:a17:906:388d:: with SMTP id q13mr6208866ejd.92.1603872538141; Wed, 28 Oct 2020 01:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603872538; cv=none; d=google.com; s=arc-20160816; b=NLN2O/zX+YPhy5gGR7UJT2co5bEyfRvsAcWlRzuZz/lf+MAZAhYGvD3MQ8rqmv3P+T sJQtYP3EoAhcCk3Ns4lSVjH22jHMpxOdXS1KE+EVv3wQsv5Yxme4DDEjSSUfJ7z+XZdO wOf6fGXftqe+iLQlknzwb0sDTCIqTUlpNPWMB0+BgUrTpfH7cUCrzBHK6g1sOduH8KmT YjHIsHP19XOYBoNcUZ8OMLnPLHq7TywsGZA/n0pI6VN0PbyEv03sypvGGoTmFalgQ+Nv 9FfltkdZHDGXRPIvmKO5QQPAMHofnJmY3DVHoINuxo+WWD1tVvvzlWIKqky6UqHJC3hy 8Wxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H92ZEqotK7cb6wQxbe6z3hqRrS3UgBWVbu3ukAjS28g=; b=qWfutYRsBrMWYWrfq8+44Egb61SXEdLYP9EEJ7YnyyNqXfXrRclwidLU5QPNOQxkcq zceopkHMv9EKi7zWDHjsAlicasOjvVX6IB/dXiZpKzqMz1ehjnr7reHFYPV18xjURenK jp7mPwoJ+cOZSPRS/pjZm6n0Im86Tyr3I5HqcTYoKUDknVOF8EgZAl+KD5G2DziSfo+5 pe9+SW35QicqHxxM37NvclYr9gZT7e56Q0mBznrApKCvN5QOcqzO7BRTzGL5IMViYWDG XvMh7eDlqenkM3ZN4O3AsfOisye4tmkPWqSFUCqBWsnq+uaDZJsRiasJ6jI4cL/5yB7B rOxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gBBeB+kP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si2816688ejh.153.2020.10.28.01.08.36; Wed, 28 Oct 2020 01:08:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gBBeB+kP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753170AbgJ0N6o (ORCPT + 99 others); Tue, 27 Oct 2020 09:58:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:45986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753150AbgJ0N6j (ORCPT ); Tue, 27 Oct 2020 09:58:39 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8685B2072D; Tue, 27 Oct 2020 13:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807119; bh=fL/+WdbDyFdl/Fk6youU4FX5YvcA2hwU4Pl6/5DP41M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gBBeB+kPhurEt8o8Hq5GT882ulSeRRf/aaxZyJGdYTaU/jRO8PdLSVi1pTbsgnQwt miKEi3U1ZMY5Zt08j50Rx7WSkexxjGwH7bLSw9psmcaxX5rgns+6I3fhu7mqiIetE/ gmOwX+LQg093TyXzgRvof/TYU9wDji2JKyOFLODA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Maciej=20=C5=BBenczykowski?= , Lorenzo Colitti , Felipe Balbi , Sasha Levin Subject: [PATCH 4.4 049/112] usb: gadget: u_ether: enable qmult on SuperSpeed Plus as well Date: Tue, 27 Oct 2020 14:49:19 +0100 Message-Id: <20201027134902.883085050@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lorenzo Colitti [ 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 Signed-off-by: Lorenzo Colitti Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/gadget/function/u_ether.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c index e69f20b2a3f44..46c50135ef9f7 100644 --- a/drivers/usb/gadget/function/u_ether.c +++ b/drivers/usb/gadget/function/u_ether.c @@ -96,7 +96,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; -- 2.25.1