Skip to content

Commit 7566f28

Browse files
ciarapowdavid-marchand
authored andcommitted
net/virtio: check 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. Signed-off-by: Ciara Power <ciara.power@intel.com> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
1 parent 2c5e0dd commit 7566f28

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/net/virtio/virtio_ethdev.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <rte_common.h>
2424
#include <rte_errno.h>
2525
#include <rte_cpuflags.h>
26+
#include <rte_vect.h>
2627

2728
#include <rte_memory.h>
2829
#include <rte_eal.h>
@@ -2312,7 +2313,8 @@ virtio_dev_configure(struct rte_eth_dev *dev)
23122313
if ((hw->use_vec_rx || hw->use_vec_tx) &&
23132314
(!rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) ||
23142315
!vtpci_with_feature(hw, VIRTIO_F_IN_ORDER) ||
2315-
!vtpci_with_feature(hw, VIRTIO_F_VERSION_1))) {
2316+
!vtpci_with_feature(hw, VIRTIO_F_VERSION_1) ||
2317+
rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_512)) {
23162318
PMD_DRV_LOG(INFO,
23172319
"disabled packed ring vectorized path for requirements not met");
23182320
hw->use_vec_rx = 0;
@@ -2365,6 +2367,12 @@ virtio_dev_configure(struct rte_eth_dev *dev)
23652367
"disabled split ring vectorized rx for offloading enabled");
23662368
hw->use_vec_rx = 0;
23672369
}
2370+
2371+
if (rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_128) {
2372+
PMD_DRV_LOG(INFO,
2373+
"disabled split ring vectorized rx, max SIMD bitwidth too low");
2374+
hw->use_vec_rx = 0;
2375+
}
23682376
}
23692377
}
23702378

0 commit comments

Comments
 (0)