DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/iavf: fix performance drop
@ 2021-04-26  5:29 Wenzhuo Lu
  2021-04-26  9:04 ` Zhang, Qi Z
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Wenzhuo Lu @ 2021-04-26  5:29 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

AVX2 and SSE don't have the offload path.
Not necessary doing any check. Or the scalar path
will be chosen.

Fixes: eff56a7b9f97 ("net/iavf: add offload path for Rx AVX512")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 3f3cf63..0ba19dbf 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2401,13 +2401,11 @@
 	check_ret = iavf_rx_vec_dev_check(dev);
 	if (check_ret >= 0 &&
 	    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
-		if (check_ret == IAVF_VECTOR_PATH) {
-			use_sse = true;
-			if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
-			     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
-			    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
-				use_avx2 = true;
-		}
+		use_sse = true;
+		if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
+		     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
+		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
+			use_avx2 = true;
 
 #ifdef CC_AVX512_SUPPORT
 		if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
-- 
1.9.3


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-26  5:29 [dpdk-dev] [PATCH] net/iavf: fix performance drop Wenzhuo Lu
@ 2021-04-26  9:04 ` Zhang, Qi Z
  2021-04-27  1:51   ` Lu, Wenzhuo
  2021-04-27  5:19 ` Zhang, Qi Z
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Zhang, Qi Z @ 2021-04-26  9:04 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wenzhuo Lu
> Sent: Monday, April 26, 2021 1:30 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH] net/iavf: fix performance drop
> 
> AVX2 and SSE don't have the offload path.
> Not necessary doing any check. Or the scalar path will be chosen.
> 
> Fixes: eff56a7b9f97 ("net/iavf: add offload path for Rx AVX512")
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> ---
>  drivers/net/iavf/iavf_rxtx.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index
> 3f3cf63..0ba19dbf 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -2401,13 +2401,11 @@
>  	check_ret = iavf_rx_vec_dev_check(dev);
>  	if (check_ret >= 0 &&
>  	    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
> -		if (check_ret == IAVF_VECTOR_PATH) {
> -			use_sse = true;
> -			if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> -			     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1)
> &&
> -			    rte_vect_get_max_simd_bitwidth() >=
> RTE_VECT_SIMD_256)
> -				use_avx2 = true;
> -		}
> +		use_sse = true;
> +		if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> +		     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
> +		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
> +			use_avx2 = true;


Not sure if the right path will be selected when avx512 is not true, (CC_AVX512_SUPPORT is disable) while check_ret is IAVF_VECTOR_OFFLOAD_PATH?

Currently we have 

if (!use_sse && !use_avx2 && !use_avx512)
	goto normal;

Should we also add below check?

if (!use_avx512 && check_ret == IAVF_VECTOR_OFFLOAD_PATH)
   goto normal;

