DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix queue region issue in RSS flow
@ 2020-04-24  8:52 Shougang Wang
  2020-04-24  9:36 ` [dpdk-dev] [PATCH v2] " Shougang Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Shougang Wang @ 2020-04-24  8:52 UTC (permalink / raw)
  To: dev; +Cc: beilei.xing, Shougang Wang, stable

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>
---
 drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 7e64ae53a..85297a025 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4624,6 +4624,33 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	uint16_t i, j, n, tmp, nb_types;
 	uint32_t index = 0;
 	uint64_t hf_bit = 1;
+	static const struct {
+		uint64_t rsstype;
+		enum i40e_filter_pctype f_pctype;
+	} type_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 +4668,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(type_match_table); j++) {
+			if (rss->types & type_match_table[j].rsstype) {
+				conf_info->region[0].hw_flowtype[0] =
+					(uint8_t)type_match_table[j].f_pctype;
 				conf_info->region[0].flowtype_num = 1;
 				conf_info->queue_region_number = 1;
 				break;
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2] net/i40e: fix queue region issue in RSS flow
  2020-04-24  8:52 [dpdk-dev] [PATCH] net/i40e: fix queue region issue in RSS flow Shougang Wang
@ 2020-04-24  9:36 ` Shougang Wang
  2020-05-12  9:37   ` Jeff Guo
  2020-05-13  3:33 ` [dpdk-dev] [PATCH v3] " Shougang Wang
  2020-05-15  7:32 ` [dpdk-dev] [PATCH v4] " Shougang Wang
  2 siblings, 1 reply; 13+ messages in thread
From: Shougang Wang @ 2020-04-24  9:36 UTC (permalink / raw)
  To: dev; +Cc: beilei.xing, Shougang Wang, stable

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>
---
v2:
-Update the various name.
---
 drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 7e64ae53a..9a306aed6 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4624,6 +4624,33 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	uint16_t i, j, n, tmp, nb_types;
 	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 +4668,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


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

* Re: [dpdk-dev] [PATCH v2] net/i40e: fix queue region issue in RSS flow
  2020-04-24  9:36 ` [dpdk-dev] [PATCH v2] " Shougang Wang
@ 2020-05-12  9:37   ` Jeff Guo
  0 siblings, 0 replies; 13+ messages in thread
From: Jeff Guo @ 2020-05-12  9:37 UTC (permalink / raw)
  To: Shougang Wang, dev; +Cc: beilei.xing, stable

hi, shougang

On 4/24/2020 5:36 PM, 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>
> ---
> v2:
> -Update the various name.
> ---
>   drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++++++---
>   1 file changed, 31 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
> index 7e64ae53a..9a306aed6 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -4624,6 +4624,33 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
>   	uint16_t i, j, n, tmp, nb_types;
>   	uint32_t index = 0;
>   	uint64_t hf_bit = 1;


I am not sure that a null line here or flow the Christmas tree to let it 
look good?  Other looks good and you could add my Review-by.


> +	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 +4668,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;




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

* [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flow
  2020-04-24  8:52 [dpdk-dev] [PATCH] net/i40e: fix queue region issue in RSS flow Shougang Wang
  2020-04-24  9:36 ` [dpdk-dev] [PATCH v2] " Shougang Wang
@ 2020-05-13  3:33 ` Shougang Wang
  2020-05-13  8:31   ` Cui, LunyuanX
                     ` (2 more replies)
  2020-05-15  7:32 ` [dpdk-dev] [PATCH v4] " Shougang Wang
  2 siblings, 3 replies; 13+ messages in thread
From: Shougang Wang @ 2020-05-13  3:33 UTC (permalink / raw)
  To: dev; +Cc: beilei.xing, jia.guo, Shougang Wang, stable

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>
---
 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


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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flow
  2020-05-13  3:33 ` [dpdk-dev] [PATCH v3] " Shougang Wang
@ 2020-05-13  8:31   ` Cui, LunyuanX
  2020-05-13 10:11   ` Iremonger, Bernard
  2020-06-28  6:01   ` Zhao1, Wei
  2 siblings, 0 replies; 13+ messages in thread
From: Cui, LunyuanX @ 2020-05-13  8:31 UTC (permalink / raw)
  To: Wang, ShougangX, dev; +Cc: Xing, Beilei, Guo, Jia, Wang, ShougangX, stable

Tested-by: Cui, Lunyuan <lunyuanx.cui@intel.com>

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shougang Wang
> Sent: Wednesday, May 13, 2020 11:33 AM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; Wang,
> ShougangX <shougangx.wang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v3] 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>
> ---
>  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


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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flow
  2020-05-13  3:33 ` [dpdk-dev] [PATCH v3] " Shougang Wang
  2020-05-13  8:31   ` Cui, LunyuanX
