net/iavf: fix performance drop

Message ID 1619660037-33334-1-git-send-email-wenzhuo.lu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix performance drop |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot success github build: passed
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Wenzhuo Lu April 29, 2021, 1:33 a.m. UTC
  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(-)
  

Comments

Qi Zhang April 29, 2021, 3:20 a.m. UTC | #1
> -----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
  

Patch

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 &&