DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  net/iavf: fix rss algorithm configure issue
@ 2020-05-09 20:27 Jeff Guo
  2020-05-12  2:17 ` Zhang, Qi Z
  2020-05-13 20:21 ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Jeff Guo
  0 siblings, 2 replies; 12+ messages in thread
From: Jeff Guo @ 2020-05-09 20:27 UTC (permalink / raw)
  To: beilei.xing, qi.z.zhang, jingjing.wu; +Cc: xiaolong.ye, dev, jia.guo

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")
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
 drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 6359ead76..173b7633f 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -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) {
-- 
2.20.1


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

* Re: [dpdk-dev] net/iavf: fix rss algorithm configure issue
  2020-05-09 20:27 [dpdk-dev] net/iavf: fix rss algorithm configure issue Jeff Guo
@ 2020-05-12  2:17 ` Zhang, Qi Z
  2020-05-12  2:21   ` Zhang, Qi Z
  2020-05-13 20:21 ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Jeff Guo
  1 sibling, 1 reply; 12+ messages in thread
From: Zhang, Qi Z @ 2020-05-12  2:17 UTC (permalink / raw)
  To: Guo, Jia, Xing, Beilei, Wu, Jingjing; +Cc: Ye, Xiaolong, dev



> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Sunday, May 10, 2020 4:28 AM
> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>
> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia
> <jia.guo@intel.com>
> 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")
> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> ---
>  drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> 6359ead76..173b7633f 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -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;

RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ --> VIRTCHNL_RSS_ALG_R_ASYMMETRIC

Is it should be VIRTCHNL_RSS_ALG_XOR_SYMMETRIC?



> +			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) {
> --
> 2.20.1


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

* Re: [dpdk-dev] net/iavf: fix rss algorithm configure issue
  2020-05-12  2:17 ` Zhang, Qi Z
@ 2020-05-12  2:21   ` Zhang, Qi Z
  2020-05-12 23:20     ` Jeff Guo
  0 siblings, 1 reply; 12+ messages in thread
