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 D3737A0540; Wed, 15 Jul 2020 10:25:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7E0141BFAC; Wed, 15 Jul 2020 10:25:21 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 6F68F1BF97; Wed, 15 Jul 2020 10:25:20 +0200 (CEST) IronPort-SDR: r5UrEd54/C3vvxaTdVu8wd/6r3546lZq5sHeJCLE2hm1OqCJouIp8KPMWO7nosXriflvKEaMNw iNNgyh8o30Xg== X-IronPort-AV: E=McAfee;i="6000,8403,9682"; a="136561775" X-IronPort-AV: E=Sophos;i="5.75,354,1589266800"; d="scan'208";a="136561775" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2020 01:25:19 -0700 IronPort-SDR: 9lF3WTocqZhuil7okhD1Y+DMFrcD3qW5TPtSEK/YxB9EzGXWuM1M5nJQOpfq1v3tvFNNz5nCdB 0eeU8cH7ua4A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,354,1589266800"; d="scan'208";a="299812147" Received: from intel.sh.intel.com ([10.239.255.20]) by orsmga002.jf.intel.com with ESMTP; 15 Jul 2020 01:25:17 -0700 From: Shougang Wang To: dev@dpdk.org Cc: beilei.xing@intel.com, jia.guo@intel.com, Shougang Wang , stable@dpdk.org Date: Wed, 15 Jul 2020 08:08:10 +0000 Message-Id: <20200715080810.45639-1-shougangx.wang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/i40e: fix missed i40e filter pctype 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" The i40e_filter_pctype TCP_SYN_NO_ACK, UNICAST_IPV4_UDP and MULTICAST_IPV4_UDP for x722 are missed when translate RSS type to i40e_filter_pctype. This patche fix it. Fixes: da7018ec29d4 ("net/i40e: fix queue region in RSS flow") Cc: stable@dpdk.org Signed-off-by: Shougang Wang --- drivers/net/i40e/i40e_flow.c | 45 ++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 7cd537340..7f34bc5a4 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -4853,11 +4853,12 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, const struct rte_flow_action *act; const struct rte_flow_action_rss *rss; struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); + struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct i40e_queue_regions *info = &pf->queue_region; struct i40e_rte_flow_rss_conf *rss_config = &filter->rss_conf; struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info; - uint16_t i, j, n, tmp, nb_types; + uint16_t i, j, n, m, tmp, nb_types; uint32_t index = 0; uint64_t hf_bit = 1; @@ -4889,6 +4890,24 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, I40E_FILTER_PCTYPE_L2_PAYLOAD}, }; + static const struct { + uint64_t rss_type; + enum i40e_filter_pctype pctype; + } pctype_match_table_x722[] = { + {ETH_RSS_NONFRAG_IPV4_TCP, + I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK}, + {ETH_RSS_NONFRAG_IPV4_UDP, + I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP}, + {ETH_RSS_NONFRAG_IPV4_UDP, + I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP}, + {ETH_RSS_NONFRAG_IPV6_TCP, + I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN_NO_ACK}, + {ETH_RSS_NONFRAG_IPV6_UDP, + I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP}, + {ETH_RSS_NONFRAG_IPV6_UDP, + I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP}, + }; + NEXT_ITEM_OF_ACTION(act, actions, index); rss = act->conf; @@ -4914,6 +4933,18 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, break; } } + + if (hw->mac.type == I40E_MAC_X722) + for (j = 0; j < RTE_DIM(pctype_match_table_x722); j++) { + if (rss->types & + pctype_match_table_x722[j].rss_type) { + m = conf_info->region[0].flowtype_num; + conf_info->region[0].hw_flowtype[m] = + pctype_match_table_x722[j].pctype; + conf_info->region[0].flowtype_num++; + conf_info->queue_region_number = 1; + } + } } /** @@ -5011,9 +5042,9 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, info->region[i].user_priority_num++; } - j = info->region[i].flowtype_num; - tmp = conf_info->region[n].hw_flowtype[0]; - if (conf_info->region[n].flowtype_num) { + for (m = 0; m < conf_info->region[n].flowtype_num; m++) { + j = info->region[i].flowtype_num; + tmp = conf_info->region[n].hw_flowtype[m]; info->region[i].hw_flowtype[j] = tmp; info->region[i].flowtype_num++; } @@ -5026,9 +5057,9 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, info->region[i].user_priority_num++; } - j = info->region[i].flowtype_num; - tmp = conf_info->region[n].hw_flowtype[0]; - if (conf_info->region[n].flowtype_num) { + for (m = 0; m < conf_info->region[n].flowtype_num; m++) { + j = info->region[i].flowtype_num; + tmp = conf_info->region[n].hw_flowtype[m]; info->region[i].hw_flowtype[j] = tmp; info->region[i].flowtype_num++; } -- 2.17.1