Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp601460pxx; Wed, 28 Oct 2020 12:07:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqKN1AiA7qr/VHfUZ+5mMjMyfAZHJCw/1efu8FlnNTil4jqcS+Hq795NkFe+1njlxcYOs8 X-Received: by 2002:aa7:d597:: with SMTP id r23mr365084edq.19.1603912066221; Wed, 28 Oct 2020 12:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603912066; cv=none; d=google.com; s=arc-20160816; b=Zy6Pw4ztE34oEX9DFpG6RcmSZwwstdNIsL2OegrP7f3LoDvlLlDQxxTKTFuquPdAHW lnBNoYGY1bp5+OdDKUR1N7tc47ql1Zv+7JNe95l6HVXPnzxxUgX+f57IHrS/lsLWt33z AzdGP6QVkpP3XW6AlgVW82pvGXQ6kPwHGzIEO8Q26llDprsbjAq45zjxECXIihQ3p4CF YN1dAWHKCrUSN0RgHE8mtflaJxNxnhDw+wdkqf5eBptvgsXr/fyIxvLNLXL29+N0M92e xpuXzOnJZ/qCk3/RfEaxixJLZ6fQnV+tpQPdxNMerpdZjncHvjosYNu9h8u1+XGKnz+k EUew== 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=hCpAt4vAvbAFC7Re+0Q5DljOk7SkExor+GrxsI9k8sA=; b=ZzfoT6+tKyGeHxZX/ML/zWF35vhWLxPg0GlhoyIPIKLcglwnDeMhjLZ5fTKfhqXqfU UPBPabBIinyk1zpruRrHreEF4/DrrIngQmr99zoEm8SGD0ADs+D4ZA8Kvbliu1fcjpeJ 85BY8j4LplHAHzOaGq2hVrxrMmov2t8NOx9BNvrUah/GXHySTHaUt/LKAaW/Uzz3Prs5 xafETs65KFuhEAqJz8pj07/8dj1+Ppj0qN3IYhx8+wYTrPIqJ1we8m9fJHRIBAjIyQxX 5UCJ1lycc9QcfYnTniLjdg2xJc4elkcnhQN3Cg0xHgz1aXpT8Ds1ar+KE51H2qvQZINM kurg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SAQJpahe; 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 co4si129868edb.461.2020.10.28.12.07.23; Wed, 28 Oct 2020 12:07:46 -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=SAQJpahe; 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 S1826240AbgJ0SRw (ORCPT + 99 others); Tue, 27 Oct 2020 14:17:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:60676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756115AbgJ0OLY (ORCPT ); Tue, 27 Oct 2020 10:11:24 -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 256D922202; Tue, 27 Oct 2020 14:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807883; bh=PM2dthYK7xifipoivOqETOraQQVTdcywJXTnIu7RzPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SAQJpaheH50hrofvmKX0+yTxshdd+neMudzXZFybgtRrbS/IyoiKsI99kfOHnIqG3 hEjsZo+/rwXHVQSjoLXqE2/Lw7f4RYHsQF0+WbzB3B9B59b1ZgnPG1H/s1vEH5wQ4C kt8WzYzjWDauz7pbVqq+HN9DQbeapb1GttfyB/x8= 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.14 077/191] usb: gadget: u_ether: enable qmult on SuperSpeed Plus as well Date: Tue, 27 Oct 2020 14:48:52 +0100 Message-Id: <20201027134913.404821399@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@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 81d84e0c3c6cd..716edd593a994 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; -- 2.25.1