DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: fix AVX512 datapath selection
@ 2020-05-11 14:47 Maxime Coquelin
  2020-05-11 15:11 ` Ferruh Yigit
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Maxime Coquelin @ 2020-05-11 14:47 UTC (permalink / raw)
  To: yong.liu, xiaolong.ye, ferruh.yigit, dev; +Cc: Maxime Coquelin

The AVX512 packed ring datapath selection was only done
at build time, but it should also be checked at runtime
that the CPU supports it.

This patch add a CPU flags check so that non-vectorized
path is selected at runtime if AVX512 is not supported.

Fixes: ccb10995c2ad ("net/virtio: add election for vectorized path")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-05-12 13:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 14:47 [dpdk-dev] [PATCH] net/virtio: fix AVX512 datapath selection Maxime Coquelin
2020-05-11 15:11 ` Ferruh Yigit
2020-05-11 18:48 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
2020-05-11 19:49   ` Maxime Coquelin
2020-05-11 22:21     ` Ferruh Yigit
2020-05-12  3:29     ` Liu, Yong
2020-05-12  8:36       ` Maxime Coquelin
2020-05-12  8:46         ` Liu, Yong
2020-05-12 10:04           ` Maxime Coquelin
2020-05-12 13:19             ` Liu, Yong
2020-05-12  2:27 ` [dpdk-dev] [PATCH] " Liu, Yong
2020-05-12  8:35   ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).