From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9FED4A034F; Wed, 13 May 2020 05:46:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 51B9F1C0AF; Wed, 13 May 2020 05:46:39 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 046811BFE0; Wed, 13 May 2020 05:46:37 +0200 (CEST) IronPort-SDR: h6ZB85NXKUs+x1m8Cq7pIPTqLYUeeYc5W+N7ZUA55zqa8G/ZxyVhm3Oj9OPhcSyLvgB6QHX4/D 1hKeBk+fTPDQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 20:46:36 -0700 IronPort-SDR: btdH75e1Bynr3Ht86tNUPLIhBzzwTQ3pXsosA+y+KIxGubzzNDLu8PkQcI3kBJTNU6HaLSCdTV cgX2YPI6qQgw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,386,1583222400"; d="scan'208";a="371774624" Received: from intel.sh.intel.com ([10.239.255.18]) by fmsmga001.fm.intel.com with ESMTP; 12 May 2020 20:46:34 -0700 From: Shougang Wang To: dev@dpdk.org Cc: beilei.xing@intel.com, jia.guo@intel.com, Shougang Wang , stable@dpdk.org Date: Wed, 13 May 2020 03:33:20 +0000 Message-Id: <20200513033320.15771-1-shougangx.wang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200424085225.27655-1-shougangx.wang@intel.com> References: <20200424085225.27655-1-shougangx.wang@intel.com> Subject: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes the issue that the queue region does not take effect due to incorrectly setting the flow type. Fixes: ecad87d22383 ("net/i40e: move RSS to flow API") Cc: stable@dpdk.org Signed-off-by: Shougang Wang Reviewed-by: Jeff Guo --- drivers/net/i40e/i40e_flow.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 7e64ae53a..2f937567b 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -4625,6 +4625,34 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, uint32_t index = 0; uint64_t hf_bit = 1; + static const struct { + uint64_t rss_type; + enum i40e_filter_pctype pctype; + } pctype_match_table[] = { + {ETH_RSS_FRAG_IPV4, + I40E_FILTER_PCTYPE_FRAG_IPV4}, + {ETH_RSS_NONFRAG_IPV4_TCP, + I40E_FILTER_PCTYPE_NONF_IPV4_TCP}, + {ETH_RSS_NONFRAG_IPV4_UDP, + I40E_FILTER_PCTYPE_NONF_IPV4_UDP}, + {ETH_RSS_NONFRAG_IPV4_SCTP, + I40E_FILTER_PCTYPE_NONF_IPV4_SCTP}, + {ETH_RSS_NONFRAG_IPV4_OTHER, + I40E_FILTER_PCTYPE_NONF_IPV4_OTHER}, + {ETH_RSS_FRAG_IPV6, + I40E_FILTER_PCTYPE_FRAG_IPV6}, + {ETH_RSS_NONFRAG_IPV6_TCP, + I40E_FILTER_PCTYPE_NONF_IPV6_TCP}, + {ETH_RSS_NONFRAG_IPV6_UDP, + I40E_FILTER_PCTYPE_NONF_IPV6_UDP}, + {ETH_RSS_NONFRAG_IPV6_SCTP, + I40E_FILTER_PCTYPE_NONF_IPV6_SCTP}, + {ETH_RSS_NONFRAG_IPV6_OTHER, + I40E_FILTER_PCTYPE_NONF_IPV6_OTHER}, + {ETH_RSS_L2_PAYLOAD, + I40E_FILTER_PCTYPE_L2_PAYLOAD}, + }; + NEXT_ITEM_OF_ACTION(act, actions, index); rss = act->conf; @@ -4641,9 +4669,10 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, } if (p_info.action_flag) { - for (n = 0; n < 64; n++) { - if (rss->types & (hf_bit << n)) { - conf_info->region[0].hw_flowtype[0] = n; + for (j = 0; j < RTE_DIM(pctype_match_table); j++) { + if (rss->types & pctype_match_table[j].rss_type) { + conf_info->region[0].hw_flowtype[0] = + (uint8_t)pctype_match_table[j].pctype; conf_info->region[0].flowtype_num = 1; conf_info->queue_region_number = 1; break; -- 2.17.1