Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1192574ybn; Wed, 2 Oct 2019 12:13:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnhlBuxCvvhrqNOnu3yqxRb/kaH2d/lvoPYTNprx2QoVzIAFcL/9xd0DRBaKdPRoQGdLYZ X-Received: by 2002:a17:906:5284:: with SMTP id c4mr4573301ejm.39.1570043594042; Wed, 02 Oct 2019 12:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570043594; cv=none; d=google.com; s=arc-20160816; b=Aie0v7f+g297yfhWPFAuc12qttP7CFt/c9O+wQokp5KasTmaXkM+pcS+9rAiTzWV7e 79yrWs7A6D1D7dhABbaGY9D/9+4RSwW03g5zyZE4bF26eSDxTOPFh99DnNCuJOofARas 8pXpWsnRGr2fS9Zo6DWFuzv/nevlK23650kcH3X3idH3qy4BDa7/eZrYsjuu6YWcJnqv SKlTeqI6frg5zvKETiqUi1zuaQtIbCfI6KOZuBpIh/7Gy0DD+FHCsCj85bmN+ramYfuk ZkWkcOJE2S9iKKrmgV3r/tsfWmjTIFfg4QVQXfL9hVluyOXoh2/m+Jwxqq/TaVs2liKU X6Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=n/ikty8BOpgoQfYbGcaSaZyEI61g4WaHRvp4WTgcRgM=; b=eHByR1lajXf0uON6Q4AqdS8omTNxpOfIk7AINUsL+Sk00TM5ddoWzu8QAtEdm+VJR4 XbROIgNwCnDxTGHgVb8zybCeiCGm0r+xj+fADD4p9W5hvF/KGl6JpjiVg0NX2SJV3hMB 5Tbn7qB59EDRleaX87tf1PsLqgYm9jXa+gtFZaJpjYzQiv6sNaJvJNSK/gEJmnFhxb79 PaB3De8o8EcXw5NUw7oQ+8yUxzz3ZPLsWM3+9RdyNQQDdzQ+ZcYw1xaVvAOzCr/YtIAF 6ebN2oBwhFpzmLMkkM8Qnc+nfJBRU1gT03vt0j+9eCt240N2wfIFpeG93HXnLA2tDBgQ c+8w== ARC-Authentication-Results: i=1; mx.google.com; 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 d58si30271eda.62.2019.10.02.12.12.50; Wed, 02 Oct 2019 12:13:14 -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; 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 S1729741AbfJBTJ7 (ORCPT + 99 others); Wed, 2 Oct 2019 15:09:59 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35980 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729049AbfJBTIS (ORCPT ); Wed, 2 Oct 2019 15:08:18 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iFjyx-00035s-RP; Wed, 02 Oct 2019 20:08:15 +0100 Received: from ben by deadeye with local (Exim 4.92.1) (envelope-from ) id 1iFjyp-0003f0-Av; Wed, 02 Oct 2019 20:08:07 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "David S. Miller" , "Ivan Vecera" , "Tianhao" Date: Wed, 02 Oct 2019 20:06:51 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 64/87] be2net: Fix number of Rx queues used for flow hashing In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.75-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Ivan Vecera commit 718f4a2537089ea41903bf357071306163bc7c04 upstream. 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: Ben Hutchings --- 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 @@ -962,7 +962,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;