From: Zhang, Qi Z @ 2020-05-12  2:21 UTC (permalink / raw)
  To: Guo, Jia, Xing, Beilei, Wu, Jingjing; +Cc: Ye, Xiaolong, dev



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Tuesday, May 12, 2020 10:18 AM
> To: Guo, Jia <jia.guo@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>
> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org
> Subject: RE: [dpdk-dev] net/iavf: fix rss algorithm configure issue
> 
> 
> 
> > -----Original Message-----
> > From: Guo, Jia <jia.guo@intel.com>
> > Sent: Sunday, May 10, 2020 4:28 AM
> > To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> > Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia
> > <jia.guo@intel.com>
> > 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")
> > Signed-off-by: Jeff Guo <jia.guo@intel.com>
> > ---
> >  drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
> >  1 file changed, 11 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/net/iavf/iavf_hash.c
> > b/drivers/net/iavf/iavf_hash.c index 6359ead76..173b7633f 100644
> > --- a/drivers/net/iavf/iavf_hash.c
> > +++ b/drivers/net/iavf/iavf_hash.c
> > @@ -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;
> 
> 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.
> 
> Is it should be VIRTCHNL_RSS_ALG_XOR_SYMMETRIC?
> 
> 
> 
> > +			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) {
> > --
> > 2.20.1


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

* Re: [dpdk-dev] net/iavf: fix rss algorithm configure issue
  2020-05-12  2:21   ` Zhang, Qi Z
@ 2020-05-12 23:20     ` Jeff Guo
  2020-05-13  2:17       ` Zhang, Qi Z
  0 siblings, 1 reply; 12+ messages in thread
From: Jeff Guo @ 2020-05-12 23:20 UTC (permalink / raw)
  To: Zhang, Qi Z, Xing, Beilei, Wu, Jingjing; +Cc: Ye, Xiaolong, dev

hi, qi

On 5/12/2020 10:21 AM, Zhang, Qi Z wrote:
>
>> -----Original Message-----
>> From: Zhang, Qi Z
>> Sent: Tuesday, May 12, 2020 10:18 AM
>> To: Guo, Jia <jia.guo@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Wu,
>> Jingjing <jingjing.wu@intel.com>
>> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org
>> Subject: RE: [dpdk-dev] net/iavf: fix rss algorithm configure issue
>>
>>
>>
>>> -----Original Message-----
>>> From: Guo, Jia <jia.guo@intel.com>
>>> Sent: Sunday, May 10, 2020 4:28 AM
>>> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
>>> <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
>>> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia
>>> <jia.guo@intel.com>
>>> 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")
>>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
>>> ---
>>>   drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
>>>   1 file changed, 11 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/net/iavf/iavf_hash.c
>>> b/drivers/net/iavf/iavf_hash.c index 6359ead76..173b7633f 100644
>>> --- a/drivers/net/iavf/iavf_hash.c
>>> +++ b/drivers/net/iavf/iavf_hash.c
>>> @@ -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;
>> 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.
>> Is it should be VIRTCHNL_RSS_ALG_XOR_SYMMETRIC?
>>
>>

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


>>> +			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) {
>>> --
>>> 2.20.1

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

* Re: [dpdk-dev] net/iavf: fix rss algorithm configure issue
  2020-05-12 23:20     ` Jeff Guo
@ 2020-05-13  2:17       ` Zhang, Qi Z
  2020-05-13  3:12         ` Jeff Guo
  0 siblings, 1 reply; 12+ messages in thread
From: Zhang, Qi Z @ 2020-05-13  2:17 UTC (permalink / raw)
  To: Guo, Jia, Xing, Beilei, Wu, Jingjing; +Cc: Ye, Xiaolong, dev



> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Wednesday, May 13, 2020 7:20 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>
> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] net/iavf: fix rss algorithm configure issue
> 
> hi, qi
> 
> On 5/12/2020 10:21 AM, Zhang, Qi Z wrote:
> >
> >> -----Original Message-----
> >> From: Zhang, Qi Z
> >> Sent: Tuesday, May 12, 2020 10:18 AM
> >> To: Guo, Jia <jia.guo@intel.com>; Xing, Beilei
> >> <beilei.xing@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> >> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org
> >> Subject: RE: [dpdk-dev] net/iavf: fix rss algorithm configure issue
> >>
> >>
> >>
> >>> -----Original Message-----
> >>> From: Guo, Jia <jia.guo@intel.com>
> >>> Sent: Sunday, May 10, 2020 4:28 AM
> >>> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> >>> <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> >>> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia
> >>> <jia.guo@intel.com>
> >>> 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")
> >>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> >>> ---
> >>>   drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
> >>>   1 file changed, 11 insertions(+), 9 deletions(-)
> >>>
> >>> diff --git a/drivers/net/iavf/iavf_hash.c
> >>> b/drivers/net/iavf/iavf_hash.c index 6359ead76..173b7633f 100644
> >>> --- a/drivers/net/iavf/iavf_hash.c
> >>> +++ b/drivers/net/iavf/iavf_hash.c
> >>> @@ -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;
> >> 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.
> >> 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.


