patches for DPDK stable branches
 help / color / mirror / Atom feed
* [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; 4+ 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] 4+ messages in thread

* Re: [dpdk-stable] [DPDK 18.11] net/i40e: fix queue region in RSS flow
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Traynor @ 2020-12-17 11:41 UTC (permalink / raw)
  To: Steve Yang, stable; +Cc: beilei.xing, jia.guo, Shougang Wang

On 14/12/2020 01:50, Steve Yang wrote:
> 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(-)

Applied, thanks.


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

* Re: [dpdk-stable] [DPDK 18.11] net/i40e: fix queue region in RSS flow
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Traynor @ 2020-12-11  9:44 UTC (permalink / raw)
  To: Steve Yang, stable; +Cc: beilei.xing, jia.guo, Shougang Wang

On 11/12/2020 09:01, Steve Yang wrote:
> 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 | 35 ++++++++++++++++++++++++++++++++---
>  1 file changed, 32 insertions(+), 3 deletions(-)
> 

Does not apply, please rebase.


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

* [dpdk-stable] [DPDK 18.11] net/i40e: fix queue region in RSS flow
  2020-12-11  9:01 [dpdk-stable] [DPDK 18.11] net/i40e: fix filter pctype Steve Yang
@ 2020-12-11  9:01 ` Steve Yang
  2020-12-11  9:44   ` Kevin Traynor
  0 siblings, 1 reply; 4+ 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 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 | 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 2198473411..236ad3d9fd 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4312,6 +4312,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;
 
@@ -4328,9 +4356,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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
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 queue region in RSS flow Steve Yang
2020-12-11  9:44   ` 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).