@ 2020-05-13 10:11   ` Iremonger, Bernard
  2020-05-14  7:04     ` Wang, ShougangX
  2020-06-28  6:01   ` Zhao1, Wei
  2 siblings, 1 reply; 13+ messages in thread
From: Iremonger, Bernard @ 2020-05-13 10:11 UTC (permalink / raw)
  To: Wang, ShougangX, dev; +Cc: Xing, Beilei, Guo, Jia, Wang, ShougangX, stable

Hi Shougang,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Shougang Wang
> Sent: Wednesday, May 13, 2020 4:33 AM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; Wang,
> ShougangX <shougangx.wang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v3] 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>
> ---
>  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},
> +	};

I don't think this is a complete list of RSS offload types.
See file librte_ethdev/rte_ethdev,h  lines 496 to 523.
See also app/test-pmd/config.c lines 77 to 121.


> +
>  	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

Regards,

Bernard.


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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flow
  2020-05-13 10:11   ` Iremonger, Bernard
@ 2020-05-14  7:04     ` Wang, ShougangX
  2020-05-15  6:14       ` Xu, HailinX
  0 siblings, 1 reply; 13+ messages in thread
From: Wang, ShougangX @ 2020-05-14  7:04 UTC (permalink / raw)
  To: Iremonger, Bernard, dev; +Cc: Xing, Beilei, Guo, Jia, stable

Hi, Bernad

> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Wednesday, May 13, 2020 6:12 PM
> To: Wang, ShougangX <shougangx.wang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; Wang,
> ShougangX <shougangx.wang@intel.com>; stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS
> flow
> 
> Hi Shougang,
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Shougang Wang
> > Sent: Wednesday, May 13, 2020 4:33 AM
> > To: dev@dpdk.org
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia
> > <jia.guo@intel.com>; Wang, ShougangX <shougangx.wang@intel.com>;
> > stable@dpdk.org
> > Subject: [dpdk-dev] [PATCH v3] 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>
> > ---
> >  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},
> > +};
> 
> I don't think this is a complete list of RSS offload types.
> See file librte_ethdev/rte_ethdev,h  lines 496 to 523.
> See also app/test-pmd/config.c lines 77 to 121.
> 
Thanks for your review.
We can not contain all the RSS offload types. We need i40e_filter_pctype to configure the queue region. It only defines some basic pctypes and there is no regular between i40e_filter_pctype and RSS offload types. So for "flow create", it can only configure queue region for these basic pctypes. What we can do is associate them with RSS offload types.

Thanks.
Shougang

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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flow
  2020-05-14  7:04     ` Wang, ShougangX
@ 2020-05-15  6:14       ` Xu, HailinX
  0 siblings, 0 replies; 13+ messages in thread
From: Xu, HailinX @ 2020-05-15  6:14 UTC (permalink / raw)
  To: Wang, ShougangX, Iremonger, Bernard, dev; +Cc: Xing, Beilei, Guo, Jia, stable

Tested-by: Xu, Hailin <hailinx.xu@intel.com>

Regards,
Xu, Hailin


-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wang, ShougangX
Sent: Thursday, May 14, 2020 3:04 PM
To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org
Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flow

Hi, Bernad

> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Wednesday, May 13, 2020 6:12 PM
> To: Wang, ShougangX <shougangx.wang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia 
> <jia.guo@intel.com>; Wang, ShougangX <shougangx.wang@intel.com>; 
> stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in 
> RSS flow
> 
> Hi Shougang,
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Shougang Wang
> > Sent: Wednesday, May 13, 2020 4:33 AM
> > To: dev@dpdk.org
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia 
> > <jia.guo@intel.com>; Wang, ShougangX <shougangx.wang@intel.com>; 
> > stable@dpdk.org
> > Subject: [dpdk-dev] [PATCH v3] 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>
> > ---
> >  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},
> > +};
> 
> I don't think this is a complete list of RSS offload types.
> See file librte_ethdev/rte_ethdev,h  lines 496 to 523.
> See also app/test-pmd/config.c lines 77 to 121.
> 
Thanks for your review.
We can not contain all the RSS offload types. We need i40e_filter_pctype to configure the queue region. It only defines some basic pctypes and there is no regular between i40e_filter_pctype and RSS offload types. So for "flow create", it can only configure queue region for these basic pctypes. What we can do is associate them with RSS offload types.

Thanks.
Shougang

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

