[v4] net/i40e: fix queue region issue in RSS flow

Message ID 20200515073231.19158-1-shougangx.wang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series [v4] net/i40e: fix queue region issue in RSS flow |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation fail apply issues
ci/iol-testing fail Testing issues

Commit Message

Shougang Wang May 15, 2020, 7:32 a.m. UTC
  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 <shougangx.wang@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
Tested-by: Hailin Xu <hailinx.xu@intel.com>
Tested-by: Lunyuan Cui <lunyuanx.cui@intel.com>
---
v4:
-rebased on dpdk-next-net-intel
---
 drivers/net/i40e/i40e_flow.c | 35 ++++++++++++++++++++++++++++++++---
 1 file changed, 32 insertions(+), 3 deletions(-)
  

Comments

Xiaolong Ye May 18, 2020, 12:50 a.m. UTC | #1
On 05/15, Shougang Wang wrote:
>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 <shougangx.wang@intel.com>
>Reviewed-by: Jeff Guo <jia.guo@intel.com>
>Tested-by: Hailin Xu <hailinx.xu@intel.com>
>Tested-by: Lunyuan Cui <lunyuanx.cui@intel.com>
>---
>v4:
>-rebased on dpdk-next-net-intel
>---
> 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 f5f2f0d5d..1b2c86fa9 100644
>--- a/drivers/net/i40e/i40e_flow.c
>+++ b/drivers/net/i40e/i40e_flow.c
>@@ -4623,6 +4623,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;
> 
>@@ -4639,9 +4667,10 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
> 	}
> 
> 	if (p_info.action_flag && rss->queue_num) {
>-		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
>

Applied to dpdk-next-net-intel, Thanks.
  
hailinx May 18, 2020, 2:57 a.m. UTC | #2
Tested-by: Xu, Hailin <hailinx.xu@intel.com>

Regards,
Xu, Hailin


-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shougang Wang
Sent: Friday, May 15, 2020 3:33 PM
To: dev@dpdk.org
Cc: Wang, ShougangX <shougangx.wang@intel.com>; stable@dpdk.org
Subject: [dpdk-dev] [PATCH v4] net/i40e: fix queue region issue in RSS flow

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 <shougangx.wang@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
Tested-by: Hailin Xu <hailinx.xu@intel.com>
Tested-by: Lunyuan Cui <lunyuanx.cui@intel.com>
---
v4:
-rebased on dpdk-next-net-intel
---
 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 f5f2f0d5d..1b2c86fa9 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4623,6 +4623,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;
 
@@ -4639,9 +4667,10 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	}
 
 	if (p_info.action_flag && rss->queue_num) {
-		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
  

Patch

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index f5f2f0d5d..1b2c86fa9 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4623,6 +4623,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;
 
@@ -4639,9 +4667,10 @@  i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	}
 
 	if (p_info.action_flag && rss->queue_num) {
-		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;