patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [DPDK 18.11] net/i40e: fix filter pctype
@ 2020-12-11  9:01 Steve Yang
  2020-12-11  9:01 ` [dpdk-stable] [DPDK 18.11] net/i40e: fix flow director initialisation Steve Yang
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Steve Yang @ 2020-12-11  9:01 UTC (permalink / raw)
  To: stable; +Cc: beilei.xing, jia.guo, Shougang Wang

From: Shougang Wang <shougangx.wang@intel.com>

[ upstream commit 11b58ac709690cb4086a0a01f979b3d3f8ea7d21 ]

The i40e_filter_pctype TCP_SYN_NO_ACK, UNICAST_IPV4_UDP and
MULTICAST_IPV4_UDP for x722 were missing when translating RSS type to
i40e_filter_pctype. This patch fixes it.

Fixes: da7018ec29d4 ("net/i40e: fix queue region in RSS flow")
Cc: stable@dpdk.org

Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 51 +++++++++++++++++++++++++++++++-----
 1 file changed, 44 insertions(+), 7 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index c04dfe79fc..0202e1701e 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4301,14 +4301,33 @@ 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;
+	uint16_t i, j, n, m, tmp;
 	uint32_t index = 0;
 	uint64_t hf_bit = 1;
 
+	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;
 
@@ -4333,6 +4352,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;
+				}
+			}
 	}
 
 	/**
@@ -4430,9 +4461,12 @@ 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++;
 				}
@@ -4445,9 +4479,12 @@ 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


^ permalink raw reply	[flat|nested] 12+ messages in thread
* [dpdk-stable] [DPDK 18.11] net/i40e: fix queue region in RSS flow
@ 2020-12-14  1:50 Steve Yang
  2020-12-17 11:41 ` Kevin Traynor
  0 siblings, 1 reply; 12+ messages in thread
From: Steve Yang @ 2020-12-14  1:50 UTC (permalink / raw)
  To: stable; +Cc: beilei.xing, jia.guo, Shougang Wang

From: Shougang Wang <shougangx.wang@intel.com>

[ upstream commit da7018ec29d405e9b36b6997eedb728c04bb0fe8 ]

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

Reviewed-by: Jeff Guo <jia.guo@intel.com>
Tested-by: Hailin Xu <hailinx.xu@intel.com>
Tested-by: Lunyuan Cui <lunyuanx.cui@intel.com>

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 36 ++++++++++++++++++++++++++++++++----
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index a53097ce00..2c37445282 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4308,7 +4308,34 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
 	uint16_t i, j, n, m, tmp;
 	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},
+	};
 
 	static const struct {
 		uint64_t rss_type;
@@ -4344,9 +4371,10 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	}
 
 	if (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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-12-17 11:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11  9:01 [dpdk-stable] [DPDK 18.11] net/i40e: fix filter pctype Steve Yang
2020-12-11  9:01 ` [dpdk-stable] [DPDK 18.11] net/i40e: fix flow director initialisation Steve Yang
2020-12-11  9:46   ` Kevin Traynor
2020-12-11  9:01 ` [dpdk-stable] [DPDK 18.11] net/i40e: fix link status Steve Yang
2020-12-11  9:46   ` Kevin Traynor
2020-12-11  9:01 ` [dpdk-stable] [DPDK 18.11] net/i40e: fix queue region in RSS flow Steve Yang
2020-12-11  9:44   ` Kevin Traynor
2020-12-11  9:01 ` [dpdk-stable] [DPDK 18.11] net/i40e: fix recreating flexible flow director rule Steve Yang
2020-12-11  9:47   ` Kevin Traynor
2020-12-11  9:46 ` [dpdk-stable] [DPDK 18.11] net/i40e: fix filter pctype Kevin Traynor
2020-12-14  1:50 [dpdk-stable] [DPDK 18.11] net/i40e: fix queue region in RSS flow Steve Yang
2020-12-17 11:41 ` Kevin Traynor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).