Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2235851ybi; Thu, 20 Jun 2019 11:21:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUiWHzeS34CzULUZPwzkysBY6ONEu+7Ny1rwuruZor3x8KOd5ulPxM1A9r3kAPgx2kKZVZ X-Received: by 2002:a65:620d:: with SMTP id d13mr14288451pgv.109.1561054864733; Thu, 20 Jun 2019 11:21:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054864; cv=none; d=google.com; s=arc-20160816; b=Y7KtscyfLil4TkLtO+c5eUJJ4+7KS5XqksXCOcBvk0BLtHJnOmstmXi91q40NS3pIq ks8mrCqSDRMUEADsg2fGW+WjLbRpXuCQ6nw0lB6rzGsfVFaOIH9eDyYNwN23AqzzirBS aWWiudehQBLNeW5Ki2tBSOhmH/rskML/+PEohKZTqiZmxTqx5MAAdOlnywt4GG2S49s0 FSY3HcCZONAqetRy5nVA6DfKoJrdIrl17XQlhiwGkFuQ+Prupix05eKktUCHc6AECvgZ Ut327R3mECvS7MOYUeaYtatZEXQLnPwWNXZlncOz7i4wwkjHnBgRxjDhbSM8hcsnXpwO g+Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yMSVMilX1D6rI3FIkFBgQh8+Nw3U5ydl5LgLxbA24zA=; b=tSR9tfKJjMz15fom+iPHo3tvTnOHpvhvMyLsp24mdLuRBGgNZ0eS5cwxgV/ixUDV21 9sr2+zFrNLRMNqKNbdOS1UDL7tkRqNWbMsH7YNgdU0lA7SMKMwZ4cdfXvuH/zeCB7ar+ 4EyTXjE9K/Rdrj8oyYIXyplnrSS5gJho8gNzX53tu1d64m+pbjscbL30cu+h9kUec/9I gks2UFGQZXMDF1+Cl4EXWO65mZ4YkzAOIqG7KzJRi9znGSooJL4+I8WhDIhdLmtsh53j YuqB35/9RCvZ5m+AbeCkhCFY5vsWFlTgbrpg8W2ZqgolJf0q1XohYU7zKk54S7u0IAaP pxOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aA0P4xKi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si439298pju.32.2019.06.20.11.20.49; Thu, 20 Jun 2019 11:21:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aA0P4xKi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729229AbfFTSNS (ORCPT + 99 others); Thu, 20 Jun 2019 14:13:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:41182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729210AbfFTSNO (ORCPT ); Thu, 20 Jun 2019 14:13:14 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 F407B208CA; Thu, 20 Jun 2019 18:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054394; bh=UfCHc50+h/K+slCE7JCcG0jyf/MlE1PR41uhQPQgYXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aA0P4xKi76MfafJ6azyuGDEfeC7H/an3ae6HpIGcwInFyc/uDlD1JhK7F+SxKiMID mRWcfWflomsQuu/Do58mDfgeTurR+8wVjj7jcDlx9RbjJ0HuK5k+Ug6+eLhcdeszbl dYol4HvziYyjH1wfpz6Xs/2tZQyxL1iGHT2FDuYg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tianhao , Ivan Vecera , "David S. Miller" Subject: [PATCH 5.1 03/98] be2net: Fix number of Rx queues used for flow hashing Date: Thu, 20 Jun 2019 19:56:30 +0200 Message-Id: <20190620174349.585844987@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ivan Vecera [ Upstream commit 718f4a2537089ea41903bf357071306163bc7c04 ] Number of Rx queues used for flow hashing returned by the driver is incorrect and this bug prevents user to use the last Rx queue in indirection table. Let's say we have a NIC with 6 combined queues: [root@sm-03 ~]# ethtool -l enp4s0f0 Channel parameters for enp4s0f0: Pre-set maximums: RX: 5 TX: 5 Other: 0 Combined: 6 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 6 Default indirection table maps all (6) queues equally but the driver reports only 5 rings available. [root@sm-03 ~]# ethtool -x enp4s0f0 RX flow hash indirection table for enp4s0f0 with 5 RX ring(s): 0: 0 1 2 3 4 5 0 1 8: 2 3 4 5 0 1 2 3 16: 4 5 0 1 2 3 4 5 24: 0 1 2 3 4 5 0 1 ... Now change indirection table somehow: [root@sm-03 ~]# ethtool -X enp4s0f0 weight 1 1 [root@sm-03 ~]# ethtool -x enp4s0f0 RX flow hash indirection table for enp4s0f0 with 6 RX ring(s): 0: 0 0 0 0 0 0 0 0 ... 64: 1 1 1 1 1 1 1 1 ... Now it is not possible to change mapping back to equal (default) state: [root@sm-03 ~]# ethtool -X enp4s0f0 equal 6 Cannot set RX flow hash configuration: Invalid argument Fixes: 594ad54a2c3b ("be2net: Add support for setting and getting rx flow hash options") Reported-by: Tianhao Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/emulex/benet/be_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c @@ -1105,7 +1105,7 @@ static int be_get_rxnfc(struct net_devic cmd->data = be_get_rss_hash_opts(adapter, cmd->flow_type); break; case ETHTOOL_GRXRINGS: - cmd->data = adapter->num_rx_qs - 1; + cmd->data = adapter->num_rx_qs; break; default: return -EINVAL;