[20.11,06/12] net/enic: add checks for max SIMD bitwidth
diff mbox series

Message ID 20200807155859.63888-7-ciara.power@intel.com
State Superseded
Delegated to: David Marchand
Headers show
Series
  • add max SIMD bitwidth to EAL
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Power, Ciara Aug. 7, 2020, 3:58 p.m. UTC
When choosing a vector path to take, an extra condition must be
satisfied to ensure the max SIMD bitwidth allows for the CPU enabled
path.

Cc: John Daley <johndale@cisco.com>
Cc: Hyong Youb Kim <hyonkim@cisco.com>

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 drivers/net/enic/enic_rxtx_vec_avx2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Hyong Youb Kim Aug. 10, 2020, 4:50 a.m. UTC | #1
> -----Original Message-----
> From: Ciara Power <ciara.power@intel.com>
> Sent: Saturday, August 8, 2020 12:59 AM
> To: dev@dpdk.org
> Cc: bruce.richardson@intel.com; Ciara Power <ciara.power@intel.com>;
> John Daley (johndale) <johndale@cisco.com>; Hyong Youb Kim (hyonkim)
> <hyonkim@cisco.com>
> Subject: [PATCH 20.11 06/12] net/enic: add checks for max SIMD bitwidth
> 
> When choosing a vector path to take, an extra condition must be
> satisfied to ensure the max SIMD bitwidth allows for the CPU enabled
> path.
> 
> Cc: John Daley <johndale@cisco.com>
> Cc: Hyong Youb Kim <hyonkim@cisco.com>
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
>  drivers/net/enic/enic_rxtx_vec_avx2.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/enic/enic_rxtx_vec_avx2.c
> b/drivers/net/enic/enic_rxtx_vec_avx2.c
> index 676b9f5fdb..5db43bdbb8 100644
> --- a/drivers/net/enic/enic_rxtx_vec_avx2.c
> +++ b/drivers/net/enic/enic_rxtx_vec_avx2.c
> @@ -821,7 +821,8 @@ enic_use_vector_rx_handler(struct rte_eth_dev
> *eth_dev)
>  	fconf = &eth_dev->data->dev_conf.fdir_conf;
>  	if (fconf->mode != RTE_FDIR_MODE_NONE)
>  		return false;
> -	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2)) {
> +	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) &&
> +			rte_get_max_simd_bitwidth() >=
> RTE_MAX_256_SIMD) {
>  		ENICPMD_LOG(DEBUG, " use the non-scatter avx2 Rx
> handler");
>  		eth_dev->rx_pkt_burst = &enic_noscatter_vec_recv_pkts;
>  		enic->use_noscatter_vec_rx_handler = 1;
> --
> 2.17.1


Acked-by: Hyong Youb Kim <hyonkim@cisco.com>

Thanks..
-Hyong

Patch
diff mbox series

diff --git a/drivers/net/enic/enic_rxtx_vec_avx2.c b/drivers/net/enic/enic_rxtx_vec_avx2.c
index 676b9f5fdb..5db43bdbb8 100644
--- a/drivers/net/enic/enic_rxtx_vec_avx2.c
+++ b/drivers/net/enic/enic_rxtx_vec_avx2.c
@@ -821,7 +821,8 @@  enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev)
 	fconf = &eth_dev->data->dev_conf.fdir_conf;
 	if (fconf->mode != RTE_FDIR_MODE_NONE)
 		return false;
-	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2)) {
+	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) &&
+			rte_get_max_simd_bitwidth() >= RTE_MAX_256_SIMD) {
 		ENICPMD_LOG(DEBUG, " use the non-scatter avx2 Rx handler");
 		eth_dev->rx_pkt_burst = &enic_noscatter_vec_recv_pkts;
 		enic->use_noscatter_vec_rx_handler = 1;