> 
> 
> >>> +			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) {
> >>> --
> >>> 2.20.1

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

* Re: [dpdk-dev] net/iavf: fix rss algorithm configure issue
  2020-05-13  2:17       ` Zhang, Qi Z
@ 2020-05-13  3:12         ` Jeff Guo
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff Guo @ 2020-05-13  3:12 UTC (permalink / raw)
  To: Zhang, Qi Z, Xing, Beilei, Wu, Jingjing; +Cc: Ye, Xiaolong, dev

hi, qi

On 5/13/2020 10:17 AM, Zhang, Qi Z wrote:
>
>> -----Original Message-----
>> From: Guo, Jia <jia.guo@intel.com>
>> Sent: Wednesday, May 13, 2020 7:20 AM
>> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
>> Wu, Jingjing <jingjing.wu@intel.com>
>> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org
>> Subject: Re: [dpdk-dev] net/iavf: fix rss algorithm configure issue
>>
>> hi, qi
>>
>> On 5/12/2020 10:21 AM, Zhang, Qi Z wrote:
>>>> -----Original Message-----
>>>> From: Zhang, Qi Z
>>>> Sent: Tuesday, May 12, 2020 10:18 AM
>>>> To: Guo, Jia <jia.guo@intel.com>; Xing, Beilei
>>>> <beilei.xing@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
>>>> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org
>>>> Subject: RE: [dpdk-dev] net/iavf: fix rss algorithm configure issue
>>>>
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Guo, Jia <jia.guo@intel.com>
>>>>> Sent: Sunday, May 10, 2020 4:28 AM
>>>>> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
>>>>> <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
>>>>> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia
>>>>> <jia.guo@intel.com>
>>>>> 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")
>>>>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
>>>>> ---
>>>>>    drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
>>>>>    1 file changed, 11 insertions(+), 9 deletions(-)
>>>>>
>>>>> diff --git a/drivers/net/iavf/iavf_hash.c
>>>>> b/drivers/net/iavf/iavf_hash.c index 6359ead76..173b7633f 100644
>>>>> --- a/drivers/net/iavf/iavf_hash.c
>>>>> +++ b/drivers/net/iavf/iavf_hash.c
>>>>> @@ -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;
>>>> 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.
>>>> 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.
>

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.


>>
>>>>> +			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) {
>>>>> --
>>>>> 2.20.1

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

* Re: [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue
  2020-05-13 20:21   ` [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue Jeff Guo
@ 2020-05-13  9:34     ` Zhang, Qi Z
  2020-05-14  6:02       ` Ye Xiaolong
  0 siblings, 1 reply; 12+ messages in thread
From: Zhang, Qi Z @ 2020-05-13  9:34 UTC (permalink / raw)
  To: Guo, Jia, Xing, Beilei, Ye, Xiaolong, Wu, Jingjing; +Cc: dev



> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Thursday, May 14, 2020 4:21 AM
> To: Xing, Beilei <beilei.xing@intel.com>; Ye, Xiaolong
> <xiaolong.ye@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Guo, Jia <jia.guo@intel.com>
> Subject: [dpdk-dev 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")
> Signed-off-by: Jeff Guo <jia.guo@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>


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

* [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type
  2020-05-09 20:27 [dpdk-dev] net/iavf: fix rss algorithm configure issue Jeff Guo
  2020-05-12  2:17 ` Zhang, Qi Z
@ 2020-05-13 20:21 ` Jeff Guo
  2020-05-13 20:21   ` [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue Jeff Guo
                     ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: Jeff Guo @ 2020-05-13 20:21 UTC (permalink / raw)
  To: beilei.xing, xiaolong.ye, qi.z.zhang, jingjing.wu; +Cc: dev, jia.guo

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

Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
v2: fix a typo for xor.
---
 drivers/common/iavf/virtchnl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index 36449731f..ef41a4f8a 100644
--- a/drivers/common/iavf/virtchnl.h
+++ b/drivers/common/iavf/virtchnl.h
@@ -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,
 };
-- 
2.20.1


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

* [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue
  2020-05-13 20:21 ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Jeff Guo
@ 2020-05-13 20:21   ` Jeff Guo
  2020-05-13  9:34     ` Zhang, Qi Z
  2020-05-14  5:59   ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Ye Xiaolong
  2020-05-14  6:02   ` Ye Xiaolong
  2 siblings, 1 reply; 12+ messages in thread
From: Jeff Guo @ 2020-05-13 20:21 UTC (permalink / raw)
  To: beilei.xing, xiaolong.ye, qi.z.zhang, jingjing.wu; +Cc: dev, jia.guo

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")
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
v2->v1:
fix a type for xor.
---
 drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 6359ead76..975c84556 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -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) {
-- 
2.20.1


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

* Re: [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type
  2020-05-13 20:21 ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Jeff Guo
  2020-05-13 20:21   ` [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue Jeff Guo
@ 2020-05-14  5:59   ` Ye Xiaolong
  2020-05-14  6:02   ` Ye Xiaolong
  2 siblings, 0 replies; 12+ messages in thread
From: Ye Xiaolong @ 2020-05-14  5:59 UTC (permalink / raw)
  To: Jeff Guo; +Cc: beilei.xing, qi.z.zhang, jingjing.wu, dev

On 05/13, Jeff Guo wrote:
>A typo need to be fixd for Simple XOR algorithm configuration.
>
>Signed-off-by: Jeff Guo <jia.guo@intel.com>
>---
>v2: fix a typo for xor.
>---
> drivers/common/iavf/virtchnl.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
>index 36449731f..ef41a4f8a 100644
>--- a/drivers/common/iavf/virtchnl.h
>+++ b/drivers/common/iavf/virtchnl.h
>@@ -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,
> };
>-- 
>2.20.1
>

Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>

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

* Re: [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue
  2020-05-13  9:34     ` Zhang, Qi Z
@ 2020-05-14  6:02       ` Ye Xiaolong
  0 siblings, 0 replies; 12+ messages in thread
From: Ye Xiaolong @ 2020-05-14  6:02 UTC (permalink / raw)
  To: Zhang, Qi Z; +Cc: Guo, Jia, Xing, Beilei, Wu, Jingjing, dev

On 05/13, Zhang, Qi Z wrote:
>
>
>> -----Original Message-----
>> From: Guo, Jia <jia.guo@intel.com>
>> Sent: Thursday, May 14, 2020 4:21 AM
>> To: Xing, Beilei <beilei.xing@intel.com>; Ye, Xiaolong
>> <xiaolong.ye@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing
>> <jingjing.wu@intel.com>
>> Cc: dev@dpdk.org; Guo, Jia <jia.guo@intel.com>
>> Subject: [dpdk-dev 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")
>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
>
>Acked-by: Qi Zhang <qi.z.zhang@intel.com>
>

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

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

* Re: [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type
  2020-05-13 20:21 ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Jeff Guo
  2020-05-13 20:21   ` [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue Jeff Guo
  2020-05-14  5:59   ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Ye Xiaolong
@ 2020-05-14  6:02   ` Ye Xiaolong
  2 siblings, 0 replies; 12+ messages in thread
From: Ye Xiaolong @ 2020-05-14  6:02 UTC (permalink / raw)
  To: Jeff Guo; +Cc: beilei.xing, qi.z.zhang, jingjing.wu, dev

On 05/13, Jeff Guo wrote:
>A typo need to be fixd for Simple XOR algorithm configuration.
>
>Signed-off-by: Jeff Guo <jia.guo@intel.com>
>---
>v2: fix a typo for xor.
>---
> drivers/common/iavf/virtchnl.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
>index 36449731f..ef41a4f8a 100644
>--- a/drivers/common/iavf/virtchnl.h
>+++ b/drivers/common/iavf/virtchnl.h
>@@ -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,
> };
>-- 
>2.20.1
>

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

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

end of thread, other threads:[~2020-05-14  6:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09 20:27 [dpdk-dev] net/iavf: fix rss algorithm configure issue Jeff Guo
2020-05-12  2:17 ` Zhang, Qi Z
2020-05-12  2:21   ` Zhang, Qi Z
2020-05-12 23:20     ` Jeff Guo
2020-05-13  2:17       ` Zhang, Qi Z
2020-05-13  3:12         ` Jeff Guo
2020-05-13 20:21 ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Jeff Guo
2020-05-13 20:21   ` [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue Jeff Guo
2020-05-13  9:34     ` Zhang, Qi Z
2020-05-14  6:02       ` Ye Xiaolong
2020-05-14  5:59   ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Ye Xiaolong
2020-05-14  6:02   ` Ye Xiaolong

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