[RFC,3/3] net/virtio: add election for packed vector Rx NEON path
Checks
Commit Message
Add NEON vectorized path selection logic. Default setting comes from
vectorized devarg, then checks each criteria.
Packed ring vectorized neon path need:
NEON is supported by compiler and host
VERSION_1 and IN_ORDER features are negotiated
mergeable feature is not negotiated
LRO offloading is disabled
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
---
doc/guides/nics/virtio.rst | 4 ++--
drivers/net/virtio/virtio_ethdev.c | 19 +++++++++++++++----
drivers/net/virtio/virtio_user_ethdev.c | 2 ++
3 files changed, 19 insertions(+), 6 deletions(-)
@@ -483,8 +483,8 @@ according to below configuration:
#. Packed virtqueue in-order non-mergeable path: If in-order feature is negotiated and
Rx mergeable is not negotiated, this path will be selected.
#. Packed virtqueue vectorized Rx path: If building and running environment support
- AVX512 && in-order feature is negotiated && Rx mergeable is not negotiated &&
- TCP_LRO Rx offloading is disabled && vectorized option enabled,
+ (AVX512 || ARCH_ARM || ARCH_ARM64) && in-order feature is negotiated && Rx mergeable
+ is not negotiated && TCP_LRO Rx offloading is disabled && vectorized option enabled,
this path will be selected.
#. Packed virtqueue vectorized Tx path: If building and running environment support
AVX512 && in-order feature is negotiated && vectorized option enabled,
@@ -1958,12 +1958,14 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
if (!vtpci_packed_queue(hw)) {
hw->use_vec_rx = 1;
} else {
-#if !defined(CC_AVX512_SUPPORT)
- PMD_DRV_LOG(INFO,
- "building environment do not support packed ring vectorized");
-#else
+#if defined(CC_AVX512_SUPPORT)
hw->use_vec_rx = 1;
hw->use_vec_tx = 1;
+#elif defined(RTE_ARCH_ARM) || defined(RTE_ARCH_ARM64)
+ hw->use_vec_rx = 1;
+#else
+ PMD_DRV_LOG(INFO,
+ "building environment do not support packed ring vectorized");
#endif
}
}
@@ -2311,6 +2313,15 @@ virtio_dev_configure(struct rte_eth_dev *dev)
hw->use_vec_rx = 0;
hw->use_vec_tx = 0;
}
+#elif defined(RTE_ARCH_ARM) || defined(RTE_ARCH_ARM64)
+ if (hw->use_vec_rx &&
+ (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_NEON) ||
+ !vtpci_with_feature(hw, VIRTIO_F_IN_ORDER) ||
+ !vtpci_with_feature(hw, VIRTIO_F_VERSION_1))) {
+ PMD_DRV_LOG(INFO,
+ "disabled packed ring vectorized path for requirements not met");
+ hw->use_vec_rx = 0;
+ }
#else
hw->use_vec_rx = 0;
hw->use_vec_tx = 0;
@@ -766,6 +766,8 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
#if defined(CC_AVX512_SUPPORT)
hw->use_vec_rx = 1;
hw->use_vec_tx = 1;
+#elif defined(RTE_ARCH_ARM) || defined(RTE_ARCH_ARM64)
+ hw->use_vec_rx = 1;
#else
PMD_INIT_LOG(INFO,
"building environment do not support packed ring vectorized");