> 
>  #ifdef CC_AVX512_SUPPORT
>  		if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
> --
> 1.9.3


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-26  9:04 ` Zhang, Qi Z
@ 2021-04-27  1:51   ` Lu, Wenzhuo
  2021-04-27  2:57     ` Zhang, Qi Z
  0 siblings, 1 reply; 12+ messages in thread
From: Lu, Wenzhuo @ 2021-04-27  1:51 UTC (permalink / raw)
  To: Zhang, Qi Z, dev

> > +use_sse = true;
> > +if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> > +     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
> > +    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
> > +use_avx2 = true;
> 
> 
> Not sure if the right path will be selected when avx512 is not true,
> (CC_AVX512_SUPPORT is disable) while check_ret is
> IAVF_VECTOR_OFFLOAD_PATH?
> 
> Currently we have
> 
> if (!use_sse && !use_avx2 && !use_avx512) goto normal;
> 
> Should we also add below check?
> 
> if (!use_avx512 && check_ret == IAVF_VECTOR_OFFLOAD_PATH)
>    goto normal;
Not necessary. As explained in the commit log, AVX2 and SSE support the offload features. The purpose of this patch is to let AVX2 be chosen when offload needed and AVX512 disable.

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

* Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-27  1:51   ` Lu, Wenzhuo
@ 2021-04-27  2:57     ` Zhang, Qi Z
  2021-04-27  5:09       ` Lu, Wenzhuo
  2021-04-28 11:32       ` Ferruh Yigit
  0 siblings, 2 replies; 12+ messages in thread
From: Zhang, Qi Z @ 2021-04-27  2:57 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev



> -----Original Message-----
> From: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Sent: 2021年4月27日 9:51
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] net/iavf: fix performance drop
> 
> > > +use_sse = true;
> > > +if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> > > +     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
> > > +    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
> > > +use_avx2 = true;
> >
> >
> > Not sure if the right path will be selected when avx512 is not true,
> > (CC_AVX512_SUPPORT is disable) while check_ret is
> > IAVF_VECTOR_OFFLOAD_PATH?
> >
> > Currently we have
> >
> > if (!use_sse && !use_avx2 && !use_avx512) goto normal;
> >
> > Should we also add below check?
> >
> > if (!use_avx512 && check_ret == IAVF_VECTOR_OFFLOAD_PATH)
> >    goto normal;
> Not necessary. As explained in the commit log, AVX2 and SSE support the
> offload features. The purpose of this patch is to let AVX2 be chosen when
> offload needed and AVX512 disable.

OK, now I understand it, I will suggest to change the commit log.

From 
AVX2 and SSE don't have the offload path.

To 
AVX2 and SSE Tx path already support offloads but can't selected.

If you agree, will apply above during change during patch merge.


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-27  2:57     ` Zhang, Qi Z
@ 2021-04-27  5:09       ` Lu, Wenzhuo
  2021-04-28 11:32       ` Ferruh Yigit
  1 sibling, 0 replies; 12+ messages in thread
From: Lu, Wenzhuo @ 2021-04-27  5:09 UTC (permalink / raw)
  To: Zhang, Qi Z, dev

> > > > +use_sse = true;
> > > > +if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> > > > +     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
> > > > +    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
> > > > +use_avx2 = true;
> > >
> > >
> > > Not sure if the right path will be selected when avx512 is not true,
> > > (CC_AVX512_SUPPORT is disable) while check_ret is
> > > IAVF_VECTOR_OFFLOAD_PATH?
> > >
> > > Currently we have
> > >
> > > if (!use_sse && !use_avx2 && !use_avx512) goto normal;
> > >
> > > Should we also add below check?
> > >
> > > if (!use_avx512 && check_ret == IAVF_VECTOR_OFFLOAD_PATH)
> > >    goto normal;
> > Not necessary. As explained in the commit log, AVX2 and SSE support
> > the offload features. The purpose of this patch is to let AVX2 be
> > chosen when offload needed and AVX512 disable.
> 
> OK, now I understand it, I will suggest to change the commit log.
> 
> From
> AVX2 and SSE don't have the offload path.
> 
> To
> AVX2 and SSE Tx path already support offloads but can't selected.
> 
> If you agree, will apply above during change during patch merge.
Sure. Thanks for that.


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-26  5:29 [dpdk-dev] [PATCH] net/iavf: fix performance drop Wenzhuo Lu
  2021-04-26  9:04 ` Zhang, Qi Z
@ 2021-04-27  5:19 ` Zhang, Qi Z
  2021-04-28 11:32 ` Ferruh Yigit
  2021-04-29  1:33 ` Wenzhuo Lu
  3 siblings, 0 replies; 12+ messages in thread
From: Zhang, Qi Z @ 2021-04-27  5:19 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wenzhuo Lu
> Sent: Monday, April 26, 2021 1:30 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH] net/iavf: fix performance drop
> 
> AVX2 and SSE don't have the offload path.
> Not necessary doing any check. Or the scalar path will be chosen.

