net/i40e: fix queue region issue in RSS flow
PATCH 1/1 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.
--- drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_flow.c +31 -3
@@ -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 ;
Signature · 1 line
2.17.1
PATCH v2 1/1 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.
---
v2:
-Update the various name.
--- drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_flow.c +31 -3
@@ -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 ;
Signature · 1 line
2.17.1
hi, shougang
Quoted 19 lines · Shougang Wang
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")Signed-off-by Shougang Wang <[email protected]>---
v2:(quoted diff) +0
-2-Update the various name. --- drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c +0
-0
drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev *dev, · line 4626
Quoted 3 lines
drivers/net/i40e/i40e_flow.c +0
-0@@ -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.
Quoted 44 lines
drivers/net/i40e/i40e_flow.c +31
-3+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 ;
PATCH v3 1/1 net/i40e: fix queue region issue in RSS flow
In reply to Shougang WangThis patch fixes the issue that the queue region does not take effect due to incorrectly setting the flow type.
--- drivers/net/i40e/i40e_flow.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_flow.c +32 -3
@@ -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 ;
Signature · 1 line
2.17.1
Quoted 79 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Shougang Wang
Sent: Wednesday, May 13, 2020 11:33 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Wang, ShougangX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flowThis 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")Signed-off-by Shougang Wang <[email protected]>Reviewed-by Jeff Guo <[email protected]>--- drivers/net/i40e/i40e_flow.c | 35 ++++++++++++++++++++++++++++++++- -- 1 file changed, 32 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c +32
-3@@ -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 ;drivers/net/i40e/i40e_flow.c +0
-1conf_info->queue_region_number =1 ;break ; --2.17.1
Hi Shougang,
Quoted 47 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Shougang Wang
Sent: Wednesday, May 13, 2020 4:33 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Wang, ShougangX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flowThis 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")Signed-off-by Shougang Wang <[email protected]>Reviewed-by Jeff Guo <[email protected]>--- drivers/net/i40e/i40e_flow.c | 35 ++++++++++++++++++++++++++++++++- -- 1 file changed, 32 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c +17
-0@@ -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 ,
drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev · line 4655
Quoted 10 lines
drivers/net/i40e/i40e_flow.c +10
-0+ 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.
Quoted 21 lines
drivers/net/i40e/i40e_flow.c +5
-3+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 ;drivers/net/i40e/i40e_flow.c +0
-1conf_info->queue_region_number =1 ;break ; --
Quoted 1 line
2.17.1
Regards,
Bernard.
Hi, Bernad
Quoted 65 lines
-----Original Message-----
From: Iremonger, Bernard <[email protected]>
Sent: Wednesday, May 13, 2020 6:12 PM
To: Wang, ShougangX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Wang, ShougangX <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flowHi Shougang,
Quoted 13 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Shougang Wang
Sent: Wednesday, May 13, 2020 4:33 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Wang, ShougangX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flowThis patch fixes the issue that the queue region does not take effect due to incorrectly setting the flow type.
Quoted 7 lines
Fixes ecad87d22383 ("net/i40e: move RSS to flow API")Signed-off-by Shougang Wang <[email protected]>Reviewed-by Jeff Guo <[email protected]>--- drivers/net/i40e/i40e_flow.c | 35++++++++++++++++++++++++++++++++-
Quoted 33 lines
--
1 file changed, 32 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_flow.cindex7e64ae53a..2f937567b100644drivers/net/i40e/i40e_flow.c +23
-0@@ -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 ,
Quoted 9 lines
drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev *dev, · line 4654
Quoted 4 lines
drivers/net/i40e/i40e_flow.c +4
-0+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.clines 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
Xu, HailinX
Tested-byRegards,
Xu, Hailin
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wang, ShougangX
Sent: Thursday, May 14, 2020 3:04 PM
To: Iremonger, Bernard <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flow
Hi, Bernad
Quoted 66 lines
-----Original Message-----
From: Iremonger, Bernard <[email protected]>
Sent: Wednesday, May 13, 2020 6:12 PM
To: Wang, ShougangX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Wang, ShougangX <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flowHi Shougang,
Quoted 13 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Shougang Wang
Sent: Wednesday, May 13, 2020 4:33 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Wang, ShougangX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flowThis patch fixes the issue that the queue region does not take effect due to incorrectly setting the flow type.
Quoted 7 lines
Fixes ecad87d22383 ("net/i40e: move RSS to flow API")Signed-off-by Shougang Wang <[email protected]>Reviewed-by Jeff Guo <[email protected]>--- drivers/net/i40e/i40e_flow.c | 35++++++++++++++++++++++++++++++++-
Quoted 33 lines
--
1 file changed, 32 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_flow.cindex7e64ae53a..2f937567b100644drivers/net/i40e/i40e_flow.c +23
-0@@ -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 ,
Quoted 9 lines
drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev *dev, · line 4654
Quoted 4 lines
drivers/net/i40e/i40e_flow.c +4
-0+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.clines 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
Hi, shougang
Quoted 47 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Shougang Wang
Sent: Wednesday, May 13, 2020 11:33 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Wang, ShougangX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flowThis 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")Signed-off-by Shougang Wang <[email protected]>Reviewed-by Jeff Guo <[email protected]>--- drivers/net/i40e/i40e_flow.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c index renamed from drivers/net/i40e/i40e_flow.c +0
-0
7e64ae53a..2f937567b100644drivers/net/i40e/i40e_flow.c +18
-0@@ -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 },
drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev · line 4656
Quoted 10 lines
drivers/net/i40e/i40e_flow.c +10
-0+ {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)
..............................
Hi, Wei
Quoted 11 lines
-----Original Message-----
From: Zhao1, Wei <[email protected]>
Sent: Sunday, June 28, 2020 2:02 PM
To: Wang, ShougangX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Wang, ShougangX <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH v3] net/i40e: fix queue region issue in RSS flowHi, shougang
[snip]
Quoted 40 lines
Quoted 27 lines
(quoted diff) +0
-0
b/drivers/net/i40e/i40e_flow.cindex7e64ae53a..2f937567b100644drivers/net/i40e/i40e_flow.c +18
-0@@ -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 },drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev · line 4656
Quoted 10 lines
drivers/net/i40e/i40e_flow.c +10
-0+ {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.
Quoted 2 lines
if (
hw->mac.type==I40E_MAC_X722)
..............................
Thanks for your review, I will perfect this table.
Thanks.
Shougang
PATCH v4 1/1 net/i40e: fix queue region issue in RSS flow
In reply to Shougang WangThis patch fixes the issue that the queue region does not take effect due to incorrectly setting the flow type.
---
v4:
-rebased on dpdk-next-net-intel
--- drivers/net/i40e/i40e_flow.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_flow.c +32 -3
@@ -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 ;
Signature · 1 line
2.17.1
Ye Xiaolong
AppliedQuoted 73 lines · Shougang Wang
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")Signed-off-by Shougang Wang <[email protected]>Reviewed-by Jeff Guo <[email protected]>Tested-by Hailin Xu <[email protected]>Tested-by Lunyuan Cui <[email protected]>---
v4:
-rebased on dpdk-next-net-intel
---drivers/net/i40e/i40e_flow.c| 35 ++++++++++++++++++++++++++++++++---1 file changed, 32 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c +32
-3@@ -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 ;Signature · 1 line
2.17.1
Applied to dpdk-next-net-intel, Thanks.
Regards,
Xu, Hailin
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Shougang Wang
Sent: Friday, May 15, 2020 3:33 PM
To: [email protected]
Cc: Wang, ShougangX <[email protected]>; [email protected]
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.
---
v4:
-rebased on dpdk-next-net-intel
--- drivers/net/i40e/i40e_flow.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_flow.c +32 -3
@@ -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