net/virtio: remove duplicated runtime check

Message ID 20200512131806.33087-1-yong.liu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series net/virtio: remove duplicated runtime check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues

Commit Message

Marvin Liu May 12, 2020, 1:18 p.m. UTC
  Runtime checks for vectorized datapath are organized into device
configuration function. Remove duplicated check in device init
function.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
  

Comments

Maxime Coquelin May 12, 2020, 1:24 p.m. UTC | #1
On 5/12/20 3:18 PM, Marvin Liu wrote:
> Runtime checks for vectorized datapath are organized into device
> configuration function. Remove duplicated check in device init
> function.
> 
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 49ccef12c7..312871cb48 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1965,10 +1965,8 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
>  			PMD_DRV_LOG(INFO,
>  				"building environment do not support packed ring vectorized");
>  #else
> -			if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F)) {
> -				hw->use_vec_rx = 1;
> -				hw->use_vec_tx = 1;
> -			}
> +			hw->use_vec_rx = 1;
> +			hw->use_vec_tx = 1;
>  #endif
>  		}
>  	}
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Maxime Coquelin May 15, 2020, 8:38 a.m. UTC | #2
On 5/12/20 3:18 PM, Marvin Liu wrote:
> Runtime checks for vectorized datapath are organized into device
> configuration function. Remove duplicated check in device init
> function.
> 
> Signed-off-by: Marvin Liu <yong.liu@intel.com>

Applied to dpdk-next-virtio/master.

Thanks,
Maxime
  

Patch

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 49ccef12c7..312871cb48 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1965,10 +1965,8 @@  eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
 			PMD_DRV_LOG(INFO,
 				"building environment do not support packed ring vectorized");
 #else
-			if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F)) {
-				hw->use_vec_rx = 1;
-				hw->use_vec_tx = 1;
-			}
+			hw->use_vec_rx = 1;
+			hw->use_vec_tx = 1;
 #endif
 		}
 	}