* [dpdk-dev] [PATCH v4] net/i40e: fix queue region issue in RSS flow
  2020-04-24  8:52 [dpdk-dev] [PATCH] net/i40e: fix queue region issue in RSS flow Shougang Wang
  2020-04-24  9:36 ` [dpdk-dev] [PATCH v2] " Shougang Wang
  2020-05-13  3:33 ` [dpdk-dev] [PATCH v3] " Shougang Wang
@ 2020-05-15  7:32 ` Shougang Wang
  2020-05-18  0:50   ` Ye Xiaolong
  2020-05-18  2:57   ` Xu, HailinX
  2 siblings, 2 replies; 13+ messages in thread
From: Shougang Wang @ 2020-05-15  7:32 UTC (permalink / raw)
  To: dev; +Cc: Shougang Wang, stable

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


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

* Re: [dpdk-dev] [PATCH v4] net/i40e: fix queue region issue in RSS flow
  2020-05-15  7:32 ` [dpdk-dev] [PATCH v4] " Shougang Wang
@ 2020-05-18  0:50   ` Ye Xiaolong
  2020-05-18  2:57   ` Xu, HailinX
  1 sibling, 0 replies; 13+ messages in thread
From: Ye Xiaolong @ 2020-05-18  0:50 UTC (permalink / raw)
  To: Shougang Wang; +Cc: dev, stable

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.

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

* Re: [dpdk-dev] [PATCH v4] net/i40e: fix queue region issue in RSS flow
  2020-05-15  7:32 ` [dpdk-dev] [PATCH v4] " Shougang Wang
  2020-05-18  0:50   ` Ye Xiaolong
@ 2020-05-18  2:57   ` Xu, HailinX
  1 sibling, 0 replies; 13+ messages in thread
From: Xu, HailinX @ 2020-05-18  2:57 UTC (permalink / raw)
  To: Wang, ShougangX, dev; +Cc: Wang, ShougangX, stable

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


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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flow
  2020-05-13  3:33 ` [dpdk-dev] [PATCH v3] " Shougang Wang
  2020-05-13  8:31   ` Cui, LunyuanX
  2020-05-13 10:11   ` Iremonger, Bernard
@ 2020-06-28  6:01   ` Zhao1, Wei
  2020-06-28  6:51     ` Wang, ShougangX
  2 siblings, 1 reply; 13+ messages in thread
From: Zhao1, Wei @ 2020-06-28  6:01 UTC (permalink / raw)
  To: Wang, ShougangX, dev; +Cc: Xing, Beilei, Guo, Jia, Wang, ShougangX, stable

Hi, shougang

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Shougang Wang
> Sent: Wednesday, May 13, 2020 11:33 AM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; Wang,
> ShougangX <shougangx.wang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v3] 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>
> ---
>  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},
> +	};
> +

For x772, the pctype for UDP is different, this table should be different also.

if (hw->mac.type == I40E_MAC_X722)
..............................





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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flow
  2020-06-28  6:01   ` Zhao1, Wei
@ 2020-06-28  6:51     ` Wang, ShougangX
  0 siblings, 0 replies; 13+ messages in thread
From: Wang, ShougangX @ 2020-06-28  6:51 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: Xing, Beilei, Guo, Jia, stable

Hi, Wei

> -----Original Message-----
> From: Zhao1, Wei <wei.zhao1@intel.com>
> Sent: Sunday, June 28, 2020 2:02 PM
> To: Wang, ShougangX <shougangx.wang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; Wang,
> ShougangX <shougangx.wang@intel.com>; stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS
> flow
> 
> Hi, shougang
> 

[snip]

> > 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},
> > +	};
> > +
> 
> For x772, the pctype for UDP is different, this table should be different also.
> 
> if (hw->mac.type == I40E_MAC_X722)
> ..............................
Thanks for your review, I will perfect this table.

Thanks.
Shougang

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

end of thread, other threads:[~2020-06-28  6:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-24  8:52 [dpdk-dev] [PATCH] net/i40e: fix queue region issue in RSS flow Shougang Wang
2020-04-24  9:36 ` [dpdk-dev] [PATCH v2] " Shougang Wang
2020-05-12  9:37   ` Jeff Guo
2020-05-13  3:33 ` [dpdk-dev] [PATCH v3] " Shougang Wang
2020-05-13  8:31   ` Cui, LunyuanX
2020-05-13 10:11   ` Iremonger, Bernard
2020-05-14  7:04     ` Wang, ShougangX
2020-05-15  6:14       ` Xu, HailinX
2020-06-28  6:01   ` Zhao1, Wei
2020-06-28  6:51     ` Wang, ShougangX
2020-05-15  7:32 ` [dpdk-dev] [PATCH v4] " Shougang Wang
2020-05-18  0:50   ` Ye Xiaolong
2020-05-18  2:57   ` Xu, HailinX

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).