AVX2 and SSE Tx path already support offloads but can't be selected.
The patch remove the unnecessary check or the scalar path will always
be chosen.

> 
> Fixes: eff56a7b9f97 ("net/iavf: add offload path for Rx AVX512")
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

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

Applied to dpdk-next-net-intel after refined commit log.

Thanks
Qi


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-26  5:29 [dpdk-dev] [PATCH] net/iavf: fix performance drop Wenzhuo Lu
  2021-04-26  9:04 ` Zhang, Qi Z
  2021-04-27  5:19 ` Zhang, Qi Z
@ 2021-04-28 11:32 ` Ferruh Yigit
  2021-04-29  1:08   ` Lu, Wenzhuo
  2021-04-29  1:33 ` Wenzhuo Lu
  3 siblings, 1 reply; 12+ messages in thread
From: Ferruh Yigit @ 2021-04-28 11:32 UTC (permalink / raw)
  To: Wenzhuo Lu, dev

On 4/26/2021 6:29 AM, Wenzhuo Lu wrote:
> AVX2 and SSE don't have the offload path.
> Not necessary doing any check. Or the scalar path
> will be chosen.

Hi Wenzhuo,

The fix by not changing Rx implementation, but making sure correct Rx path
selected, right? Can you please clarify this in the commit log?

So the performance drop fixed for whoever have the vector path supported and
offloads enabled, can be good to highlight in the patch title, otherwise it is
too generic.

> 
> Fixes: eff56a7b9f97 ("net/iavf: add offload path for Rx AVX512")
> 

I am not clear what caused the performance drop.
Before above patch, vector path was not supporting the offloads and scalar path
should be selected. After above patch, still scalar path selected, although
vector path supports offloads, but for both before and after scalar path is
selected, so why/when the performance drop happens?
Can you please clarify in the commit log, how to reproduce performance drop?


> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> ---
>  drivers/net/iavf/iavf_rxtx.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
> index 3f3cf63..0ba19dbf 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -2401,13 +2401,11 @@
>  	check_ret = iavf_rx_vec_dev_check(dev);
>  	if (check_ret >= 0 &&
>  	    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
> -		if (check_ret == IAVF_VECTOR_PATH) {
> -			use_sse = true;
> -			if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> -			     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
> -			    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
> -				use_avx2 = true;
> -		}
> +		use_sse = true;
> +		if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> +		     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
> +		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
> +			use_avx2 = true;
>  
>  #ifdef CC_AVX512_SUPPORT
>  		if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
> 


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-27  2:57     ` Zhang, Qi Z
  2021-04-27  5:09       ` Lu, Wenzhuo
@ 2021-04-28 11:32       ` Ferruh Yigit
  2021-04-28 12:06         ` Zhang, Qi Z
  1 sibling, 1 reply; 12+ messages in thread
From: Ferruh Yigit @ 2021-04-28 11:32 UTC (permalink / raw)
  To: Zhang, Qi Z, Lu, Wenzhuo, dev

On 4/27/2021 3:57 AM, Zhang, Qi Z wrote:
> 
> 
>> -----Original Message-----
>> From: Lu, Wenzhuo <wenzhuo.lu@intel.com>
>> Sent: 2021年4月27日 9:51
>> To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
>> Subject: RE: [dpdk-dev] [PATCH] net/iavf: fix performance drop
>>
>>>> +use_sse = true;
>>>> +if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
>>>> +     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
>>>> +    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
>>>> +use_avx2 = true;
>>>
>>>
>>> Not sure if the right path will be selected when avx512 is not true,
>>> (CC_AVX512_SUPPORT is disable) while check_ret is
>>> IAVF_VECTOR_OFFLOAD_PATH?
>>>
>>> Currently we have
>>>
>>> if (!use_sse && !use_avx2 && !use_avx512) goto normal;
>>>
>>> Should we also add below check?
>>>
>>> if (!use_avx512 && check_ret == IAVF_VECTOR_OFFLOAD_PATH)
>>>    goto normal;
>> Not necessary. As explained in the commit log, AVX2 and SSE support the
>> offload features. The purpose of this patch is to let AVX2 be chosen when
>> offload needed and AVX512 disable.
> 
> OK, now I understand it, I will suggest to change the commit log.
> 
> From 
> AVX2 and SSE don't have the offload path.
> 
> To 
> AVX2 and SSE Tx path already support offloads but can't selected.
> 

Isn't this related to the _Rx_ path?

> If you agree, will apply above during change during patch merge.
> 


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-28 11:32       ` Ferruh Yigit
@ 2021-04-28 12:06         ` Zhang, Qi Z
  0 siblings, 0 replies; 12+ messages in thread
From: Zhang, Qi Z @ 2021-04-28 12:06 UTC (permalink / raw)
  To: Yigit, Ferruh, Lu, Wenzhuo, dev



> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Wednesday, April 28, 2021 7:32 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
> 
> On 4/27/2021 3:57 AM, Zhang, Qi Z wrote:
> >
> >
> >> -----Original Message-----
> >> From: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> >> Sent: 2021年4月27日 9:51
> >> To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
> >> Subject: RE: [dpdk-dev] [PATCH] net/iavf: fix performance drop
> >>
> >>>> +use_sse = true;
> >>>> +if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> >>>> +     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
> >>>> +    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
> >>>> +use_avx2 = true;
> >>>
> >>>
> >>> Not sure if the right path will be selected when avx512 is not true,
> >>> (CC_AVX512_SUPPORT is disable) while check_ret is
> >>> IAVF_VECTOR_OFFLOAD_PATH?
> >>>
> >>> Currently we have
> >>>
> >>> if (!use_sse && !use_avx2 && !use_avx512) goto normal;
> >>>
> >>> Should we also add below check?
> >>>
> >>> if (!use_avx512 && check_ret == IAVF_VECTOR_OFFLOAD_PATH)
> >>>    goto normal;
> >> Not necessary. As explained in the commit log, AVX2 and SSE support
> >> the offload features. The purpose of this patch is to let AVX2 be
> >> chosen when offload needed and AVX512 disable.
> >
> > OK, now I understand it, I will suggest to change the commit log.
> >
> > From
> > AVX2 and SSE don't have the offload path.
> >
> > To
> > AVX2 and SSE Tx path already support offloads but can't selected.
> >
> 
> Isn't this related to the _Rx_ path?

Yes, it should be Rx Path.

> 
> > If you agree, will apply above during change during patch merge.
> >


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-28 11:32 ` Ferruh Yigit
@ 2021-04-29  1:08   ` Lu, Wenzhuo
  0 siblings, 0 replies; 12+ messages in thread
From: Lu, Wenzhuo @ 2021-04-29  1:08 UTC (permalink / raw)
  To: Yigit, Ferruh, dev

> The fix by not changing Rx implementation, but making sure correct Rx path
> selected, right? Can you please clarify this in the commit log?
> 
> So the performance drop fixed for whoever have the vector path supported and
> offloads enabled, can be good to highlight in the patch title, otherwise it is too
> generic.
Yes, the implementation is not changed. It's only about the path selection. I'll clarify it.

> 
> >
> > Fixes: eff56a7b9f97 ("net/iavf: add offload path for Rx AVX512")
> >
> 
> I am not clear what caused the performance drop.
> Before above patch, vector path was not supporting the offloads and scalar
> path should be selected. After above patch, still scalar path selected, although
> vector path supports offloads, but for both before and after scalar path is
> selected, so why/when the performance drop happens?
> Can you please clarify in the commit log, how to reproduce performance drop?
Sure. I'll describe more about what's the issue.

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

* [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-26  5:29 [dpdk-dev] [PATCH] net/iavf: fix performance drop Wenzhuo Lu
                   ` (2 preceding siblings ...)
  2021-04-28 11:32 ` Ferruh Yigit
@ 2021-04-29  1:33 ` Wenzhuo Lu
  2021-04-29  3:20   ` Zhang, Qi Z
  3 siblings, 1 reply; 12+ messages in thread
From: Wenzhuo Lu @ 2021-04-29  1:33 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

The performance drop is caused by that the RX scalar path
is selected when AVX512 is disabled and some HW offload
is enabled.
Actaully, the HW offload is supported by AVX2 and SSE.
In this scenario AVX2 path should be chosen.

This patch removes the offload related check for SSE and AVX2
as SSE and AVX2 do support the offload features.
No implement change about the data path.

Fixes: eff56a7b9f97 ("net/iavf: add offload path for Rx AVX512")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 3f3cf63..0ba19dbf 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2401,13 +2401,11 @@
 	check_ret = iavf_rx_vec_dev_check(dev);
 	if (check_ret >= 0 &&
 	    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
-		if (check_ret == IAVF_VECTOR_PATH) {
-			use_sse = true;
-			if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
-			     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
-			    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
-				use_avx2 = true;
-		}
+		use_sse = true;
+		if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
+		     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
+		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
+			use_avx2 = true;
 
 #ifdef CC_AVX512_SUPPORT
 		if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
-- 
1.9.3


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix performance drop
  2021-04-29  1:33 ` Wenzhuo Lu
