Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp695064ybh; Tue, 10 Mar 2020 06:37:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsgWC1Lxat9TElpW0+lf1YI33KNp8s5LUBovVjeVi6UuqMy9rJ7u4iqAyM/yVKH4tlzdgGD X-Received: by 2002:aca:a98a:: with SMTP id s132mr1174996oie.75.1583847433128; Tue, 10 Mar 2020 06:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583847433; cv=none; d=google.com; s=arc-20160816; b=u+/T29iDlyj6Ch+QE8+7Nc1aRev0Bbv8ov3IX+ILvVXcfZYsFr2nqkqzC0xOtUaED5 ODxekw64l/yECT3EfzptJb+oG05Qw7dfYoGSqdrkDiVcyhxzhziatFNniYXedJ4nNrxN a18WEJJH2zPhF11V24P4LSNr8o73FWjr5QzsjAIg1OE/8iNBOM/FtRGi6+WmPhC4YBov Syy06V8UD1PYIm3rrniAmXvyLUkYd3CDukvCxn/5hP8nVmrvKDaQTPAcMs+N46rPWBUc ika5WLjIyQMwFskUEVd7nE9giFpQC1W7lpSIyoFMSZZpXavPORkZVi9w3tALOQ3dKTXK gmLg== 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=1JjBA1S8DUN6S1zjJFh0T1inCUtqFrCqiu9P55L2vHE=; b=BhbgOcwBM8MP+GMzYH2Fb3/ajkM9EOUXxaGffJAG94ZpmEGJ6BZSMPXgFFSo5zKd1Y sgYM8XSUK9rqhHM+VEnNO7PLp1Xx3gGqt/8t59xU5DVh5aZWvIGR+whnaheILMFLTEWt zkY8WK2zXx9jPnkEWgQT+tXEnrHsXhGQSzhtCDK1NFMa6cwjwVlTlQON7uU76NA8ZKf5 Fn03d28VdlcMU7FvgDg6yN6TrsM8SUD382VfZ54ur5+rEN0D4vMPrwokWLmT5h/X77+b woq5qDBY4CGzo3IZUZXWM952PQmnihRbcwwj+iSl9ps+C9ue5/1yJZbUJKAvBSu0IfHd kAJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ViSAN+Yp; 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 b1si5333073oib.79.2020.03.10.06.36.57; Tue, 10 Mar 2020 06:37:13 -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=ViSAN+Yp; 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 S1728309AbgCJNfH (ORCPT + 99 others); Tue, 10 Mar 2020 09:35:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:48058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727902AbgCJMp0 (ORCPT ); Tue, 10 Mar 2020 08:45:26 -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 A8072246A3; Tue, 10 Mar 2020 12:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583844326; bh=b3a7LXAN/jY9XCOOcUPYLK2gXw1etQtmbR5yY1H325s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ViSAN+YpLY8yUfVT8jn4pAQbOqPn/Y1QGZmUeJucIZVza2x4qCgomd39fQXxYXIFM AJ54OcIOBfuAKOCoMa4ZJX6AaZY1ZfnY7ceX2lFZG5YK76hS+di5iPkjcfhI782HEE yQzhmWMt3l1FG+UGrBxCGpGHQ10AJzGfRvcMrvZg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sameeh Jubran , Saeed Bshara , Arthur Kiyanovski , "David S. Miller" Subject: [PATCH 4.9 41/88] net: ena: make ena rxfh support ETH_RSS_HASH_NO_CHANGE Date: Tue, 10 Mar 2020 13:38:49 +0100 Message-Id: <20200310123615.977525680@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310123606.543939933@linuxfoundation.org> References: <20200310123606.543939933@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: Arthur Kiyanovski commit 470793a78ce344bd53d31e0c2d537f71ba957547 upstream. As the name suggests ETH_RSS_HASH_NO_CHANGE is received upon changing the key or indirection table using ethtool while keeping the same hash function. Also add a function for retrieving the current hash function from the ena-com layer. Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Sameeh Jubran Signed-off-by: Saeed Bshara Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/amazon/ena/ena_com.c | 5 +++++ drivers/net/ethernet/amazon/ena/ena_com.h | 8 ++++++++ drivers/net/ethernet/amazon/ena/ena_ethtool.c | 3 +++ 3 files changed, 16 insertions(+) --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -857,6 +857,11 @@ static void ena_com_hash_key_fill_defaul hash_key->keys_num = sizeof(hash_key->key) / sizeof(u32); } +int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev) +{ + return ena_dev->rss.hash_func; +} + static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) { struct ena_rss *rss = &ena_dev->rss; --- a/drivers/net/ethernet/amazon/ena/ena_com.h +++ b/drivers/net/ethernet/amazon/ena/ena_com.h @@ -623,6 +623,14 @@ int ena_com_rss_init(struct ena_com_dev */ void ena_com_rss_destroy(struct ena_com_dev *ena_dev); +/* ena_com_get_current_hash_function - Get RSS hash function + * @ena_dev: ENA communication layer struct + * + * Return the current hash function. + * @return: 0 or one of the ena_admin_hash_functions values. + */ +int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev); + /* ena_com_fill_hash_function - Fill RSS hash function * @ena_dev: ENA communication layer struct * @func: The hash function (Toeplitz or crc) --- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c +++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c @@ -751,6 +751,9 @@ static int ena_set_rxfh(struct net_devic } switch (hfunc) { + case ETH_RSS_HASH_NO_CHANGE: + func = ena_com_get_current_hash_function(ena_dev); + break; case ETH_RSS_HASH_TOP: func = ENA_ADMIN_TOEPLITZ; break;