[dpdk-dev] [RFC 3/3] net/virtio: add election for packed vector Rx NEON path
Joyce Kong
joyce.kong at arm.com
Fri Sep 11 14:09:06 CEST 2020
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 at 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(-)
diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst
index 0daf25b22..fe9586699 100644
--- a/doc/guides/nics/virtio.rst
+++ b/doc/guides/nics/virtio.rst
@@ -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,
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index dc0093bdf..b36ea98cf 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -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;
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 6003f6d50..1cfeb388f 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -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");
--
2.28.0
More information about the dev
mailing list