@ 2021-04-29  3:20   ` Zhang, Qi Z
  0 siblings, 0 replies; 12+ messages in thread
From: Zhang, Qi Z @ 2021-04-29  3:20 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wenzhuo Lu
> Sent: Thursday, April 29, 2021 9:34 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH] net/iavf: fix performance drop
> 
> The performance drop is caused by that the RX scalar path is selected when
> AVX512 is disabled and some HW offload is enabled.
> Actaully, the HW offload is supported by AVX2 and SSE.
> In this scenario AVX2 path should be chosen.
> 
> This patch removes the offload related check for SSE and AVX2 as SSE and AVX2
> do support the offload features.
> No implement change about the data path.
> 
> Fixes: eff56a7b9f97 ("net/iavf: add offload path for Rx AVX512")
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> ---
>  drivers/net/iavf/iavf_rxtx.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index
> 3f3cf63..0ba19dbf 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -2401,13 +2401,11 @@
>  	check_ret = iavf_rx_vec_dev_check(dev);
>  	if (check_ret >= 0 &&
>  	    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
> -		if (check_ret == IAVF_VECTOR_PATH) {
> -			use_sse = true;
> -			if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> -			     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1)
> &&
> -			    rte_vect_get_max_simd_bitwidth() >=
> RTE_VECT_SIMD_256)
> -				use_avx2 = true;
> -		}
> +		use_sse = true;
> +		if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> +		     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
> +		    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
> +			use_avx2 = true;
> 
>  #ifdef CC_AVX512_SUPPORT
>  		if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
> --
> 1.9.3

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

Applied to dpdk-next-net-intel.

Thanks
Qi


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

end of thread, other threads:[~2021-04-29  3:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26  5:29 [dpdk-dev] [PATCH] net/iavf: fix performance drop Wenzhuo Lu
2021-04-26  9:04 ` Zhang, Qi Z
2021-04-27  1:51   ` Lu, Wenzhuo
2021-04-27  2:57     ` Zhang, Qi Z
2021-04-27  5:09       ` Lu, Wenzhuo
2021-04-28 11:32       ` Ferruh Yigit
2021-04-28 12:06         ` Zhang, Qi Z
2021-04-27  5:19 ` Zhang, Qi Z
2021-04-28 11:32 ` Ferruh Yigit
2021-04-29  1:08   ` Lu, Wenzhuo
2021-04-29  1:33 ` Wenzhuo Lu
2021-04-29  3:20   ` Zhang, Qi Z

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git