Skip to contentSkip to conversation

net/iavf: fix rss algorithm configure issue

dpdk-dev Applied Jeff Guo 3 participants 12 messages May 9, 2020 – May 14, 2020 Network drivers

lore
Share & tools
lore

Jeff Guo

author
#0 lore raw

When configure rss rule, the etherdev rss hash function type should be mapped to the corresponding virtchnl rss algorithm type.

Fixes 7be10c3004be ("net/iavf: add RSS configuration for VF")
---
 drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/net/iavf/iavf_hash.c +11 -9
index 6359ead76..173b7633f 100644
@@ -47,7 +47,7 @@ struct iavf_hash_match_type {
 
 struct iavf_rss_meta {
 	struct virtchnl_proto_hdrs *proto_hdrs;
-	uint32_t hash_function;
+	enum virtchnl_rss_algorithm rss_algorithm;
 };
 
 struct iavf_hash_flow_cfg {
@@ -1001,13 +1001,15 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item,
 
 			/* Check hash function and save it to rss_meta. */
 			if (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
-
-			if (rss->func ==
-			    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_R_ASYMMETRIC;
+			else if (rss->func ==
+				 RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC;
+			else
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC;
 
 			type_match_item =
 			rte_zmalloc("iavf_type_match_item",
@@ -1126,7 +1128,7 @@ iavf_hash_create(__rte_unused struct iavf_adapter *ad,
 	}
 
 	rss_cfg->proto_hdrs = *rss_meta->proto_hdrs;
-	rss_cfg->rss_algorithm = rss_meta->hash_function;
+	rss_cfg->rss_algorithm = rss_meta->rss_algorithm;
 
 	ret = iavf_add_del_rss_cfg(ad, rss_cfg, true);
 	if (!ret) {
Signature · 1 line
2.20.1
#1 lore raw
Quoted 37 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Sunday, May 10, 2020 4:28 AM
To: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]; Guo, Jia <[email protected]>
Subject: [dpdk-dev] net/iavf: fix rss algorithm configure issue

When configure rss rule, the etherdev rss hash function type should be mapped to the corresponding virtchnl rss algorithm type.

Fixes 7be10c3004be ("net/iavf: add RSS configuration for VF")
---
 drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/net/iavf/iavf_hash.c index renamed from drivers/net/iavf/iavf_hash.c +0 -0

6359ead76..173b7633f 100644

drivers/net/iavf/iavf_hash.c +1 -1
@@ -47,7 +47,7 @@ struct iavf_hash_match_type {
 
 struct iavf_rss_meta {
 	struct virtchnl_proto_hdrs *proto_hdrs;
-	uint32_t hash_function;
+	enum virtchnl_rss_algorithm rss_algorithm;
 };
 
 struct iavf_hash_flow_cfg {
@@ -1001,13 +1001,15 @@ iavf_hash_parse_action(struct
 iavf_pattern_match_item *pattern_match_item,
 
 			/* Check hash function and save it to rss_meta. */

drivers/net/iavf/iavf_hash.c iavf_hash_parse_action(struct · line 1006

Quoted 10 lines
drivers/net/iavf/iavf_hash.c +2 -7
 			if (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
-
-			if (rss->func ==
-			    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_R_ASYMMETRIC;

RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ --> VIRTCHNL_RSS_ALG_R_ASYMMETRIC

Is it should be VIRTCHNL_RSS_ALG_XOR_SYMMETRIC?

Quoted 22 lines
drivers/net/iavf/iavf_hash.c +7 -0
+			else if (rss->func ==
+				 RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC;
+			else
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC;
 
 			type_match_item =
drivers/net/iavf/iavf_hash.c +1 -1
 			rte_zmalloc("iavf_type_match_item",
@@ -1126,7 +1128,7 @@ iavf_hash_create(__rte_unused struct iavf_adapter
 *ad,
 	}
 
 	rss_cfg->proto_hdrs = *rss_meta->proto_hdrs;
-	rss_cfg->rss_algorithm = rss_meta->hash_function;
+	rss_cfg->rss_algorithm = rss_meta->rss_algorithm;
 
 	ret = iavf_add_del_rss_cfg(ad, rss_cfg, true);

if (!ret) {
--
2.20.1

#2 lore raw
Quoted 46 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Tuesday, May 12, 2020 10:18 AM
To: Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] net/iavf: fix rss algorithm configure issue

Quoted 34 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Sunday, May 10, 2020 4:28 AM
To: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]; Guo, Jia <[email protected]>
Subject: [dpdk-dev] net/iavf: fix rss algorithm configure issue

When configure rss rule, the etherdev rss hash function type should be mapped to the corresponding virtchnl rss algorithm type.

Fixes 7be10c3004be ("net/iavf: add RSS configuration for VF")
---
 drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_hash.c index 6359ead76..173b7633f 100644

drivers/net/iavf/iavf_hash.c +1 -1
@@ -47,7 +47,7 @@ struct iavf_hash_match_type {
 
 struct iavf_rss_meta {
 	struct virtchnl_proto_hdrs *proto_hdrs;
-	uint32_t hash_function;
+	enum virtchnl_rss_algorithm rss_algorithm;
 };
 
 struct iavf_hash_flow_cfg {
@@ -1001,13 +1001,15 @@ iavf_hash_parse_action(struct
 iavf_pattern_match_item *pattern_match_item,
 
Quoted 14 lines

drivers/net/iavf/iavf_hash.c iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item, · line 1005

Quoted 11 lines
drivers/net/iavf/iavf_hash.c +2 -7
 			/* Check hash function and save it to rss_meta. */
 			if (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
-
-			if (rss->func ==
-			    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_R_ASYMMETRIC;

RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ -->
VIRTCHNL_RSS_ALG_R_ASYMMETRIC

A typo, it is
RTE_ETH_HASH_FUNCTION_SIMPLE_XOR --> VIRTCHNL_RSS_ALG_R_ASYMMETRIC which looks not correct.

Quoted 27 lines

Is it should be VIRTCHNL_RSS_ALG_XOR_SYMMETRIC?

Quoted 22 lines
drivers/net/iavf/iavf_hash.c +7 -0
+			else if (rss->func ==
+				 RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC;
+			else
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC;
 
 			type_match_item =
drivers/net/iavf/iavf_hash.c +1 -1
 			rte_zmalloc("iavf_type_match_item",
@@ -1126,7 +1128,7 @@ iavf_hash_create(__rte_unused struct
 iavf_adapter *ad,
 	}
 
 	rss_cfg->proto_hdrs = *rss_meta->proto_hdrs;
-	rss_cfg->rss_algorithm = rss_meta->hash_function;
+	rss_cfg->rss_algorithm = rss_meta->rss_algorithm;
 
 	ret = iavf_add_del_rss_cfg(ad, rss_cfg, true);

if (!ret) {
--
2.20.1

author
#3 lore raw

hi, qi

Quoted 58 lines · Qi Z
Quoted 45 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Tuesday, May 12, 2020 10:18 AM
To: Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] net/iavf: fix rss algorithm configure issue

Quoted 34 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Sunday, May 10, 2020 4:28 AM
To: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]; Guo, Jia <[email protected]>
Subject: [dpdk-dev] net/iavf: fix rss algorithm configure issue

When configure rss rule, the etherdev rss hash function type should be mapped to the corresponding virtchnl rss algorithm type.

Fixes 7be10c3004be ("net/iavf: add RSS configuration for VF")
---
  drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
  1 file changed, 11 insertions(+), 9 deletions(-)
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_hash.c index 6359ead76..173b7633f 100644

drivers/net/iavf/iavf_hash.c +1 -1
@@ -47,7 +47,7 @@ struct iavf_hash_match_type {
 
  struct iavf_rss_meta {
  	struct virtchnl_proto_hdrs *proto_hdrs;
-	uint32_t hash_function;
+	enum virtchnl_rss_algorithm rss_algorithm;
  };
 
  struct iavf_hash_flow_cfg {
@@ -1001,13 +1001,15 @@ iavf_hash_parse_action(struct
 iavf_pattern_match_item *pattern_match_item,
 
Quoted 13 lines

drivers/net/iavf/iavf_hash.c iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item, · line 1005

Quoted 11 lines
drivers/net/iavf/iavf_hash.c +2 -7
  			/* Check hash function and save it to rss_meta. */
  			if (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
-
-			if (rss->func ==
-			    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_R_ASYMMETRIC;

RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ -->
VIRTCHNL_RSS_ALG_R_ASYMMETRIC

Quoted 5 lines

A typo, it is
RTE_ETH_HASH_FUNCTION_SIMPLE_XOR --> VIRTCHNL_RSS_ALG_R_ASYMMETRIC which looks not correct.

Quoted 3 lines

Is it should be VIRTCHNL_RSS_ALG_XOR_SYMMETRIC?

At currently driver,  VIRTCHNL_RSS_ALG_R_ASYMMETRIC is used to identify simple XOR.

Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
drivers/net/iavf/iavf_hash.c +7 -0
+			else if (rss->func ==
+				 RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC;
+			else
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC;
 
  			type_match_item =

rte_zmalloc("iavf_type_match_item",

drivers/net/iavf/iavf_hash.c +1 -1
@@ -1126,7 +1128,7 @@ iavf_hash_create(__rte_unused struct
 iavf_adapter *ad,
  	}
 
  	rss_cfg->proto_hdrs = *rss_meta->proto_hdrs;
-	rss_cfg->rss_algorithm = rss_meta->hash_function;
+	rss_cfg->rss_algorithm = rss_meta->rss_algorithm;
 
  	ret = iavf_add_del_rss_cfg(ad, rss_cfg, true);

if (!ret) {
--
2.20.1

#4 lore raw
Quoted 74 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Wednesday, May 13, 2020 7:20 AM
To: Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] net/iavf: fix rss algorithm configure issue

hi, qi

Quoted 41 lines · Qi Z
Quoted 41 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Tuesday, May 12, 2020 10:18 AM
To: Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] net/iavf: fix rss algorithm configure issue

Quoted 30 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Sunday, May 10, 2020 4:28 AM
To: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]; Guo, Jia <[email protected]>
Subject: [dpdk-dev] net/iavf: fix rss algorithm configure issue

When configure rss rule, the etherdev rss hash function type should be mapped to the corresponding virtchnl rss algorithm type.

Fixes 7be10c3004be ("net/iavf: add RSS configuration for VF")
---
  drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
  1 file changed, 11 insertions(+), 9 deletions(-)
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_hash.c index 6359ead76..173b7633f 100644

drivers/net/iavf/iavf_hash.c +1 -1
@@ -47,7 +47,7 @@ struct iavf_hash_match_type {
 
  struct iavf_rss_meta {
  	struct virtchnl_proto_hdrs *proto_hdrs;
-	uint32_t hash_function;
+	enum virtchnl_rss_algorithm rss_algorithm;
  };
 
Quoted 6 lines
Quoted 6 lines

drivers/net/iavf/iavf_hash.c iavf_hash_parse_action(struct · line 1004

Quoted 6 lines
drivers/net/iavf/iavf_hash.c +0 -0
  struct iavf_hash_flow_cfg {
@@ -1001,13 +1001,15 @@ iavf_hash_parse_action(struct
 iavf_pattern_match_item *pattern_match_item,
 
  			/* Check hash function and save it to rss_meta. */
  			if (rss->func ==

RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)

Quoted 11 lines
Quoted 11 lines

drivers/net/iavf/iavf_hash.c iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item, · line 1005

Quoted 9 lines
drivers/net/iavf/iavf_hash.c +2 -7
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
-
-			if (rss->func ==
-			    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_R_ASYMMETRIC;

RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ -->
VIRTCHNL_RSS_ALG_R_ASYMMETRIC

Quoted 2 lines

A typo, it is
RTE_ETH_HASH_FUNCTION_SIMPLE_XOR -->

Quoted 7 lines

VIRTCHNL_RSS_ALG_R_ASYMMETRIC which looks not correct.

Quoted 3 lines
Quoted 3 lines

Is it should be VIRTCHNL_RSS_ALG_XOR_SYMMETRIC?

At currently driver,  VIRTCHNL_RSS_ALG_R_ASYMMETRIC is used to identify simple XOR.

I didn't get it..
After apply your patch, we have below code which does not make sense,

/* Check hash function and save it to rss_meta. */ if (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)

	rss_meta->rss_algorithm =
		VIRTCHNL_RSS_ALG_R_ASYMMETRIC;

else if...

ASYMMETRIC is not kind of symmetric hash and should not be mapped to simple xor.

Quoted 25 lines
Quoted 4 lines
Quoted 4 lines

drivers/net/iavf/iavf_hash.c iavf_hash_parse_action(struct · line 1008

Quoted 4 lines
drivers/net/iavf/iavf_hash.c +2 -0
+			else if (rss->func ==
+

RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
drivers/net/iavf/iavf_hash.c +5 -0
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC;
+			else
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC;
 
  			type_match_item =

rte_zmalloc("iavf_type_match_item",

drivers/net/iavf/iavf_hash.c +1 -1
@@ -1126,7 +1128,7 @@ iavf_hash_create(__rte_unused struct
 iavf_adapter *ad,
  	}
 
  	rss_cfg->proto_hdrs = *rss_meta->proto_hdrs;
-	rss_cfg->rss_algorithm = rss_meta->hash_function;
+	rss_cfg->rss_algorithm = rss_meta->rss_algorithm;
 
  	ret = iavf_add_del_rss_cfg(ad, rss_cfg, true);

if (!ret) {
--
2.20.1

author
#5 lore raw

hi, qi

Quoted 81 lines · Qi Z
Quoted 70 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Wednesday, May 13, 2020 7:20 AM
To: Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] net/iavf: fix rss algorithm configure issue

hi, qi

Quoted 40 lines · Qi Z
Quoted 40 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Tuesday, May 12, 2020 10:18 AM
To: Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] net/iavf: fix rss algorithm configure issue

Quoted 30 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Sunday, May 10, 2020 4:28 AM
To: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Ye, Xiaolong <[email protected]>; [email protected]; Guo, Jia <[email protected]>
Subject: [dpdk-dev] net/iavf: fix rss algorithm configure issue

When configure rss rule, the etherdev rss hash function type should be mapped to the corresponding virtchnl rss algorithm type.

Fixes 7be10c3004be ("net/iavf: add RSS configuration for VF")
---
   drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
   1 file changed, 11 insertions(+), 9 deletions(-)
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_hash.c index 6359ead76..173b7633f 100644

drivers/net/iavf/iavf_hash.c +1 -1
@@ -47,7 +47,7 @@ struct iavf_hash_match_type {
 
   struct iavf_rss_meta {
   	struct virtchnl_proto_hdrs *proto_hdrs;
-	uint32_t hash_function;
+	enum virtchnl_rss_algorithm rss_algorithm;
   };
 
Quoted 6 lines
Quoted 6 lines

drivers/net/iavf/iavf_hash.c iavf_hash_parse_action(struct · line 1004

Quoted 6 lines
drivers/net/iavf/iavf_hash.c +0 -0
   struct iavf_hash_flow_cfg {
@@ -1001,13 +1001,15 @@ iavf_hash_parse_action(struct
 iavf_pattern_match_item *pattern_match_item,
 
   			/* Check hash function and save it to rss_meta. */
   			if (rss->func ==

RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)

Quoted 11 lines
Quoted 11 lines

drivers/net/iavf/iavf_hash.c iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item, · line 1005

Quoted 9 lines
drivers/net/iavf/iavf_hash.c +2 -7
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
-
-			if (rss->func ==
-			    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_R_ASYMMETRIC;

RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ -->
VIRTCHNL_RSS_ALG_R_ASYMMETRIC

Quoted 8 lines
Quoted 2 lines

A typo, it is
RTE_ETH_HASH_FUNCTION_SIMPLE_XOR -->

VIRTCHNL_RSS_ALG_R_ASYMMETRIC which looks not correct.

Quoted 3 lines
Quoted 3 lines

Is it should be VIRTCHNL_RSS_ALG_XOR_SYMMETRIC?

At currently driver,  VIRTCHNL_RSS_ALG_R_ASYMMETRIC is used to identify simple XOR.

I didn't get it..
After apply your patch, we have below code which does not make sense,

Quoted 8 lines

/* Check hash function and save it to rss_meta. */ if (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)

	rss_meta->rss_algorithm =
		VIRTCHNL_RSS_ALG_R_ASYMMETRIC;

else if...

ASYMMETRIC is not kind of symmetric hash and should not be mapped to simple xor.

This is a typo, VIRTCHNL_RSS_ALG_R_ASYMMETRIC should be VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC and it should

means simple XOR, but VIRTCHNL_RSS_ALG_XOR_SYMMETRIC means symmetric xor. A type fix will send by v2 to make it clear.

Quoted 24 lines
Quoted 24 lines
Quoted 3 lines
Quoted 3 lines

drivers/net/iavf/iavf_hash.c iavf_hash_parse_action(struct · line 1008

Quoted 3 lines
drivers/net/iavf/iavf_hash.c +2 -0
+			else if (rss->func ==
+

RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
drivers/net/iavf/iavf_hash.c +5 -0
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC;
+			else
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC;
 
   			type_match_item =

rte_zmalloc("iavf_type_match_item",

drivers/net/iavf/iavf_hash.c +1 -1
@@ -1126,7 +1128,7 @@ iavf_hash_create(__rte_unused struct
 iavf_adapter *ad,
   	}
 
   	rss_cfg->proto_hdrs = *rss_meta->proto_hdrs;
-	rss_cfg->rss_algorithm = rss_meta->hash_function;
+	rss_cfg->rss_algorithm = rss_meta->rss_algorithm;
 
   	ret = iavf_add_del_rss_cfg(ad, rss_cfg, true);
   	if (!ret) {

--
2.20.1

author
#6 lore raw

PATCH v2 1/2 common/iavf: fix typo of rss algorithm type

In reply to Jeff Guo

A typo need to be fixd for Simple XOR algorithm configuration.

---
v2: fix a typo for xor.

---
 drivers/common/iavf/virtchnl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/iavf/virtchnl.h +1 -1
index 36449731f..ef41a4f8a 100644
@@ -551,7 +551,7 @@ VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_rss_hena);
 /* Type of RSS algorithm */
 enum virtchnl_rss_algorithm {
 	VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC	= 0,
-	VIRTCHNL_RSS_ALG_R_ASYMMETRIC		= 1,
+	VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC		= 1,
 	VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC	= 2,
 	VIRTCHNL_RSS_ALG_XOR_SYMMETRIC		= 3,
 };
Signature · 1 line
2.20.1
author
#7 lore raw

PATCH v2 2/2 net/iavf: fix rss algorithm configure issue

When configure rss rule, the etherdev rss hash function type should be mapped to the corresponding virtchnl rss algorithm type.

Fixes 7be10c3004be ("net/iavf: add RSS configuration for VF")

---
v2->v1:
fix a type for xor.

---
 drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/net/iavf/iavf_hash.c +11 -9
index 6359ead76..975c84556 100644
@@ -47,7 +47,7 @@ struct iavf_hash_match_type {
 
 struct iavf_rss_meta {
 	struct virtchnl_proto_hdrs *proto_hdrs;
-	uint32_t hash_function;
+	enum virtchnl_rss_algorithm rss_algorithm;
 };
 
 struct iavf_hash_flow_cfg {
@@ -1001,13 +1001,15 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item,
 
 			/* Check hash function and save it to rss_meta. */
 			if (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
-
-			if (rss->func ==
-			    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC;
+			else if (rss->func ==
+				 RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC;
+			else
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC;
 
 			type_match_item =
 			rte_zmalloc("iavf_type_match_item",
@@ -1126,7 +1128,7 @@ iavf_hash_create(__rte_unused struct iavf_adapter *ad,
 	}
 
 	rss_cfg->proto_hdrs = *rss_meta->proto_hdrs;
-	rss_cfg->rss_algorithm = rss_meta->hash_function;
+	rss_cfg->rss_algorithm = rss_meta->rss_algorithm;
 
 	ret = iavf_add_del_rss_cfg(ad, rss_cfg, true);
 	if (!ret) {
Signature · 1 line
2.20.1
Acked-by on v2 2/2
#8 lore raw
Quoted 11 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Thursday, May 14, 2020 4:21 AM
To: Xing, Beilei <[email protected]>; Ye, Xiaolong <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue

Quoted 5 lines

When configure rss rule, the etherdev rss hash function type should be mapped to the corresponding virtchnl rss algorithm type.

Fixes 7be10c3004be ("net/iavf: add RSS configuration for VF")
Applied
#9 lore raw
Quoted 11 lines · Qi Z
Quoted 11 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Thursday, May 14, 2020 4:21 AM
To: Xing, Beilei <[email protected]>; Ye, Xiaolong <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue

Quoted 8 lines
Quoted 5 lines

When configure rss rule, the etherdev rss hash function type should be mapped to the corresponding virtchnl rss algorithm type.

Fixes 7be10c3004be ("net/iavf: add RSS configuration for VF")

Applied to dpdk-next-net-intel, Thanks.

Acked-by on v2 1/2
#10 lore raw

Re: [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type

In reply to Jeff Guo
Quoted 25 lines · Jeff Guo

A typo need to be fixd for Simple XOR algorithm configuration.

---
v2: fix a typo for xor.
---
drivers/common/iavf/virtchnl.h | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/iavf/virtchnl.h +1 -1
index 36449731f..ef41a4f8a 100644
@@ -551,7 +551,7 @@ VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_rss_hena);
 /* Type of RSS algorithm */
 enum virtchnl_rss_algorithm {
 	VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC	= 0,
-	VIRTCHNL_RSS_ALG_R_ASYMMETRIC		= 1,
+	VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC		= 1,
 	VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC	= 2,
 	VIRTCHNL_RSS_ALG_XOR_SYMMETRIC		= 3,
 };
Signature · 1 line
2.20.1
Applied
#11 lore raw

Re: [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type

In reply to Jeff Guo
Quoted 25 lines · Jeff Guo

A typo need to be fixd for Simple XOR algorithm configuration.

---
v2: fix a typo for xor.
---
drivers/common/iavf/virtchnl.h | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/iavf/virtchnl.h +1 -1
index 36449731f..ef41a4f8a 100644
@@ -551,7 +551,7 @@ VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_rss_hena);
 /* Type of RSS algorithm */
 enum virtchnl_rss_algorithm {
 	VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC	= 0,
-	VIRTCHNL_RSS_ALG_R_ASYMMETRIC		= 1,
+	VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC		= 1,
 	VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC	= 2,
 	VIRTCHNL_RSS_ALG_XOR_SYMMETRIC		= 3,
 };
Signature · 1 line
2.20.1

Applied to dpdk-next-net-intel, Thanks.