From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83B72A0547 for ; Mon, 21 Jun 2021 10:05:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7187B4118D; Mon, 21 Jun 2021 10:05:54 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 1D6B840040; Mon, 21 Jun 2021 10:05:50 +0200 (CEST) IronPort-SDR: jf9DRkj7HUV7RN2IpYh2aP+HMnQAV9v5IBgC4b1E7KjiWkDZSTmvz0VR2OYBkg6wGb+M6P3prh I7aykrML6YKQ== X-IronPort-AV: E=McAfee;i="6200,9189,10021"; a="206839660" X-IronPort-AV: E=Sophos;i="5.83,289,1616482800"; d="scan'208";a="206839660" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2021 01:05:49 -0700 IronPort-SDR: jAVprk4SjrPLZ4H38gcpcXKqtughq9gTdlQXPEya79Brb9Q9XG9lrZ3BBnjf0VOQ7PRKPOYzZ3 64C7IpOOUDNA== X-IronPort-AV: E=Sophos;i="5.83,289,1616482800"; d="scan'208";a="486400793" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.194]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2021 01:05:47 -0700 From: Steve Yang To: dev@dpdk.org Cc: beilei.xing@intel.com, Steve Yang , stable@dpdk.org Date: Mon, 21 Jun 2021 08:03:42 +0000 Message-Id: <20210621080342.184889-1-stevex.yang@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210611065457.988344-1-stevex.yang@intel.com> References: <20210611065457.988344-1-stevex.yang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v3] net/i40e: fix set rss hash function invalid X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" i40e can support following rss hash function types: default/toeplitz, symmetric toeplitz, and simple_xor. However, when filter engine parses pattern action, it only supports symmetric toeplitz & default. Add simple_xor and toeplitz hash functions support when parsing pattern action. Fixes: ef4c16fd9148 ("net/i40e: refactor RSS flow") Cc: stable@dpdk.org Signed-off-by: Steve Yang --- v3: - add Cc stable line. v2: - add the fix line. - support simple_xor and toeplitz hash functions explicitly. drivers/net/i40e/i40e_hash.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/net/i40e/i40e_hash.c b/drivers/net/i40e/i40e_hash.c index b1cb24f437..0cef21c88f 100644 --- a/drivers/net/i40e/i40e_hash.c +++ b/drivers/net/i40e/i40e_hash.c @@ -1105,13 +1105,21 @@ i40e_hash_parse_pattern_act(const struct rte_eth_dev *dev, NULL, "RSS Queues not supported when pattern specified"); - if (rss_act->func == RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) + switch (rss_act->func) { + case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ: rss_conf->symmetric_enable = true; - else if (rss_act->func != RTE_ETH_HASH_FUNCTION_DEFAULT) - return rte_flow_error_set(error, -EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION_CONF, - NULL, - "Only symmetric TOEPLITZ supported when pattern specified"); + break; + case RTE_ETH_HASH_FUNCTION_DEFAULT: + case RTE_ETH_HASH_FUNCTION_TOEPLITZ: + case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR: + break; + default: + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, + NULL, + "RSS hash function not supported " + "when pattern specified"); + } if (!i40e_hash_validate_rss_types(rss_act->types)) return rte_flow_error_set(error, EINVAL, -- 2.27.0