Skip to contentSkip to conversation

AVX512 vPMD on i40e

PATCH Superseded Leyi Rong 13 participants 44 messages Dec 15, 2020 – Jul 20

Subsystems (2)
lore
Share & tools
lore

Leyi Rong

author
#0 lore raw

cover AVX512 vPMD on i40e

This patchset aims to support AVX512 vPMD on i40e. And the changes are only target to AVX512 vector path.

Leyi Rong (3):
net/i40e: remove devarg use-latest-supported-vec net/i40e: add AVX512 vector path net/i40e: optimize Tx by using AVX512

 doc/guides/nics/i40e.rst                |    9 -
 drivers/net/i40e/i40e_ethdev.c          |   63 +-
 drivers/net/i40e/i40e_ethdev.h          |    3 -
 drivers/net/i40e/i40e_rxtx.c            |  193 ++--
 drivers/net/i40e/i40e_rxtx.h            |   13 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1130 +++++++++++++++++++++++
 drivers/net/i40e/meson.build            |   24 +
 7 files changed, 1287 insertions(+), 148 deletions(-)
 create mode 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/3 net/i40e: remove devarg use-latest-supported-vec

As eal parameter --force-max-simd-bitwidth is already introduced, to make it more clear when setting rx/tx function, remove devarg use-latest-supported-vec support.

---
 doc/guides/nics/i40e.rst       |   9 ---
 drivers/net/i40e/i40e_ethdev.c |  63 +------------------
 drivers/net/i40e/i40e_ethdev.h |   3 -
 drivers/net/i40e/i40e_rxtx.c   | 107 +++++++++++----------------------
 4 files changed, 35 insertions(+), 147 deletions(-)
doc/guides/nics/i40e.rst +0 -9
index 4e5c4679b8..90fb8a4d6f 100644
@@ -209,15 +209,6 @@ Runtime Config Options
   Currently hot-plugging of representor ports is not supported so all required
   representors must be specified on the creation of the PF.
 
-- ``Use latest supported vector`` (default ``disable``)
-
-  Latest supported vector path may not always get the best perf so vector path was
-  recommended to use only on later platform. But users may want the latest vector path
-  since it can get better perf in some real work loading cases. So ``devargs`` param
-  ``use-latest-supported-vec`` is introduced, for example::
-
-  -a 84:00.0,use-latest-supported-vec=1
-
 - ``Enable validation for VF message`` (default ``not enabled``)
 
   The PF counts messages from each VF. If in any period of seconds the message
drivers/net/i40e/i40e_ethdev.c +1 -62

90 lines not on this page · raw message

drivers/net/i40e/i40e_ethdev.h +0 -3
index 696c5aaf7e..70e6ba610b 100644
@@ -1285,9 +1285,6 @@ struct i40e_adapter {
 	uint64_t flow_types_mask;
 	uint64_t pctypes_mask;
 
-	/* For devargs */
-	uint8_t use_latest_vec;
-
 	/* For RSS reta table update */
 	uint8_t rss_reta_updated;
 };
drivers/net/i40e/i40e_rxtx.c +34 -73

155 lines not on this page · raw message

Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/3 net/i40e: add AVX512 vector path

In reply to Leyi Rong

Add AVX512 support for i40e PMD. This patch adds i40e_rxtx_vec_avx512.c to support i40e AVX512 vPMD.

This patch aims to enable AVX512 on i40e vPMD. Main changes are focus on Rx path compared with AVX2 vPMD.

---
 drivers/net/i40e/i40e_rxtx.c            |  117 ++-
 drivers/net/i40e/i40e_rxtx.h            |    9 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1024 +++++++++++++++++++++++
 drivers/net/i40e/meson.build            |   24 +
 4 files changed, 1148 insertions(+), 26 deletions(-)
 create mode 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
drivers/net/i40e/i40e_rxtx.c +91 -26
index 2910619fa5..8357fb3ef8 100644
@@ -1742,6 +1742,10 @@ i40e_dev_supported_ptypes_get(struct rte_eth_dev *dev)
 	    dev->rx_pkt_burst == i40e_recv_scattered_pkts ||
 	    dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec ||
 	    dev->rx_pkt_burst == i40e_recv_pkts_vec ||
+#ifdef CC_AVX512_SUPPORT
+	    dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx512 ||
+	    dev->rx_pkt_burst == i40e_recv_pkts_vec_avx512 ||
+#endif
 	    dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx2 ||
 	    dev->rx_pkt_burst == i40e_recv_pkts_vec_avx2)
 		return ptypes;
@@ -3102,6 +3106,7 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	uint16_t rx_using_sse, i;
 	bool use_avx2 = false;
+	bool use_avx512 = false;
 	/* In order to allow Vector Rx there are a few configuration
 	 * conditions to be met and Rx Bulk Allocation should be allowed.
 	 */
@@ -3125,9 +3130,19 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 				}
 			}
 
-			if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
-			     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
-					rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
+			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1)
+#ifdef CC_AVX512_SUPPORT
+				use_avx512 = true;
+#else
+				PMD_DRV_LOG(NOTICE,
+					"AVX512 is not supported in build env");
+#endif
+			if (!use_avx512 &&
+			(rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
+			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
 				use_avx2 = true;
 		}
 	}
@@ -3135,21 +3150,41 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 	if (ad->rx_vec_allowed  &&
 			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
 		if (dev->data->scattered_rx) {
-			PMD_INIT_LOG(DEBUG,
-				"Using %sVector Scattered Rx (port %d).",
-				use_avx2 ? "avx2 " : "",
-				dev->data->port_id);
-			dev->rx_pkt_burst = use_avx2 ?
-				i40e_recv_scattered_pkts_vec_avx2 :
-				i40e_recv_scattered_pkts_vec;
+			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
+				PMD_DRV_LOG(NOTICE,
+					"Using AVX512 Vector Scattered Rx (port %d).",
+					dev->data->port_id);
+				dev->rx_pkt_burst =
+					i40e_recv_scattered_pkts_vec_avx512;
+#endif
+			} else {
+				PMD_INIT_LOG(DEBUG,
+					"Using %sVector Scattered Rx (port %d).",
+					use_avx2 ? "avx2 " : "",
+					dev->data->port_id);
+				dev->rx_pkt_burst = use_avx2 ?
+					i40e_recv_scattered_pkts_vec_avx2 :
+					i40e_recv_scattered_pkts_vec;
+			}
 		} else {
-			PMD_INIT_LOG(DEBUG,
-				"Using %sVector Rx (port %d).",
-				use_avx2 ? "avx2 " : "",
-				dev->data->port_id);
-			dev->rx_pkt_burst = use_avx2 ?
-				i40e_recv_pkts_vec_avx2 :
-				i40e_recv_pkts_vec;
+			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
+				PMD_DRV_LOG(NOTICE,
+					"Using AVX512 Vector Rx (port %d).",
+					dev->data->port_id);
+				dev->rx_pkt_burst =
+					i40e_recv_pkts_vec_avx512;
+#endif
+			} else {
+				PMD_INIT_LOG(DEBUG,
+					"Using %sVector Rx (port %d).",
+					use_avx2 ? "avx2 " : "",
+					dev->data->port_id);
+				dev->rx_pkt_burst = use_avx2 ?
+					i40e_recv_pkts_vec_avx2 :
+					i40e_recv_pkts_vec;
+			}
 		}
 	} else if (!dev->data->scattered_rx && ad->rx_bulk_alloc_allowed) {
 		PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are "
@@ -3172,6 +3207,10 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 		rx_using_sse =
 			(dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec ||
 			 dev->rx_pkt_burst == i40e_recv_pkts_vec ||
+#ifdef CC_AVX512_SUPPORT
+			 dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx512 ||
+			 dev->rx_pkt_burst == i40e_recv_pkts_vec_avx512 ||
+#endif
 			 dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx2 ||
 			 dev->rx_pkt_burst == i40e_recv_pkts_vec_avx2);
 
@@ -3192,6 +3231,10 @@ static const struct {
 	{ i40e_recv_pkts_bulk_alloc,         "Scalar Bulk Alloc" },
 	{ i40e_recv_pkts,                    "Scalar" },
 #ifdef RTE_ARCH_X86
+#ifdef CC_AVX512_SUPPORT
+	{ i40e_recv_scattered_pkts_vec_avx512, "Vector AVX512 Scattered" },
+	{ i40e_recv_pkts_vec_avx512,           "Vector AVX512" },
+#endif
 	{ i40e_recv_scattered_pkts_vec_avx2, "Vector AVX2 Scattered" },
 	{ i40e_recv_pkts_vec_avx2,           "Vector AVX2" },
 	{ i40e_recv_scattered_pkts_vec,      "Vector SSE Scattered" },
@@ -3258,6 +3301,7 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	int i;
 	bool use_avx2 = false;
+	bool use_avx512 = false;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		if (ad->tx_vec_allowed) {
@@ -3271,9 +3315,19 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
 				}
 			}
 
-			if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
-			     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
-					rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
+			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1)
+#ifdef CC_AVX512_SUPPORT
+				use_avx512 = true;
+#else
+			PMD_DRV_LOG(NOTICE,
+				"AVX512 is not supported in build env");
+#endif
+			if (!use_avx512 &&
+			(rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
+			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
 				use_avx2 = true;
 		}
 	}
@@ -3281,12 +3335,20 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
 	if (ad->tx_simple_allowed) {
 		if (ad->tx_vec_allowed &&
 				rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
-			PMD_INIT_LOG(DEBUG, "Using %sVector Tx (port %d).",
-				     use_avx2 ? "avx2 " : "",
-				     dev->data->port_id);
-			dev->tx_pkt_burst = use_avx2 ?
-					    i40e_xmit_pkts_vec_avx2 :
-					    i40e_xmit_pkts_vec;
+			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
+				PMD_DRV_LOG(NOTICE, "Using AVX512 Vector Tx (port %d).",
+					    dev->data->port_id);
+				dev->tx_pkt_burst = i40e_xmit_pkts_vec_avx512;
+#endif
+			} else {
+				PMD_INIT_LOG(DEBUG, "Using %sVector Tx (port %d).",
+					     use_avx2 ? "avx2 " : "",
+					     dev->data->port_id);
+				dev->tx_pkt_burst = use_avx2 ?
+						    i40e_xmit_pkts_vec_avx2 :
+						    i40e_xmit_pkts_vec;
+			}
 		} else {
 			PMD_INIT_LOG(DEBUG, "Simple tx finally be used.");
 			dev->tx_pkt_burst = i40e_xmit_pkts_simple;
@@ -3306,6 +3368,9 @@ static const struct {
 	{ i40e_xmit_pkts_simple,   "Scalar Simple" },
 	{ i40e_xmit_pkts,          "Scalar" },
 #ifdef RTE_ARCH_X86
+#ifdef CC_AVX512_SUPPORT
+	{ i40e_xmit_pkts_vec_avx512, "Vector AVX512" },
+#endif
 	{ i40e_xmit_pkts_vec_avx2, "Vector AVX2" },
 	{ i40e_xmit_pkts_vec,      "Vector SSE" },
 #elif defined(RTE_ARCH_ARM64)
drivers/net/i40e/i40e_rxtx.h +9 -0
index 57d7b4160b..2e3e50eb79 100644
@@ -248,6 +248,15 @@ uint16_t i40e_recv_scattered_pkts_vec_avx2(void *rx_queue,
 	struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
 uint16_t i40e_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
 	uint16_t nb_pkts);
+uint16_t i40e_recv_pkts_vec_avx512(void *rx_queue,
+				   struct rte_mbuf **rx_pkts,
+				   uint16_t nb_pkts);
+uint16_t i40e_recv_scattered_pkts_vec_avx512(void *rx_queue,
+					     struct rte_mbuf **rx_pkts,
+					     uint16_t nb_pkts);
+uint16_t i40e_xmit_pkts_vec_avx512(void *tx_queue,
+				   struct rte_mbuf **tx_pkts,
+				   uint16_t nb_pkts);
 
 /* For each value it means, datasheet of hardware can tell more details
  *
drivers/net/i40e/i40e_rxtx_vec_avx512.c new file +1024 -0

1,024 lines not on this page · raw message

drivers/net/i40e/meson.build +24 -0
index bb0c542a30..7e84410a08 100644
@@ -44,6 +44,30 @@ if arch_subdir == 'x86'
 				c_args: [cflags, '-mavx2'])
 		objs += i40e_avx2_lib.extract_objects('i40e_rxtx_vec_avx2.c')
 	endif
+
+	i40e_avx512_cpu_support = (
+		cc.get_define('__AVX512F__', args: machine_args) != '' and
+		cc.get_define('__AVX512BW__', args: machine_args) != '')
+
+	i40e_avx512_cc_support = (
+		not machine_args.contains('-mno-avx512f') and
+		cc.has_argument('-mavx512f') and
+		cc.has_argument('-mavx512bw'))
+
+	if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true
+		cflags += ['-DCC_AVX512_SUPPORT']
+		avx512_args = [cflags, '-mavx512f', '-mavx512bw']
+		if cc.has_argument('-march=skylake-avx512')
+			avx512_args += '-march=skylake-avx512'
+		endif
+		i40e_avx512_lib = static_library('i40e_avx512_lib',
+				'i40e_rxtx_vec_avx512.c',
+				dependencies: [static_rte_ethdev,
+					static_rte_kvargs, static_rte_hash],
+				include_directories: includes,
+				c_args: avx512_args)
+		objs += i40e_avx512_lib.extract_objects('i40e_rxtx_vec_avx512.c')
+	endif
 elif arch_subdir == 'ppc'
        dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
        sources += files('i40e_rxtx_vec_altivec.c')
Signature · 1 line
2.17.1
author
#3 lore raw

PATCH 3/3 net/i40e: optimize Tx by using AVX512

In reply to Leyi Rong

Optimize Tx path by using AVX512 instructions and vectorize the tx free bufs process.

---
 drivers/net/i40e/i40e_rxtx.c            |  19 +++
 drivers/net/i40e/i40e_rxtx.h            |   4 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 146 ++++++++++++++++++++----
 3 files changed, 149 insertions(+), 20 deletions(-)
drivers/net/i40e/i40e_rxtx.c +19 -0
index 8357fb3ef8..96071c55fd 100644
@@ -2508,6 +2508,25 @@ i40e_tx_queue_release_mbufs(struct i40e_tx_queue *txq)
 	 *  vPMD tx will not set sw_ring's mbuf to NULL after free,
 	 *  so need to free remains more carefully.
 	 */
+#ifdef CC_AVX512_SUPPORT
+	if (dev->tx_pkt_burst == i40e_xmit_pkts_vec_avx512) {
+		struct i40e_vec_tx_entry *swr = (void *)txq->sw_ring;
+
+		i = txq->tx_next_dd - txq->tx_rs_thresh + 1;
+		if (txq->tx_tail < i) {
+			for (; i < txq->nb_tx_desc; i++) {
+				rte_pktmbuf_free_seg(swr[i].mbuf);
+				swr[i].mbuf = NULL;
+			}
+			i = 0;
+		}
+		for (; i < txq->tx_tail; i++) {
+			rte_pktmbuf_free_seg(swr[i].mbuf);
+			swr[i].mbuf = NULL;
+		}
+		return;
+	}
+#endif
 	if (dev->tx_pkt_burst == i40e_xmit_pkts_vec_avx2 ||
 			dev->tx_pkt_burst == i40e_xmit_pkts_vec) {
 		i = txq->tx_next_dd - txq->tx_rs_thresh + 1;
drivers/net/i40e/i40e_rxtx.h +4 -0
index 2e3e50eb79..2f55073c97 100644
@@ -129,6 +129,10 @@ struct i40e_tx_entry {
 	uint16_t last_id;
 };
 
+struct i40e_vec_tx_entry {
+	struct rte_mbuf *mbuf;
+};
+
 /*
  * Structure associated with each TX queue.
  */
drivers/net/i40e/i40e_rxtx_vec_avx512.c +126 -20

203 lines not on this page · raw message

Signature · 1 line
2.17.1
author
#4 lore raw

v2 cover AVX512 vPMD on i40e

In reply to Leyi Rong

This patchset aims to support AVX512 vPMD on i40e. And the changes are only target to AVX512 vector path.

---
v2:
- Add return value check on rte_mempool_default_cache().

Leyi Rong (3):
net/i40e: remove devarg use-latest-supported-vec net/i40e: add AVX512 vector path net/i40e: optimize Tx by using AVX512

 doc/guides/nics/i40e.rst                |    9 -
 drivers/net/i40e/i40e_ethdev.c          |   63 +-
 drivers/net/i40e/i40e_ethdev.h          |    3 -
 drivers/net/i40e/i40e_rxtx.c            |  193 ++--
 drivers/net/i40e/i40e_rxtx.h            |   13 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136 +++++++++++++++++++++++
 drivers/net/i40e/meson.build            |   24 +
 7 files changed, 1293 insertions(+), 148 deletions(-)
 create mode 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
Signature · 1 line
2.17.1
author
#5 lore raw

PATCH v2 1/3 net/i40e: remove devarg use-latest-supported-vec

As eal parameter --force-max-simd-bitwidth is already introduced, to make it more clear when setting rx/tx function, remove devarg use-latest-supported-vec support.

---
 doc/guides/nics/i40e.rst       |   9 ---
 drivers/net/i40e/i40e_ethdev.c |  63 +------------------
 drivers/net/i40e/i40e_ethdev.h |   3 -
 drivers/net/i40e/i40e_rxtx.c   | 107 +++++++++++----------------------
 4 files changed, 35 insertions(+), 147 deletions(-)
doc/guides/nics/i40e.rst +0 -9
index 4e5c4679b8..90fb8a4d6f 100644
@@ -209,15 +209,6 @@ Runtime Config Options
   Currently hot-plugging of representor ports is not supported so all required
   representors must be specified on the creation of the PF.
 
-- ``Use latest supported vector`` (default ``disable``)
-
-  Latest supported vector path may not always get the best perf so vector path was
-  recommended to use only on later platform. But users may want the latest vector path
-  since it can get better perf in some real work loading cases. So ``devargs`` param
-  ``use-latest-supported-vec`` is introduced, for example::
-
-  -a 84:00.0,use-latest-supported-vec=1
-
 - ``Enable validation for VF message`` (default ``not enabled``)
 
   The PF counts messages from each VF. If in any period of seconds the message
drivers/net/i40e/i40e_ethdev.c +1 -62

90 lines not on this page · raw message

drivers/net/i40e/i40e_ethdev.h +0 -3
index 696c5aaf7e..70e6ba610b 100644
@@ -1285,9 +1285,6 @@ struct i40e_adapter {
 	uint64_t flow_types_mask;
 	uint64_t pctypes_mask;
 
-	/* For devargs */
-	uint8_t use_latest_vec;
-
 	/* For RSS reta table update */
 	uint8_t rss_reta_updated;
 };
drivers/net/i40e/i40e_rxtx.c +34 -73

155 lines not on this page · raw message

Signature · 1 line
2.17.1
Acked-by on v2 1/3
#6 lore raw

Re: [dpdk-dev] [PATCH v2 1/3] net/i40e: remove devarg use-latest-supported-vec

Quoted 10 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Leyi Rong
Sent: Thursday, January 7, 2021 3:44 PM
To: Zhang, Qi Z <[email protected]>; Richardson, Bruce <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Rong, Leyi <[email protected]>
Subject: [dpdk-dev] [PATCH v2 1/3] net/i40e: remove devarg use-latest- supported-vec

Quoted 5 lines

As eal parameter --force-max-simd-bitwidth is already introduced, to make it more clear when setting rx/tx function, remove devarg use-latest-supported-vec support.

#7 lore raw

Re: [dpdk-dev] [PATCH v2 1/3] net/i40e: remove devarg use-latest-supported-vec

In reply to Leyi Rong
Quoted 5 lines · Leyi Rong

As eal parameter --force-max-simd-bitwidth is already introduced, to make it more clear when setting rx/tx function, remove devarg use-latest-supported-vec support.

<...>

drivers/net/i40e/i40e_rxtx.c i40e_set_rx_function(struct rte_eth_dev *dev) · line 3132

Quoted 10 lines
drivers/net/i40e/i40e_rxtx.c +5 -0
@@ -3154,20 +3124,33 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
  					break;
  				}
  			}
+
+			if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
+			     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
+					rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
+				use_avx2 = true;
  		}

Hi Leyi,

The cpu flags, 'RTE_CPUFLAG_AVX2' & 'RTE_CPUFLAG_AVX512F', are only defined for x86 and causing build error for other architectures.

And what about extracting that logic into a static inline function, this makes code more clean, and in that function other architectures return 'use_avx2' false straightaway and can do the checks only for x86?

author
#8 lore raw

PATCH v2 2/3 net/i40e: add AVX512 vector path

In reply to Leyi Rong

Add AVX512 support for i40e PMD. This patch adds i40e_rxtx_vec_avx512.c to support i40e AVX512 vPMD.

This patch aims to enable AVX512 on i40e vPMD. Main changes are focus on Rx path compared with AVX2 vPMD.

---
 drivers/net/i40e/i40e_rxtx.c            |  117 ++-
 drivers/net/i40e/i40e_rxtx.h            |    9 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1024 +++++++++++++++++++++++
 drivers/net/i40e/meson.build            |   24 +
 4 files changed, 1148 insertions(+), 26 deletions(-)
 create mode 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
drivers/net/i40e/i40e_rxtx.c +91 -26
index 2910619fa5..8357fb3ef8 100644
@@ -1742,6 +1742,10 @@ i40e_dev_supported_ptypes_get(struct rte_eth_dev *dev)
 	    dev->rx_pkt_burst == i40e_recv_scattered_pkts ||
 	    dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec ||
 	    dev->rx_pkt_burst == i40e_recv_pkts_vec ||
+#ifdef CC_AVX512_SUPPORT
+	    dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx512 ||
+	    dev->rx_pkt_burst == i40e_recv_pkts_vec_avx512 ||
+#endif
 	    dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx2 ||
 	    dev->rx_pkt_burst == i40e_recv_pkts_vec_avx2)
 		return ptypes;
@@ -3102,6 +3106,7 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	uint16_t rx_using_sse, i;
 	bool use_avx2 = false;
+	bool use_avx512 = false;
 	/* In order to allow Vector Rx there are a few configuration
 	 * conditions to be met and Rx Bulk Allocation should be allowed.
 	 */
@@ -3125,9 +3130,19 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 				}
 			}
 
-			if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
-			     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
-					rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
+			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1)
+#ifdef CC_AVX512_SUPPORT
+				use_avx512 = true;
+#else
+				PMD_DRV_LOG(NOTICE,
+					"AVX512 is not supported in build env");
+#endif
+			if (!use_avx512 &&
+			(rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
+			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
 				use_avx2 = true;
 		}
 	}
@@ -3135,21 +3150,41 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 	if (ad->rx_vec_allowed  &&
 			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
 		if (dev->data->scattered_rx) {
-			PMD_INIT_LOG(DEBUG,
-				"Using %sVector Scattered Rx (port %d).",
-				use_avx2 ? "avx2 " : "",
-				dev->data->port_id);
-			dev->rx_pkt_burst = use_avx2 ?
-				i40e_recv_scattered_pkts_vec_avx2 :
-				i40e_recv_scattered_pkts_vec;
+			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
+				PMD_DRV_LOG(NOTICE,
+					"Using AVX512 Vector Scattered Rx (port %d).",
+					dev->data->port_id);
+				dev->rx_pkt_burst =
+					i40e_recv_scattered_pkts_vec_avx512;
+#endif
+			} else {
+				PMD_INIT_LOG(DEBUG,
+					"Using %sVector Scattered Rx (port %d).",
+					use_avx2 ? "avx2 " : "",
+					dev->data->port_id);
+				dev->rx_pkt_burst = use_avx2 ?
+					i40e_recv_scattered_pkts_vec_avx2 :
+					i40e_recv_scattered_pkts_vec;
+			}
 		} else {
-			PMD_INIT_LOG(DEBUG,
-				"Using %sVector Rx (port %d).",
-				use_avx2 ? "avx2 " : "",
-				dev->data->port_id);
-			dev->rx_pkt_burst = use_avx2 ?
-				i40e_recv_pkts_vec_avx2 :
-				i40e_recv_pkts_vec;
+			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
+				PMD_DRV_LOG(NOTICE,
+					"Using AVX512 Vector Rx (port %d).",
+					dev->data->port_id);
+				dev->rx_pkt_burst =
+					i40e_recv_pkts_vec_avx512;
+#endif
+			} else {
+				PMD_INIT_LOG(DEBUG,
+					"Using %sVector Rx (port %d).",
+					use_avx2 ? "avx2 " : "",
+					dev->data->port_id);
+				dev->rx_pkt_burst = use_avx2 ?
+					i40e_recv_pkts_vec_avx2 :
+					i40e_recv_pkts_vec;
+			}
 		}
 	} else if (!dev->data->scattered_rx && ad->rx_bulk_alloc_allowed) {
 		PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are "
@@ -3172,6 +3207,10 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 		rx_using_sse =
 			(dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec ||
 			 dev->rx_pkt_burst == i40e_recv_pkts_vec ||
+#ifdef CC_AVX512_SUPPORT
+			 dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx512 ||
+			 dev->rx_pkt_burst == i40e_recv_pkts_vec_avx512 ||
+#endif
 			 dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx2 ||
 			 dev->rx_pkt_burst == i40e_recv_pkts_vec_avx2);
 
@@ -3192,6 +3231,10 @@ static const struct {
 	{ i40e_recv_pkts_bulk_alloc,         "Scalar Bulk Alloc" },
 	{ i40e_recv_pkts,                    "Scalar" },
 #ifdef RTE_ARCH_X86
+#ifdef CC_AVX512_SUPPORT
+	{ i40e_recv_scattered_pkts_vec_avx512, "Vector AVX512 Scattered" },
+	{ i40e_recv_pkts_vec_avx512,           "Vector AVX512" },
+#endif
 	{ i40e_recv_scattered_pkts_vec_avx2, "Vector AVX2 Scattered" },
 	{ i40e_recv_pkts_vec_avx2,           "Vector AVX2" },
 	{ i40e_recv_scattered_pkts_vec,      "Vector SSE Scattered" },
@@ -3258,6 +3301,7 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	int i;
 	bool use_avx2 = false;
+	bool use_avx512 = false;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		if (ad->tx_vec_allowed) {
@@ -3271,9 +3315,19 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
 				}
 			}
 
-			if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
-			     rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
-					rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
+			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1)
+#ifdef CC_AVX512_SUPPORT
+				use_avx512 = true;
+#else
+			PMD_DRV_LOG(NOTICE,
+				"AVX512 is not supported in build env");
+#endif
+			if (!use_avx512 &&
+			(rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
+			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
 				use_avx2 = true;
 		}
 	}
@@ -3281,12 +3335,20 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
 	if (ad->tx_simple_allowed) {
 		if (ad->tx_vec_allowed &&
 				rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
-			PMD_INIT_LOG(DEBUG, "Using %sVector Tx (port %d).",
-				     use_avx2 ? "avx2 " : "",
-				     dev->data->port_id);
-			dev->tx_pkt_burst = use_avx2 ?
-					    i40e_xmit_pkts_vec_avx2 :
-					    i40e_xmit_pkts_vec;
+			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
+				PMD_DRV_LOG(NOTICE, "Using AVX512 Vector Tx (port %d).",
+					    dev->data->port_id);
+				dev->tx_pkt_burst = i40e_xmit_pkts_vec_avx512;
+#endif
+			} else {
+				PMD_INIT_LOG(DEBUG, "Using %sVector Tx (port %d).",
+					     use_avx2 ? "avx2 " : "",
+					     dev->data->port_id);
+				dev->tx_pkt_burst = use_avx2 ?
+						    i40e_xmit_pkts_vec_avx2 :
+						    i40e_xmit_pkts_vec;
+			}
 		} else {
 			PMD_INIT_LOG(DEBUG, "Simple tx finally be used.");
 			dev->tx_pkt_burst = i40e_xmit_pkts_simple;
@@ -3306,6 +3368,9 @@ static const struct {
 	{ i40e_xmit_pkts_simple,   "Scalar Simple" },
 	{ i40e_xmit_pkts,          "Scalar" },
 #ifdef RTE_ARCH_X86
+#ifdef CC_AVX512_SUPPORT
+	{ i40e_xmit_pkts_vec_avx512, "Vector AVX512" },
+#endif
 	{ i40e_xmit_pkts_vec_avx2, "Vector AVX2" },
 	{ i40e_xmit_pkts_vec,      "Vector SSE" },
 #elif defined(RTE_ARCH_ARM64)
drivers/net/i40e/i40e_rxtx.h +9 -0
index 57d7b4160b..2e3e50eb79 100644
@@ -248,6 +248,15 @@ uint16_t i40e_recv_scattered_pkts_vec_avx2(void *rx_queue,
 	struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
 uint16_t i40e_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
 	uint16_t nb_pkts);
+uint16_t i40e_recv_pkts_vec_avx512(void *rx_queue,
+				   struct rte_mbuf **rx_pkts,
+				   uint16_t nb_pkts);
+uint16_t i40e_recv_scattered_pkts_vec_avx512(void *rx_queue,
+					     struct rte_mbuf **rx_pkts,
+					     uint16_t nb_pkts);
+uint16_t i40e_xmit_pkts_vec_avx512(void *tx_queue,
+				   struct rte_mbuf **tx_pkts,
+				   uint16_t nb_pkts);
 
 /* For each value it means, datasheet of hardware can tell more details
  *
drivers/net/i40e/i40e_rxtx_vec_avx512.c new file +1024 -0

1,024 lines not on this page · raw message

drivers/net/i40e/meson.build +24 -0
index bb0c542a30..7e84410a08 100644
@@ -44,6 +44,30 @@ if arch_subdir == 'x86'
 				c_args: [cflags, '-mavx2'])
 		objs += i40e_avx2_lib.extract_objects('i40e_rxtx_vec_avx2.c')
 	endif
+
+	i40e_avx512_cpu_support = (
+		cc.get_define('__AVX512F__', args: machine_args) != '' and
+		cc.get_define('__AVX512BW__', args: machine_args) != '')
+
+	i40e_avx512_cc_support = (
+		not machine_args.contains('-mno-avx512f') and
+		cc.has_argument('-mavx512f') and
+		cc.has_argument('-mavx512bw'))
+
+	if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true
+		cflags += ['-DCC_AVX512_SUPPORT']
+		avx512_args = [cflags, '-mavx512f', '-mavx512bw']
+		if cc.has_argument('-march=skylake-avx512')
+			avx512_args += '-march=skylake-avx512'
+		endif
+		i40e_avx512_lib = static_library('i40e_avx512_lib',
+				'i40e_rxtx_vec_avx512.c',
+				dependencies: [static_rte_ethdev,
+					static_rte_kvargs, static_rte_hash],
+				include_directories: includes,
+				c_args: avx512_args)
+		objs += i40e_avx512_lib.extract_objects('i40e_rxtx_vec_avx512.c')
+	endif
 elif arch_subdir == 'ppc'
        dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
        sources += files('i40e_rxtx_vec_altivec.c')
Signature · 1 line
2.17.1
Acked-by on v2 2/3
#9 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/i40e: add AVX512 vector path

Quoted 8 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Leyi Rong
Sent: Thursday, January 7, 2021 3:44 PM
To: Zhang, Qi Z <[email protected]>; Richardson, Bruce <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Rong, Leyi <[email protected]>
Subject: [dpdk-dev] [PATCH v2 2/3] net/i40e: add AVX512 vector path

Quoted 8 lines

Add AVX512 support for i40e PMD. This patch adds i40e_rxtx_vec_avx512.c to support i40e AVX512 vPMD.

This patch aims to enable AVX512 on i40e vPMD. Main changes are focus on Rx path compared with AVX2 vPMD.

author
#10 lore raw

PATCH v2 3/3 net/i40e: optimize Tx by using AVX512

In reply to Leyi Rong

Optimize Tx path by using AVX512 instructions and vectorize the tx free bufs process.

---
 drivers/net/i40e/i40e_rxtx.c            |  19 +++
 drivers/net/i40e/i40e_rxtx.h            |   4 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 152 ++++++++++++++++++++----
 3 files changed, 155 insertions(+), 20 deletions(-)
drivers/net/i40e/i40e_rxtx.c +19 -0
index 8357fb3ef8..96071c55fd 100644
@@ -2508,6 +2508,25 @@ i40e_tx_queue_release_mbufs(struct i40e_tx_queue *txq)
 	 *  vPMD tx will not set sw_ring's mbuf to NULL after free,
 	 *  so need to free remains more carefully.
 	 */
+#ifdef CC_AVX512_SUPPORT
+	if (dev->tx_pkt_burst == i40e_xmit_pkts_vec_avx512) {
+		struct i40e_vec_tx_entry *swr = (void *)txq->sw_ring;
+
+		i = txq->tx_next_dd - txq->tx_rs_thresh + 1;
+		if (txq->tx_tail < i) {
+			for (; i < txq->nb_tx_desc; i++) {
+				rte_pktmbuf_free_seg(swr[i].mbuf);
+				swr[i].mbuf = NULL;
+			}
+			i = 0;
+		}
+		for (; i < txq->tx_tail; i++) {
+			rte_pktmbuf_free_seg(swr[i].mbuf);
+			swr[i].mbuf = NULL;
+		}
+		return;
+	}
+#endif
 	if (dev->tx_pkt_burst == i40e_xmit_pkts_vec_avx2 ||
 			dev->tx_pkt_burst == i40e_xmit_pkts_vec) {
 		i = txq->tx_next_dd - txq->tx_rs_thresh + 1;
drivers/net/i40e/i40e_rxtx.h +4 -0
index 2e3e50eb79..2f55073c97 100644
@@ -129,6 +129,10 @@ struct i40e_tx_entry {
 	uint16_t last_id;
 };
 
+struct i40e_vec_tx_entry {
+	struct rte_mbuf *mbuf;
+};
+
 /*
  * Structure associated with each TX queue.
  */
drivers/net/i40e/i40e_rxtx_vec_avx512.c +132 -20

209 lines not on this page · raw message

Signature · 1 line
2.17.1
Acked-by on v2 3/3
#11 lore raw

Re: [dpdk-dev] [PATCH v2 3/3] net/i40e: optimize Tx by using AVX512

Quoted 8 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Leyi Rong
Sent: Thursday, January 7, 2021 3:44 PM
To: Zhang, Qi Z <[email protected]>; Richardson, Bruce <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Rong, Leyi <[email protected]>
Subject: [dpdk-dev] [PATCH v2 3/3] net/i40e: optimize Tx by using AVX512

Quoted 5 lines

Optimize Tx path by using AVX512 instructions and vectorize the tx free bufs process.

Applied
#12 lore raw
In reply to Leyi Rong
Quoted 31 lines

-----Original Message-----
From: Rong, Leyi <[email protected]>
Sent: Thursday, January 7, 2021 3:44 PM
To: Zhang, Qi Z <[email protected]>; Richardson, Bruce <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Rong, Leyi <[email protected]>
Subject: [PATCH v2 0/3] AVX512 vPMD on i40e

This patchset aims to support AVX512 vPMD on i40e. And the changes are only target to AVX512 vector path.

---
v2:
- Add return value check on rte_mempool_default_cache().

Leyi Rong (3):
net/i40e: remove devarg use-latest-supported-vec net/i40e: add AVX512 vector path net/i40e: optimize Tx by using AVX512

 doc/guides/nics/i40e.rst                |    9 -
 drivers/net/i40e/i40e_ethdev.c          |   63 +-
 drivers/net/i40e/i40e_ethdev.h          |    3 -
 drivers/net/i40e/i40e_rxtx.c            |  193 ++--
 drivers/net/i40e/i40e_rxtx.h            |   13 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136
+++++++++++++++++++++++
 drivers/net/i40e/meson.build            |   24 +
 7 files changed, 1293 insertions(+), 148 deletions(-)  create mode 100644
Quoted 4 lines

drivers/net/i40e/i40e_rxtx_vec_avx512.c

--
2.17.1

Applied to dpdk-next-net-intel.

Thanks
Qi

author
#13 lore raw

v3 cover AVX512 vPMD on i40e

In reply to Leyi Rong

This patchset aims to support AVX512 vPMD on i40e. And the changes are only target to AVX512 vector path.

---
v3:
- Extract get_avx_supported() to get the proper vector data path to choose.

v2:
- Add return value check on rte_mempool_default_cache().

Leyi Rong (3):
net/i40e: remove devarg use-latest-supported-vec net/i40e: add AVX512 vector path net/i40e: optimize Tx by using AVX512

 doc/guides/nics/i40e.rst                |    9 -
 drivers/net/i40e/i40e_ethdev.c          |   63 +-
 drivers/net/i40e/i40e_ethdev.h          |    3 -
 drivers/net/i40e/i40e_rxtx.c            |  196 ++--
 drivers/net/i40e/i40e_rxtx.h            |   13 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136 +++++++++++++++++++++++
 drivers/net/i40e/meson.build            |   24 +
 7 files changed, 1301 insertions(+), 143 deletions(-)
 create mode 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
Signature · 1 line
2.17.1
author
#14 lore raw

PATCH v3 1/3 net/i40e: remove devarg use-latest-supported-vec

As eal parameter --force-max-simd-bitwidth is already introduced, to make it more clear when setting rx/tx function, remove devarg use-latest-supported-vec support.

---
 doc/guides/nics/i40e.rst       |   9 ---
 drivers/net/i40e/i40e_ethdev.c |  63 +----------------
 drivers/net/i40e/i40e_ethdev.h |   3 -
 drivers/net/i40e/i40e_rxtx.c   | 126 +++++++++++++++------------------
 4 files changed, 58 insertions(+), 143 deletions(-)
doc/guides/nics/i40e.rst +0 -9
index 64f20e7dab..20c998398c 100644
@@ -209,15 +209,6 @@ Runtime Config Options
   Currently hot-plugging of representor ports is not supported so all required
   representors must be specified on the creation of the PF.
 
-- ``Use latest supported vector`` (default ``disable``)
-
-  Latest supported vector path may not always get the best perf so vector path was
-  recommended to use only on later platform. But users may want the latest vector path
-  since it can get better perf in some real work loading cases. So ``devargs`` param
-  ``use-latest-supported-vec`` is introduced, for example::
-
-  -a 84:00.0,use-latest-supported-vec=1
-
 - ``Enable validation for VF message`` (default ``not enabled``)
 
   The PF counts messages from each VF. If in any period of seconds the message
drivers/net/i40e/i40e_ethdev.c +1 -62

90 lines not on this page · raw message

drivers/net/i40e/i40e_ethdev.h +0 -3
index 0617fe5e65..cd484710b0 100644
@@ -1309,9 +1309,6 @@ struct i40e_adapter {
 	uint64_t flow_types_mask;
 	uint64_t pctypes_mask;
 
-	/* For devargs */
-	uint8_t use_latest_vec;
-
 	/* For RSS reta table update */
 	uint8_t rss_reta_updated;
 };
drivers/net/i40e/i40e_rxtx.c +57 -69

178 lines not on this page · raw message

Signature · 1 line
2.17.1
#15 lore raw

Re: [dpdk-dev] [PATCH v3 1/3] net/i40e: remove devarg use-latest-supported-vec

Quoted 6 lines · Leyi Rong

As eal parameter --force-max-simd-bitwidth is already introduced, to make it more clear when setting rx/tx function, remove devarg use-latest-supported-vec support.

<...>

Quoted 35 lines
drivers/net/i40e/i40e_rxtx.c +22 -12
-static eth_rx_burst_t
-i40e_get_recommend_rx_vec(bool scatter)
+static inline bool
+get_avx_supported(bool request_avx512)
  {
-#if defined(RTE_ARCH_X86) && defined(CC_AVX2_SUPPORT)
-	/*
-	 * since AVX frequency can be different to base frequency, limit
-	 * use of AVX2 version to later plaforms, not all those that could
-	 * theoretically run it.
-	 */
-	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) &&
-			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
-		return scatter ? i40e_recv_scattered_pkts_vec_avx2 :
-				 i40e_recv_pkts_vec_avx2;
+#ifdef RTE_ARCH_X86
+	if (request_avx512) {
+		if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
+		rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
+		rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1)
+#ifdef CC_AVX512_SUPPORT
+			return true;
+#else
+		PMD_DRV_LOG(NOTICE,
+			"AVX512 is not supported in build env");
+		return false;
+#endif
+	} else {
+		if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256 &&
+		rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 &&
+		rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1)
+#ifdef CC_AVX2_SUPPORT
+			return true;
+#else
+		PMD_DRV_LOG(NOTICE,

drivers/net/i40e/i40e_rxtx.c i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, · line 3128

Quoted 10 lines
drivers/net/i40e/i40e_rxtx.c +6 -2
+			"AVX2 is not supported in build env");
+		return false;
  #endif
-	return scatter ? i40e_recv_scattered_pkts_vec :
-			 i40e_recv_pkts_vec;
+	}
+#endif /* RTE_ARCH_X86 */
+
+	return false;
  }

This was still causing build error for non x86, becuase of not used 'request_avx512' variable, updated as below in next-net:

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index a4661cdd8377..ce2b0bc12ed9 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3122,6 +3122,8 @@ get_avx_supported(bool request_avx512)

                 return false;
  #endif
         }

+#else
+ RTE_SET_USED(request_avx512);
#endif /* RTE_ARCH_X86 */

         return false;
author
#16 lore raw

PATCH v3 2/3 net/i40e: add AVX512 vector path

In reply to Leyi Rong

Add AVX512 support for i40e PMD. This patch adds i40e_rxtx_vec_avx512.c to support i40e AVX512 vPMD.

This patch aims to enable AVX512 on i40e vPMD. Main changes are focus on Rx path compared with AVX2 vPMD.

---
 drivers/net/i40e/i40e_rxtx.c            |   95 ++-
 drivers/net/i40e/i40e_rxtx.h            |    9 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1024 +++++++++++++++++++++++
 drivers/net/i40e/meson.build            |   24 +
 4 files changed, 1130 insertions(+), 22 deletions(-)
 create mode 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
drivers/net/i40e/i40e_rxtx.c +73 -22
index a4661cdd83..c99c051306 100644
@@ -1742,6 +1742,10 @@ i40e_dev_supported_ptypes_get(struct rte_eth_dev *dev)
 	    dev->rx_pkt_burst == i40e_recv_scattered_pkts ||
 	    dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec ||
 	    dev->rx_pkt_burst == i40e_recv_pkts_vec ||
+#ifdef CC_AVX512_SUPPORT
+	    dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx512 ||
+	    dev->rx_pkt_burst == i40e_recv_pkts_vec_avx512 ||
+#endif
 	    dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx2 ||
 	    dev->rx_pkt_burst == i40e_recv_pkts_vec_avx2)
 		return ptypes;
@@ -3135,6 +3139,7 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	uint16_t rx_using_sse, i;
 	bool use_avx2 = false;
+	bool use_avx512 = false;
 	/* In order to allow Vector Rx there are a few configuration
 	 * conditions to be met and Rx Bulk Allocation should be allowed.
 	 */
@@ -3158,28 +3163,51 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 				}
 			}
 
-			use_avx2 = get_avx_supported(0);
+			use_avx512 = get_avx_supported(1);
+
+			if (!use_avx512)
+				use_avx2 = get_avx_supported(0);
 		}
 	}
 
 	if (ad->rx_vec_allowed  &&
 			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
 		if (dev->data->scattered_rx) {
-			PMD_INIT_LOG(DEBUG,
-				"Using %sVector Scattered Rx (port %d).",
-				use_avx2 ? "avx2 " : "",
-				dev->data->port_id);
-			dev->rx_pkt_burst = use_avx2 ?
-				i40e_recv_scattered_pkts_vec_avx2 :
-				i40e_recv_scattered_pkts_vec;
+			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
+				PMD_DRV_LOG(NOTICE,
+					"Using AVX512 Vector Scattered Rx (port %d).",
+					dev->data->port_id);
+				dev->rx_pkt_burst =
+					i40e_recv_scattered_pkts_vec_avx512;
+#endif
+			} else {
+				PMD_INIT_LOG(DEBUG,
+					"Using %sVector Scattered Rx (port %d).",
+					use_avx2 ? "avx2 " : "",
+					dev->data->port_id);
+				dev->rx_pkt_burst = use_avx2 ?
+					i40e_recv_scattered_pkts_vec_avx2 :
+					i40e_recv_scattered_pkts_vec;
+			}
 		} else {
-			PMD_INIT_LOG(DEBUG,
-				"Using %sVector Rx (port %d).",
-				use_avx2 ? "avx2 " : "",
-				dev->data->port_id);
-			dev->rx_pkt_burst = use_avx2 ?
-				i40e_recv_pkts_vec_avx2 :
-				i40e_recv_pkts_vec;
+			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
+				PMD_DRV_LOG(NOTICE,
+					"Using AVX512 Vector Rx (port %d).",
+					dev->data->port_id);
+				dev->rx_pkt_burst =
+					i40e_recv_pkts_vec_avx512;
+#endif
+			} else {
+				PMD_INIT_LOG(DEBUG,
+					"Using %sVector Rx (port %d).",
+					use_avx2 ? "avx2 " : "",
+					dev->data->port_id);
+				dev->rx_pkt_burst = use_avx2 ?
+					i40e_recv_pkts_vec_avx2 :
+					i40e_recv_pkts_vec;
+			}
 		}
 	} else if (!dev->data->scattered_rx && ad->rx_bulk_alloc_allowed) {
 		PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are "
@@ -3202,6 +3230,10 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 		rx_using_sse =
 			(dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec ||
 			 dev->rx_pkt_burst == i40e_recv_pkts_vec ||
+#ifdef CC_AVX512_SUPPORT
+			 dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx512 ||
+			 dev->rx_pkt_burst == i40e_recv_pkts_vec_avx512 ||
+#endif
 			 dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec_avx2 ||
 			 dev->rx_pkt_burst == i40e_recv_pkts_vec_avx2);
 
@@ -3222,6 +3254,10 @@ static const struct {
 	{ i40e_recv_pkts_bulk_alloc,         "Scalar Bulk Alloc" },
 	{ i40e_recv_pkts,                    "Scalar" },
 #ifdef RTE_ARCH_X86
+#ifdef CC_AVX512_SUPPORT
+	{ i40e_recv_scattered_pkts_vec_avx512, "Vector AVX512 Scattered" },
+	{ i40e_recv_pkts_vec_avx512,           "Vector AVX512" },
+#endif
 	{ i40e_recv_scattered_pkts_vec_avx2, "Vector AVX2 Scattered" },
 	{ i40e_recv_pkts_vec_avx2,           "Vector AVX2" },
 	{ i40e_recv_scattered_pkts_vec,      "Vector SSE Scattered" },
@@ -3288,6 +3324,7 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	int i;
 	bool use_avx2 = false;
+	bool use_avx512 = false;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		if (ad->tx_vec_allowed) {
@@ -3301,19 +3338,30 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
 				}
 			}
 
-			use_avx2 = get_avx_supported(0);
+			use_avx512 = get_avx_supported(1);
+
+			if (!use_avx512)
+				use_avx2 = get_avx_supported(0);
 		}
 	}
 
 	if (ad->tx_simple_allowed) {
 		if (ad->tx_vec_allowed &&
 				rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
-			PMD_INIT_LOG(DEBUG, "Using %sVector Tx (port %d).",
-				     use_avx2 ? "avx2 " : "",
-				     dev->data->port_id);
-			dev->tx_pkt_burst = use_avx2 ?
-					    i40e_xmit_pkts_vec_avx2 :
-					    i40e_xmit_pkts_vec;
+			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
+				PMD_DRV_LOG(NOTICE, "Using AVX512 Vector Tx (port %d).",
+					    dev->data->port_id);
+				dev->tx_pkt_burst = i40e_xmit_pkts_vec_avx512;
+#endif
+			} else {
+				PMD_INIT_LOG(DEBUG, "Using %sVector Tx (port %d).",
+					     use_avx2 ? "avx2 " : "",
+					     dev->data->port_id);
+				dev->tx_pkt_burst = use_avx2 ?
+						    i40e_xmit_pkts_vec_avx2 :
+						    i40e_xmit_pkts_vec;
+			}
 		} else {
 			PMD_INIT_LOG(DEBUG, "Simple tx finally be used.");
 			dev->tx_pkt_burst = i40e_xmit_pkts_simple;
@@ -3333,6 +3381,9 @@ static const struct {
 	{ i40e_xmit_pkts_simple,   "Scalar Simple" },
 	{ i40e_xmit_pkts,          "Scalar" },
 #ifdef RTE_ARCH_X86
+#ifdef CC_AVX512_SUPPORT
+	{ i40e_xmit_pkts_vec_avx512, "Vector AVX512" },
+#endif
 	{ i40e_xmit_pkts_vec_avx2, "Vector AVX2" },
 	{ i40e_xmit_pkts_vec,      "Vector SSE" },
 #elif defined(RTE_ARCH_ARM64)
drivers/net/i40e/i40e_rxtx.h +9 -0
index 57d7b4160b..2e3e50eb79 100644
@@ -248,6 +248,15 @@ uint16_t i40e_recv_scattered_pkts_vec_avx2(void *rx_queue,
 	struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
 uint16_t i40e_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
 	uint16_t nb_pkts);
+uint16_t i40e_recv_pkts_vec_avx512(void *rx_queue,
+				   struct rte_mbuf **rx_pkts,
+				   uint16_t nb_pkts);
+uint16_t i40e_recv_scattered_pkts_vec_avx512(void *rx_queue,
+					     struct rte_mbuf **rx_pkts,
+					     uint16_t nb_pkts);
+uint16_t i40e_xmit_pkts_vec_avx512(void *tx_queue,
+				   struct rte_mbuf **tx_pkts,
+				   uint16_t nb_pkts);
 
 /* For each value it means, datasheet of hardware can tell more details
  *
drivers/net/i40e/i40e_rxtx_vec_avx512.c new file +1024 -0

1,024 lines not on this page · raw message

drivers/net/i40e/meson.build +24 -0
index 882168c256..e4eb925249 100644
@@ -45,6 +45,30 @@ if arch_subdir == 'x86'
 				c_args: [cflags, '-mavx2'])
 		objs += i40e_avx2_lib.extract_objects('i40e_rxtx_vec_avx2.c')
 	endif
+
+	i40e_avx512_cpu_support = (
+		cc.get_define('__AVX512F__', args: machine_args) != '' and
+		cc.get_define('__AVX512BW__', args: machine_args) != '')
+
+	i40e_avx512_cc_support = (
+		not machine_args.contains('-mno-avx512f') and
+		cc.has_argument('-mavx512f') and
+		cc.has_argument('-mavx512bw'))
+
+	if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true
+		cflags += ['-DCC_AVX512_SUPPORT']
+		avx512_args = [cflags, '-mavx512f', '-mavx512bw']
+		if cc.has_argument('-march=skylake-avx512')
+			avx512_args += '-march=skylake-avx512'
+		endif
+		i40e_avx512_lib = static_library('i40e_avx512_lib',
+				'i40e_rxtx_vec_avx512.c',
+				dependencies: [static_rte_ethdev,
+					static_rte_kvargs, static_rte_hash],
+				include_directories: includes,
+				c_args: avx512_args)
+		objs += i40e_avx512_lib.extract_objects('i40e_rxtx_vec_avx512.c')
+	endif
 elif arch_subdir == 'ppc'
        dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
        sources += files('i40e_rxtx_vec_altivec.c')
Signature · 1 line
2.17.1
author
#17 lore raw

PATCH v3 3/3 net/i40e: optimize Tx by using AVX512

In reply to Leyi Rong

Optimize Tx path by using AVX512 instructions and vectorize the tx free bufs process.

---
 drivers/net/i40e/i40e_rxtx.c            |  19 +++
 drivers/net/i40e/i40e_rxtx.h            |   4 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 152 ++++++++++++++++++++----
 3 files changed, 155 insertions(+), 20 deletions(-)
drivers/net/i40e/i40e_rxtx.c +19 -0
index c99c051306..194bc3571f 100644
@@ -2508,6 +2508,25 @@ i40e_tx_queue_release_mbufs(struct i40e_tx_queue *txq)
 	 *  vPMD tx will not set sw_ring's mbuf to NULL after free,
 	 *  so need to free remains more carefully.
 	 */
+#ifdef CC_AVX512_SUPPORT
+	if (dev->tx_pkt_burst == i40e_xmit_pkts_vec_avx512) {
+		struct i40e_vec_tx_entry *swr = (void *)txq->sw_ring;
+
+		i = txq->tx_next_dd - txq->tx_rs_thresh + 1;
+		if (txq->tx_tail < i) {
+			for (; i < txq->nb_tx_desc; i++) {
+				rte_pktmbuf_free_seg(swr[i].mbuf);
+				swr[i].mbuf = NULL;
+			}
+			i = 0;
+		}
+		for (; i < txq->tx_tail; i++) {
+			rte_pktmbuf_free_seg(swr[i].mbuf);
+			swr[i].mbuf = NULL;
+		}
+		return;
+	}
+#endif
 	if (dev->tx_pkt_burst == i40e_xmit_pkts_vec_avx2 ||
 			dev->tx_pkt_burst == i40e_xmit_pkts_vec) {
 		i = txq->tx_next_dd - txq->tx_rs_thresh + 1;
drivers/net/i40e/i40e_rxtx.h +4 -0
index 2e3e50eb79..2f55073c97 100644
@@ -129,6 +129,10 @@ struct i40e_tx_entry {
 	uint16_t last_id;
 };
 
+struct i40e_vec_tx_entry {
+	struct rte_mbuf *mbuf;
+};
+
 /*
  * Structure associated with each TX queue.
  */
drivers/net/i40e/i40e_rxtx_vec_avx512.c +132 -20

209 lines not on this page · raw message

Signature · 1 line
2.17.1
#18 lore raw

AVX512 block copy performance?

Quoted 9 lines

From: dev [mailto:[email protected]] On Behalf Of Leyi Rong
Sent: Thursday, 14 January 2021 07.40

Optimize Tx path by using AVX512 instructions and vectorize the tx free bufs process.

---

[...]

Quoted 58 lines
drivers/net/i40e/i40e_rxtx_vec_avx512.c +24 -0
+static __rte_always_inline int
+i40e_tx_free_bufs_avx512(struct i40e_tx_queue *txq)
+{
+	struct i40e_vec_tx_entry *txep;
+	uint32_t n;
+	uint32_t i;
+	int nb_free = 0;
+	struct rte_mbuf *m, *free[RTE_I40E_TX_MAX_FREE_BUF_SZ];
+
+	/* check DD bits on threshold descriptor */
+	if ((txq->tx_ring[txq->tx_next_dd].cmd_type_offset_bsz &
+			rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) !=
+			rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE))
+		return 0;
+
+	n = txq->tx_rs_thresh;
+
+	 /* first buffer to free from S/W ring is at index
+	  * tx_next_dd - (tx_rs_thresh-1)
+	  */
+	txep = (void *)txq->sw_ring;
+	txep += txq->tx_next_dd - (n - 1);
+
+	if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE && (n & 31) ==

0) {

drivers/net/i40e/i40e_rxtx_vec_avx512.c +3 -0
+		struct rte_mempool *mp = txep[0].mbuf->pool;
+		void **cache_objs;
+		struct rte_mempool_cache *cache =

rte_mempool_default_cache(mp,

drivers/net/i40e/i40e_rxtx_vec_avx512.c +16 -0
+				rte_lcore_id());
+
+		if (!cache || cache->len == 0)
+			goto normal;
+
+		cache_objs = &cache->objs[cache->len];
+
+		if (n > RTE_MEMPOOL_CACHE_MAX_SIZE) {
+			rte_mempool_ops_enqueue_bulk(mp, (void *)txep, n);
+			goto done;
+		}
+
+		/* The cache follows the following algorithm
+		 *   1. Add the objects to the cache
+		 *   2. Anything greater than the cache min value (if it
+		 *   crosses the cache flush threshold) is flushed to the

ring.

drivers/net/i40e/i40e_rxtx_vec_avx512.c +7 -0
+		 */
+		/* Add elements back into the cache */
+		uint32_t copied = 0;
+		/* n is multiple of 32 */
+		while (copied < n) {
+			const __m512i a = _mm512_load_si512(&txep[copied]);
+			const __m512i b = _mm512_load_si512(&txep[copied +

8]);

(quoted diff) +1 -0
+			const __m512i c = _mm512_load_si512(&txep[copied +

16]);

(quoted diff) +1 -0
+			const __m512i d = _mm512_load_si512(&txep[copied +

24]);

drivers/net/i40e/i40e_rxtx_vec_avx512.c i40e_recv_scattered_pkts_vec_avx512(void *rx_queue, · line 934

Quoted 7 lines
drivers/net/i40e/i40e_rxtx_vec_avx512.c +7 -0
+
+			_mm512_storeu_si512(&cache_objs[copied], a);
+			_mm512_storeu_si512(&cache_objs[copied + 8], b);
+			_mm512_storeu_si512(&cache_objs[copied + 16], c);
+			_mm512_storeu_si512(&cache_objs[copied + 24], d);
+			copied += 32;
+		}

Do you have any indications about how this copy loop performs, compared to e.g. the 64-byte block copy in rte_memcpy() [1]?

[1]: https://github.com/DPDK/dpdk/blob/v26.07-rc4/lib/eal/x86/include/rte_memcpy.h#L657

I'm wondering if it would be worth adding something similar to the mempool library, for speeding up mbuf alloc/free.

Quoted 12 lines
drivers/net/i40e/i40e_rxtx_vec_avx512.c +12 -0
+		cache->len += n;
+
+		if (cache->len >= cache->flushthresh) {
+			rte_mempool_ops_enqueue_bulk
+				(mp, &cache->objs[cache->size],
+				cache->len - cache->size);
+			cache->len = cache->size;
+		}
+		goto done;
+	}
+
+normal:
#19 lore raw

Re: AVX512 block copy performance?

Quoted 80 lines · Morten Brørup
Quoted 9 lines

From: dev [mailto:[email protected]] On Behalf Of Leyi Rong
Sent: Thursday, 14 January 2021 07.40

Optimize Tx path by using AVX512 instructions and vectorize the tx free bufs process.

---

[...]

Quoted 58 lines
drivers/net/i40e/i40e_rxtx_vec_avx512.c +24 -0
+static __rte_always_inline int
+i40e_tx_free_bufs_avx512(struct i40e_tx_queue *txq)
+{
+	struct i40e_vec_tx_entry *txep;
+	uint32_t n;
+	uint32_t i;
+	int nb_free = 0;
+	struct rte_mbuf *m, *free[RTE_I40E_TX_MAX_FREE_BUF_SZ];
+
+	/* check DD bits on threshold descriptor */
+	if ((txq->tx_ring[txq->tx_next_dd].cmd_type_offset_bsz &
+			rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) !=
+			rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE))
+		return 0;
+
+	n = txq->tx_rs_thresh;
+
+	 /* first buffer to free from S/W ring is at index
+	  * tx_next_dd - (tx_rs_thresh-1)
+	  */
+	txep = (void *)txq->sw_ring;
+	txep += txq->tx_next_dd - (n - 1);
+
+	if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE && (n & 31) ==

0) {

drivers/net/i40e/i40e_rxtx_vec_avx512.c +3 -0
+		struct rte_mempool *mp = txep[0].mbuf->pool;
+		void **cache_objs;
+		struct rte_mempool_cache *cache =

rte_mempool_default_cache(mp,

drivers/net/i40e/i40e_rxtx_vec_avx512.c +16 -0
+				rte_lcore_id());
+
+		if (!cache || cache->len == 0)
+			goto normal;
+
+		cache_objs = &cache->objs[cache->len];
+
+		if (n > RTE_MEMPOOL_CACHE_MAX_SIZE) {
+			rte_mempool_ops_enqueue_bulk(mp, (void *)txep, n);
+			goto done;
+		}
+
+		/* The cache follows the following algorithm
+		 *   1. Add the objects to the cache
+		 *   2. Anything greater than the cache min value (if it
+		 *   crosses the cache flush threshold) is flushed to the

ring.

drivers/net/i40e/i40e_rxtx_vec_avx512.c +7 -0
+		 */
+		/* Add elements back into the cache */
+		uint32_t copied = 0;
+		/* n is multiple of 32 */
+		while (copied < n) {
+			const __m512i a = _mm512_load_si512(&txep[copied]);
+			const __m512i b = _mm512_load_si512(&txep[copied +

8]);

(quoted diff) +1 -0
+			const __m512i c = _mm512_load_si512(&txep[copied +

16]);

(quoted diff) +1 -0
+			const __m512i d = _mm512_load_si512(&txep[copied +

24]);

drivers/net/i40e/i40e_rxtx_vec_avx512.c i40e_recv_scattered_pkts_vec_avx512(void *rx_queue, · line 934

Quoted 7 lines
drivers/net/i40e/i40e_rxtx_vec_avx512.c +7 -0
+
+			_mm512_storeu_si512(&cache_objs[copied], a);
+			_mm512_storeu_si512(&cache_objs[copied + 8], b);
+			_mm512_storeu_si512(&cache_objs[copied + 16], c);
+			_mm512_storeu_si512(&cache_objs[copied + 24], d);
+			copied += 32;
+		}

Do you have any indications about how this copy loop performs, compared to e.g. the 64-byte block copy in rte_memcpy() [1]?

Quoted 4 lines

[1]: https://github.com/DPDK/dpdk/blob/v26.07-rc4/lib/eal/x86/include/rte_memcpy.h#L657

I'm wondering if it would be worth adding something similar to the mempool library, for speeding up mbuf alloc/free.

Possibly, but you also need to put in an additional checks for AVX-512 at runtime. The reason that we are doing the 64-byte copies explicitly here is that we are already in a function which is already using AVX-512 and for which we have no penalty or branch to check for its presence. The check is done at function pointer selection time for us. For inline copies, you may have a cost for that, though hopefully it could be very minimal. Only way to know is to test it out!

/Bruce

Applied
#20 lore raw
In reply to Leyi Rong
Quoted 35 lines

-----Original Message-----
From: Rong, Leyi <[email protected]>
Sent: Thursday, January 14, 2021 2:40 PM
To: Zhang, Qi Z <[email protected]>; Lu, Wenzhuo <[email protected]>; Yigit, Ferruh <[email protected]>; Richardson, Bruce <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Rong, Leyi <[email protected]>
Subject: [PATCH v3 0/3] AVX512 vPMD on i40e

This patchset aims to support AVX512 vPMD on i40e. And the changes are only target to AVX512 vector path.

---
v3:
- Extract get_avx_supported() to get the proper vector data path to choose.

v2:
- Add return value check on rte_mempool_default_cache().

Leyi Rong (3):
net/i40e: remove devarg use-latest-supported-vec net/i40e: add AVX512 vector path net/i40e: optimize Tx by using AVX512

 doc/guides/nics/i40e.rst                |    9 -
 drivers/net/i40e/i40e_ethdev.c          |   63 +-
 drivers/net/i40e/i40e_ethdev.h          |    3 -
 drivers/net/i40e/i40e_rxtx.c            |  196 ++--
 drivers/net/i40e/i40e_rxtx.h            |   13 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136 +++++++++++++++++++++++
 drivers/net/i40e/meson.build            |   24 +
 7 files changed, 1301 insertions(+), 143 deletions(-)  create mode 100644
Quoted 4 lines

drivers/net/i40e/i40e_rxtx_vec_avx512.c

--
2.17.1

Applied to dpdk-next-net-intel after revert v1.

Thanks
Qi

#21 lore raw
Quoted 30 lines
Quoted 8 lines

Subject: [PATCH v3 0/3] AVX512 vPMD on i40e

This patchset aims to support AVX512 vPMD on i40e. And the changes are only target to AVX512 vector path.

---
v3:
- Extract get_avx_supported() to get the proper vector data path to

choose.

Quoted 10 lines

v2:
- Add return value check on rte_mempool_default_cache().

Leyi Rong (3):
net/i40e: remove devarg use-latest-supported-vec net/i40e: add AVX512 vector path net/i40e: optimize Tx by using AVX512

Quoted 6 lines
 doc/guides/nics/i40e.rst                |    9 -
 drivers/net/i40e/i40e_ethdev.c          |   63 +-
 drivers/net/i40e/i40e_ethdev.h          |    3 -
 drivers/net/i40e/i40e_rxtx.c            |  196 ++--
 drivers/net/i40e/i40e_rxtx.h            |   13 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136

+++++++++++++++++++++++

Quoted 4 lines
 drivers/net/i40e/meson.build            |   24 +
 7 files changed, 1301 insertions(+), 143 deletions(-)  create mode

100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c

Quoted 8 lines
Quoted 2 lines

--
2.17.1

Applied to dpdk-next-net-intel after revert v1.

Thanks
Qi

Hi,
This patch series broke i40e compilation on windows with failure in undefined __m_prefetchw function Please see details in bug: 619 [1].

[1]: https://bugs.dpdk.org/show_bug.cgi?id=619

author
#22 lore raw
Quoted 50 lines

-----Original Message-----
From: Odi Assli <[email protected]>
Sent: Sunday, January 17, 2021 7:26 PM
To: Zhang, Qi Z <[email protected]>; Rong, Leyi <[email protected]>; Lu, Wenzhuo <[email protected]>; Yigit, Ferruh <[email protected]>; Richardson, Bruce <[email protected]>; Xing, Beilei <[email protected]>; Kadam, Pallavi <[email protected]>; Menon, Ranjit <[email protected]>
Cc: [email protected]; Tal Shnaiderman <[email protected]>; NBU-Contact- Thomas Monjalon <[email protected]>; Raslan Darawsheh <[email protected]>; Ali Alnubani <[email protected]>
Subject: RE: [PATCH v3 0/3] AVX512 vPMD on i40e

Quoted 36 lines
Quoted 8 lines

Subject: [PATCH v3 0/3] AVX512 vPMD on i40e

This patchset aims to support AVX512 vPMD on i40e. And the changes are only target to AVX512 vector path.

---
v3:
- Extract get_avx_supported() to get the proper vector data path to

choose.

Quoted 10 lines

v2:
- Add return value check on rte_mempool_default_cache().

Leyi Rong (3):
net/i40e: remove devarg use-latest-supported-vec net/i40e: add AVX512 vector path net/i40e: optimize Tx by using AVX512

Quoted 6 lines
 doc/guides/nics/i40e.rst                |    9 -
 drivers/net/i40e/i40e_ethdev.c          |   63 +-
 drivers/net/i40e/i40e_ethdev.h          |    3 -
 drivers/net/i40e/i40e_rxtx.c            |  196 ++--
 drivers/net/i40e/i40e_rxtx.h            |   13 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136

+++++++++++++++++++++++

Quoted 6 lines
 drivers/net/i40e/meson.build            |   24 +
 7 files changed, 1301 insertions(+), 143 deletions(-)  create mode

100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c

--
2.17.1

Applied to dpdk-next-net-intel after revert v1.

Quoted 9 lines
Quoted 2 lines

Thanks
Qi

Hi,
This patch series broke i40e compilation on windows with failure in undefined __m_prefetchw function Please see details in bug: 619 [1].

[1]: https://bugs.dpdk.org/show_bug.cgi?id=619

Hi Ferruh,

Could you help to squash my fix patch into the patch series? As I've verified it works locally.

Hi Assli,

Could you help to check after Ferruh squashed the fix patch into the next-net?

#23 lore raw
Quoted 60 lines · Leyi
Quoted 50 lines

-----Original Message-----
From: Odi Assli <[email protected]>
Sent: Sunday, January 17, 2021 7:26 PM
To: Zhang, Qi Z <[email protected]>; Rong, Leyi <[email protected]>; Lu, Wenzhuo <[email protected]>; Yigit, Ferruh <[email protected]>; Richardson, Bruce <[email protected]>; Xing, Beilei <[email protected]>; Kadam, Pallavi <[email protected]>; Menon, Ranjit <[email protected]>
Cc: [email protected]; Tal Shnaiderman <[email protected]>; NBU-Contact- Thomas Monjalon <[email protected]>; Raslan Darawsheh <[email protected]>; Ali Alnubani <[email protected]>
Subject: RE: [PATCH v3 0/3] AVX512 vPMD on i40e

Quoted 36 lines
Quoted 8 lines

Subject: [PATCH v3 0/3] AVX512 vPMD on i40e

This patchset aims to support AVX512 vPMD on i40e. And the changes are only target to AVX512 vector path.

---
v3:
- Extract get_avx_supported() to get the proper vector data path to

choose.

Quoted 10 lines

v2:
- Add return value check on rte_mempool_default_cache().

Leyi Rong (3):
net/i40e: remove devarg use-latest-supported-vec net/i40e: add AVX512 vector path net/i40e: optimize Tx by using AVX512

Quoted 6 lines
  doc/guides/nics/i40e.rst                |    9 -
  drivers/net/i40e/i40e_ethdev.c          |   63 +-
  drivers/net/i40e/i40e_ethdev.h          |    3 -
  drivers/net/i40e/i40e_rxtx.c            |  196 ++--
  drivers/net/i40e/i40e_rxtx.h            |   13 +
  drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136

+++++++++++++++++++++++

Quoted 6 lines
  drivers/net/i40e/meson.build            |   24 +
  7 files changed, 1301 insertions(+), 143 deletions(-)  create mode

100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c

--
2.17.1

Applied to dpdk-next-net-intel after revert v1.

Quoted 9 lines
Quoted 2 lines

Thanks
Qi

Hi,
This patch series broke i40e compilation on windows with failure in undefined __m_prefetchw function Please see details in bug: 619 [1].

[1]: https://bugs.dpdk.org/show_bug.cgi?id=619

Quoted 8 lines

Hi Ferruh,

Could you help to squash my fix patch into the patch series? As I've verified it works locally.

Hi Assli,

Could you help to check after Ferruh squashed the fix patch into the next-net?

Hi Assli,

The other-way around is safer perhaps, can you please test with the patch:
https://patches.dpdk.org/patch/86804/

If it is good, I can squash it in the next-net.

Thanks,
ferruh

#24 lore raw
Quoted 107 lines

Subject: Re: [PATCH v3 0/3] AVX512 vPMD on i40e

External email: Use caution opening links or attachments

Quoted 55 lines · Leyi
Quoted 55 lines

-----Original Message-----
From: Odi Assli <[email protected]>
Sent: Sunday, January 17, 2021 7:26 PM
To: Zhang, Qi Z <[email protected]>; Rong, Leyi <[email protected]>; Lu, Wenzhuo <[email protected]>; Yigit, Ferruh <[email protected]>; Richardson, Bruce <[email protected]>; Xing, Beilei <[email protected]>; Kadam, Pallavi <[email protected]>; Menon, Ranjit <[email protected]>
Cc: [email protected]; Tal Shnaiderman <[email protected]>; NBU-Contact- Thomas Monjalon <[email protected]>; Raslan Darawsheh <[email protected]>; Ali Alnubani <[email protected]>
Subject: RE: [PATCH v3 0/3] AVX512 vPMD on i40e

Quoted 39 lines
Quoted 8 lines

Subject: [PATCH v3 0/3] AVX512 vPMD on i40e

This patchset aims to support AVX512 vPMD on i40e. And the changes are only target to AVX512 vector path.

---
v3:
- Extract get_avx_supported() to get the proper vector data path to

choose.

Quoted 10 lines

v2:
- Add return value check on rte_mempool_default_cache().

Leyi Rong (3):
net/i40e: remove devarg use-latest-supported-vec net/i40e: add AVX512 vector path net/i40e: optimize Tx by using AVX512

Quoted 6 lines
  doc/guides/nics/i40e.rst                |    9 -
  drivers/net/i40e/i40e_ethdev.c          |   63 +-
  drivers/net/i40e/i40e_ethdev.h          |    3 -
  drivers/net/i40e/i40e_rxtx.c            |  196 ++--
  drivers/net/i40e/i40e_rxtx.h            |   13 +
  drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136

+++++++++++++++++++++++

Quoted 7 lines
  drivers/net/i40e/meson.build            |   24 +
  7 files changed, 1301 insertions(+), 143 deletions(-)  create

mode
100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c

--
2.17.1

Applied to dpdk-next-net-intel after revert v1.

Thanks
Qi

Quoted 6 lines
Quoted 6 lines

Hi,
This patch series broke i40e compilation on windows with failure in undefined __m_prefetchw function Please see details in bug: 619 [1].

[1]:

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbug

Quoted 1 line
Quoted 1 line

s.dpdk.org%2Fshow_bug.cgi%3Fid%3D619&amp;data=04%7C01%7Codia%40 nvidia

Quoted 1 line
Quoted 1 line

.com%7C4b212e1ae3d045b6264108d8bbbd7703%7C43083d15727340c1b7db3 9efd9c

Quoted 1 line
Quoted 1 line

cc17a%7C0%7C0%7C637465769725929951%7CUnknown%7CTWFpbGZsb3d8e yJWIjoiMC

Quoted 1 line
Quoted 1 line

4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000& amp;s

Quoted 1 line
Quoted 1 line

data=oSmKjG6Za9DCSthbn72YfsQ1JsrUoaVSUCLNt7c5R4o%3D&amp;reserve d=0

Quoted 5 lines
Quoted 1 line

Hi Ferruh,

Could you help to squash my fix patch into the patch series? As I've verified

it works locally.

Quoted 4 lines

Hi Assli,

Could you help to check after Ferruh squashed the fix patch into the next-

net?

Quoted 1 line

Hi Assli,

The other-way around is safer perhaps, can you please test with the patch:
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
hes.dpdk.org%2Fpatch%2F86804%2F&amp;data=04%7C01%7Codia%40nvidia .com%7C4b212e1ae3d045b6264108d8bbbd7703%7C43083d15727340c1b7db3 9efd9ccc17a%7C0%7C0%7C637465769725939943%7CUnknown%7CTWFpbGZs b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn 0%3D%7C1000&amp;sdata=ZQU7m8zNXw%2BKxeG6AcveYp9Dpa4k%2BdeO 2hK5DiBT3lg%3D&amp;reserved=0

Quoted 4 lines

If it is good, I can squash it in the next-net.

Thanks,
ferruh

Hi Guys,

I tested it in my side and it works
Can you please the Bugzilla bug 619?

Regards,
Odi.

#25 lore raw
Quoted 107 lines · Odi Assli
Quoted 107 lines

Subject: Re: [PATCH v3 0/3] AVX512 vPMD on i40e

External email: Use caution opening links or attachments

Quoted 55 lines · Leyi
Quoted 55 lines

-----Original Message-----
From: Odi Assli <[email protected]>
Sent: Sunday, January 17, 2021 7:26 PM
To: Zhang, Qi Z <[email protected]>; Rong, Leyi <[email protected]>; Lu, Wenzhuo <[email protected]>; Yigit, Ferruh <[email protected]>; Richardson, Bruce <[email protected]>; Xing, Beilei <[email protected]>; Kadam, Pallavi <[email protected]>; Menon, Ranjit <[email protected]>
Cc: [email protected]; Tal Shnaiderman <[email protected]>; NBU-Contact- Thomas Monjalon <[email protected]>; Raslan Darawsheh <[email protected]>; Ali Alnubani <[email protected]>
Subject: RE: [PATCH v3 0/3] AVX512 vPMD on i40e

Quoted 39 lines
Quoted 8 lines

Subject: [PATCH v3 0/3] AVX512 vPMD on i40e

This patchset aims to support AVX512 vPMD on i40e. And the changes are only target to AVX512 vector path.

---
v3:
- Extract get_avx_supported() to get the proper vector data path to

choose.

Quoted 10 lines

v2:
- Add return value check on rte_mempool_default_cache().

Leyi Rong (3):
net/i40e: remove devarg use-latest-supported-vec net/i40e: add AVX512 vector path net/i40e: optimize Tx by using AVX512

Quoted 6 lines
   doc/guides/nics/i40e.rst                |    9 -
   drivers/net/i40e/i40e_ethdev.c          |   63 +-
   drivers/net/i40e/i40e_ethdev.h          |    3 -
   drivers/net/i40e/i40e_rxtx.c            |  196 ++--
   drivers/net/i40e/i40e_rxtx.h            |   13 +
   drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136

+++++++++++++++++++++++

Quoted 7 lines
   drivers/net/i40e/meson.build            |   24 +
   7 files changed, 1301 insertions(+), 143 deletions(-)  create

mode
100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c

--
2.17.1

Applied to dpdk-next-net-intel after revert v1.

Thanks
Qi

Quoted 6 lines
Quoted 6 lines

Hi,
This patch series broke i40e compilation on windows with failure in undefined __m_prefetchw function Please see details in bug: 619 [1].

[1]:

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbug

Quoted 1 line
Quoted 1 line

s.dpdk.org%2Fshow_bug.cgi%3Fid%3D619&amp;data=04%7C01%7Codia%40 nvidia

Quoted 1 line
Quoted 1 line

.com%7C4b212e1ae3d045b6264108d8bbbd7703%7C43083d15727340c1b7db3 9efd9c

Quoted 1 line
Quoted 1 line

cc17a%7C0%7C0%7C637465769725929951%7CUnknown%7CTWFpbGZsb3d8e yJWIjoiMC

Quoted 1 line
Quoted 1 line

4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000& amp;s

Quoted 1 line
Quoted 1 line

data=oSmKjG6Za9DCSthbn72YfsQ1JsrUoaVSUCLNt7c5R4o%3D&amp;reserve d=0

Quoted 5 lines
Quoted 1 line

Hi Ferruh,

Could you help to squash my fix patch into the patch series? As I've verified

it works locally.

Quoted 4 lines

Hi Assli,

Could you help to check after Ferruh squashed the fix patch into the next-

net?

Quoted 1 line

Hi Assli,

The other-way around is safer perhaps, can you please test with the patch:
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
hes.dpdk.org%2Fpatch%2F86804%2F&amp;data=04%7C01%7Codia%40nvidia .com%7C4b212e1ae3d045b6264108d8bbbd7703%7C43083d15727340c1b7db3 9efd9ccc17a%7C0%7C0%7C637465769725939943%7CUnknown%7CTWFpbGZs b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn 0%3D%7C1000&amp;sdata=ZQU7m8zNXw%2BKxeG6AcveYp9Dpa4k%2BdeO 2hK5DiBT3lg%3D&amp;reserved=0

Quoted 8 lines
Quoted 4 lines

If it is good, I can squash it in the next-net.

Thanks,
ferruh

Hi Guys,

I tested it in my side and it works

Thanks Assli, Leyi, I will proceed with the patch.

Quoted 2 lines

Can you please the Bugzilla bug 619?

#26 lore raw

Hi,

Quoted 8 lines
Quoted 3 lines

Hi Guys,

I tested it in my side and it works

Thanks Assli, Leyi, I will proceed with the patch.

Quoted 2 lines

Can you please the Bugzilla bug 619?

The patch "add AVX512 vector path" also caused a build failure when cross compiling on Linux using mingw, and it's still reproducing in next-net (517969c95).

```
$ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-mingw -Dexamples=helloworld build  && ninja-build -C build -j32

[221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-21.dll.symbols
[222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-21.dll.symbols
[223/232] Linking target lib/librte_net-21.dll
[224/232] Compiling C object drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
...
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj.d -o drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj -c ../../root/dpdk/drivers/net/i40e/i40e_rxtx_vec_avx512.c
{standard input}: Assembler messages:
{standard input}:112: Error: invalid register for .seh_savexmm
{standard input}:114: Error: invalid register for .seh_savexmm
...
...
{standard input}:25351: Error: invalid register for .seh_savexmm
{standard input}:25352: Error: invalid register for .seh_savexmm
[225/232] Generating symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
ninja: build stopped: subcommand failed.
```

OS: Fedora 32
Meson: 0.55.3
MinGW: Fedora MinGW 9.2.1-6.fc32

- Ali

#27 lore raw
Quoted 42 lines

Subject: RE: [PATCH v3 0/3] AVX512 vPMD on i40e

Hi,

Quoted 8 lines
Quoted 3 lines

Hi Guys,

I tested it in my side and it works

Thanks Assli, Leyi, I will proceed with the patch.

Quoted 2 lines

Can you please the Bugzilla bug 619?

The patch "add AVX512 vector path" also caused a build failure when cross compiling on Linux using mingw, and it's still reproducing in next-net (517969c95).

```
$ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-
mingw -Dexamples=helloworld build  && ninja-build -C build -j32

[221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-
21.dll.symbols
[222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-
21.dll.symbols
[223/232] Linking target lib/librte_net-21.dll [224/232] Compiling C object
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
...
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj.d -o
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj -c
../../root/dpdk/drivers/net/i40e/i40e_rxtx_vec_avx512.c
{standard input}: Assembler messages:
{standard input}:112: Error: invalid register for .seh_savexmm {standard
input}:114: Error: invalid register for .seh_savexmm ...
...
{standard input}:25351: Error: invalid register for .seh_savexmm {standard
input}:25352: Error: invalid register for .seh_savexmm [225/232] Generating
symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
ninja: build stopped: subcommand failed.
```
Quoted 5 lines

OS: Fedora 32
Meson: 0.55.3
MinGW: Fedora MinGW 9.2.1-6.fc32

- Ali

Those errors were detected in the CI tests for this patch [1], we should pay more attention to those now that 2 PMDs are supported on Windows.

[1]: https://lab.dpdk.org/results/dashboard/patchsets/15164/

#28 lore raw
Quoted 33 lines · Tal Shnaiderman
Quoted 33 lines

The patch "add AVX512 vector path" also caused a build failure when cross compiling on Linux using mingw, and it's still reproducing in next-net (517969c95).

```
$ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-
mingw -Dexamples=helloworld build  && ninja-build -C build -j32

[221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-
21.dll.symbols
[222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-
21.dll.symbols
[223/232] Linking target lib/librte_net-21.dll [224/232] Compiling C object
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
...
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj.d -o
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj -c
../../root/dpdk/drivers/net/i40e/i40e_rxtx_vec_avx512.c
{standard input}: Assembler messages:
{standard input}:112: Error: invalid register for .seh_savexmm {standard
input}:114: Error: invalid register for .seh_savexmm ...
...
{standard input}:25351: Error: invalid register for .seh_savexmm {standard
input}:25352: Error: invalid register for .seh_savexmm [225/232] Generating
symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
ninja: build stopped: subcommand failed.
```

OS: Fedora 32
Meson: 0.55.3
MinGW: Fedora MinGW 9.2.1-6.fc32

Quoted 5 lines
Quoted 1 line

- Ali

Those errors were detected in the CI tests for this patch [1], we should pay more attention to those now that 2 PMDs are supported on Windows.

[1]: https://lab.dpdk.org/results/dashboard/patchsets/15164/

I won't grmbl about how CI reports are not being looked at (or maybe I just did :)).

This simple patch seems to work for me:

drivers/net/i40e/meson.build +1 -1
index c0acdf4fd4..c9a1a50407 100644
@@ -54,7 +54,7 @@ if arch_subdir == 'x86'
                cc.has_argument('-mavx512f') and
                cc.has_argument('-mavx512bw'))
 
-       if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true
+       if not is_windows and (i40e_avx512_cpu_support == true or

i40e_avx512_cc_support == true)

                cflags += ['-DCC_AVX512_SUPPORT']
                avx512_args = [cflags, '-mavx512f', '-mavx512bw']
                if cc.has_argument('-march=skylake-avx512')

If nobody has a better fix, I'll send it later.

Signature · 1 line
David Marchand
#29 lore raw
Quoted 34 lines · David Marchand
Quoted 33 lines · Tal Shnaiderman
Quoted 33 lines

The patch "add AVX512 vector path" also caused a build failure when cross compiling on Linux using mingw, and it's still reproducing in next-net (517969c95).

```
$ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-
mingw -Dexamples=helloworld build  && ninja-build -C build -j32

[221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-
21.dll.symbols
[222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-
21.dll.symbols
[223/232] Linking target lib/librte_net-21.dll [224/232] Compiling C object
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
...
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj.d -o
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj -c
../../root/dpdk/drivers/net/i40e/i40e_rxtx_vec_avx512.c
{standard input}: Assembler messages:
{standard input}:112: Error: invalid register for .seh_savexmm {standard
input}:114: Error: invalid register for .seh_savexmm ...
...
{standard input}:25351: Error: invalid register for .seh_savexmm {standard
input}:25352: Error: invalid register for .seh_savexmm [225/232] Generating
symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
ninja: build stopped: subcommand failed.
```

OS: Fedora 32
Meson: 0.55.3
MinGW: Fedora MinGW 9.2.1-6.fc32

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

- Ali

Those errors were detected in the CI tests for this patch [1], we should pay more attention to those now that 2 PMDs are supported on Windows.

[1]: https://lab.dpdk.org/results/dashboard/patchsets/15164/

I won't grmbl about how CI reports are not being looked at (or maybe I just did :)).

Noted and agreed, I will be more careful next time for next-net.

#30 lore raw
In reply to David Marchand

20/01/2021 09:36, David Marchand:

Quoted 61 lines · Tal Shnaiderman
Quoted 33 lines
Quoted 33 lines

The patch "add AVX512 vector path" also caused a build failure when cross compiling on Linux using mingw, and it's still reproducing in next-net (517969c95).

```
$ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-
mingw -Dexamples=helloworld build  && ninja-build -C build -j32

[221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-
21.dll.symbols
[222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-
21.dll.symbols
[223/232] Linking target lib/librte_net-21.dll [224/232] Compiling C object
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
...
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj.d -o
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj -c
../../root/dpdk/drivers/net/i40e/i40e_rxtx_vec_avx512.c
{standard input}: Assembler messages:
{standard input}:112: Error: invalid register for .seh_savexmm {standard
input}:114: Error: invalid register for .seh_savexmm ...
...
{standard input}:25351: Error: invalid register for .seh_savexmm {standard
input}:25352: Error: invalid register for .seh_savexmm [225/232] Generating
symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
ninja: build stopped: subcommand failed.
```

OS: Fedora 32
Meson: 0.55.3
MinGW: Fedora MinGW 9.2.1-6.fc32

Quoted 5 lines
Quoted 1 line

- Ali

Those errors were detected in the CI tests for this patch [1], we should pay more attention to those now that 2 PMDs are supported on Windows.

[1]: https://lab.dpdk.org/results/dashboard/patchsets/15164/

I won't grmbl about how CI reports are not being looked at (or maybe I just did :)).

This simple patch seems to work for me:

drivers/net/i40e/meson.build +1 -1
index c0acdf4fd4..c9a1a50407 100644
@@ -54,7 +54,7 @@ if arch_subdir == 'x86'
                cc.has_argument('-mavx512f') and
                cc.has_argument('-mavx512bw'))
 
-       if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true
+       if not is_windows and (i40e_avx512_cpu_support == true or
 i40e_avx512_cc_support == true)
                cflags += ['-DCC_AVX512_SUPPORT']
                avx512_args = [cflags, '-mavx512f', '-mavx512bw']
                if cc.has_argument('-march=skylake-avx512')
Quoted 1 line

If nobody has a better fix, I'll send it later.

For info, I don't reproduce the compilation issue on my machine.

#31 lore raw
Quoted 63 lines · Thomas Monjalon

20/01/2021 09:36, David Marchand:

Quoted 61 lines · Tal Shnaiderman
Quoted 33 lines
Quoted 33 lines

The patch "add AVX512 vector path" also caused a build failure when cross compiling on Linux using mingw, and it's still reproducing in next-net (517969c95).

```
$ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-
mingw -Dexamples=helloworld build  && ninja-build -C build -j32

[221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-
21.dll.symbols
[222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-
21.dll.symbols
[223/232] Linking target lib/librte_net-21.dll [224/232] Compiling C object
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
...
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj.d -o
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj -c
../../root/dpdk/drivers/net/i40e/i40e_rxtx_vec_avx512.c
{standard input}: Assembler messages:
{standard input}:112: Error: invalid register for .seh_savexmm {standard
input}:114: Error: invalid register for .seh_savexmm ...
...
{standard input}:25351: Error: invalid register for .seh_savexmm {standard
input}:25352: Error: invalid register for .seh_savexmm [225/232] Generating
symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
ninja: build stopped: subcommand failed.
```

OS: Fedora 32
Meson: 0.55.3
MinGW: Fedora MinGW 9.2.1-6.fc32

Quoted 5 lines
Quoted 1 line

- Ali

Those errors were detected in the CI tests for this patch [1], we should pay more attention to those now that 2 PMDs are supported on Windows.

[1]: https://lab.dpdk.org/results/dashboard/patchsets/15164/

I won't grmbl about how CI reports are not being looked at (or maybe I just did :)).

This simple patch seems to work for me:

drivers/net/i40e/meson.build +1 -1
index c0acdf4fd4..c9a1a50407 100644
@@ -54,7 +54,7 @@ if arch_subdir == 'x86'
                cc.has_argument('-mavx512f') and
                cc.has_argument('-mavx512bw'))
 
-       if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true
+       if not is_windows and (i40e_avx512_cpu_support == true or
 i40e_avx512_cc_support == true)
                cflags += ['-DCC_AVX512_SUPPORT']
                avx512_args = [cflags, '-mavx512f', '-mavx512bw']
                if cc.has_argument('-march=skylake-avx512')
Quoted 4 lines
Quoted 1 line

If nobody has a better fix, I'll send it later.

For info, I don't reproduce the compilation issue on my machine.

My build system has been upgraded from fc31 to fc32 so I guess this has something to do with it.

Signature · 1 line
David Marchand
#32 lore raw
Quoted 5 lines
Quoted 1 line

For info, I don't reproduce the compilation issue on my machine.

My build system has been upgraded from fc31 to fc32 so I guess this has something to do with it.

I can reproduce with (Fedora MinGW 9.2.1-6.fc32), but not with (Fedora MinGW 10.2.1-2.fc33).

- Ali

#33 lore raw
Quoted 8 lines · Ali Alnubani
Quoted 5 lines
Quoted 1 line

For info, I don't reproduce the compilation issue on my machine.

My build system has been upgraded from fc31 to fc32 so I guess this has something to do with it.

I can reproduce with (Fedora MinGW 9.2.1-6.fc32), but not with (Fedora MinGW 10.2.1-2.fc33).

First of all, for the patch @Tal provided its link, the windows build and the mingw build errors are different. And the windows build error should be already fixed by a patch that squashed in next-net (https://patches.dpdk.org/patch/86804/).

And for the mingw, I have same result with Ali, I can reproduce with (Fedora MinGW 9.2.1-6.fc32).

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

[1] Error: invalid register for .seh_savexmm

There is a stackoverflow entry for it:
https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin

If I use '-fno-asynchronous-unwind-tables' as suggested there, the build works fine.

So the problem may not be just 'i40e_rxtx_vec_avx512.c'.

If I change the machine type from 'native' to 'corei7' [2], the build error reduced to only 'i40e_rxtx_vec_avx512.c', so the problem seems happens when avx512 is supported by CPU, in this case compiler seems has a defect. And since for 'i40e_rxtx_vec_avx512.c' the '-march=skylake-avx512' explicitly set can cause the problem seen in all machines.

[2]
diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw index 4c15a7fa2e..7cee238add 100644
--- a/config/x86/cross-mingw
+++ b/config/x86/cross-mingw
@@ -9,5 +9,5 @@ pkgconfig = 'x86_64-w64-mingw32-pkg-config'
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
-cpu = 'native'
+cpu = 'corei7'
endian = 'little'

@Ranjit, @Pallavi,
Are you building using mingw, and if so are you observing same problem?

#34 lore raw
Quoted 15 lines · Ferruh Yigit
Quoted 8 lines · Ali Alnubani
Quoted 5 lines
Quoted 1 line

For info, I don't reproduce the compilation issue on my machine.

My build system has been upgraded from fc31 to fc32 so I guess this has something to do with it.

I can reproduce with (Fedora MinGW 9.2.1-6.fc32), but not with (Fedora MinGW 10.2.1-2.fc33).

First of all, for the patch @Tal provided its link, the windows build and the mingw build errors are different. And the windows build error should be already fixed by a patch that squashed in next-net (https://patches.dpdk.org/patch/86804/).

And for the mingw, I have same result with Ali, I can reproduce with (Fedora MinGW 9.2.1-6.fc32).

Quoted 9 lines

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

[1] Error: invalid register for .seh_savexmm

Build log for above errors: https://pastebin.com/jD4jRVzL

Quoted 30 lines

There is a stackoverflow entry for it:
https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin

If I use '-fno-asynchronous-unwind-tables' as suggested there, the build works fine.

So the problem may not be just 'i40e_rxtx_vec_avx512.c'.

If I change the machine type from 'native' to 'corei7' [2], the build error reduced to only 'i40e_rxtx_vec_avx512.c', so the problem seems happens when avx512 is supported by CPU, in this case compiler seems has a defect. And since for 'i40e_rxtx_vec_avx512.c' the '-march=skylake-avx512' explicitly set can cause the problem seen in all machines.

[2]
 diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw index 4c15a7fa2e..7cee238add 100644
 --- a/config/x86/cross-mingw
 +++ b/config/x86/cross-mingw
 @@ -9,5 +9,5 @@ pkgconfig = 'x86_64-w64-mingw32-pkg-config' [host_machine]
  system = 'windows'
  cpu_family = 'x86_64'
 -cpu = 'native'
 +cpu = 'corei7'
  endian = 'little'

@Ranjit, @Pallavi,
Are you building using mingw, and if so are you observing same problem?

#35 lore raw
In reply to Ferruh Yigit
Quoted 52 lines · Ferruh Yigit
Quoted 8 lines · Ali Alnubani
Quoted 5 lines
Quoted 1 line

For info, I don't reproduce the compilation issue on my machine.

My build system has been upgraded from fc31 to fc32 so I guess this has something to do with it.

I can reproduce with (Fedora MinGW 9.2.1-6.fc32), but not with (Fedora MinGW 10.2.1-2.fc33).

First of all, for the patch @Tal provided its link, the windows build and the mingw build errors are different. And the windows build error should be already fixed by a patch that squashed in next-net (https://patches.dpdk.org/patch/86804/).

And for the mingw, I have same result with Ali, I can reproduce with (Fedora MinGW 9.2.1-6.fc32).

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

[1] Error: invalid register for .seh_savexmm

There is a stackoverflow entry for it:
https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin

If I use '-fno-asynchronous-unwind-tables' as suggested there, the build works fine.

So the problem may not be just 'i40e_rxtx_vec_avx512.c'.

If I change the machine type from 'native' to 'corei7' [2], the build error reduced to only 'i40e_rxtx_vec_avx512.c', so the problem seems happens when avx512 is supported by CPU, in this case compiler seems has a defect. And since for 'i40e_rxtx_vec_avx512.c' the '-march=skylake-avx512' explicitly set can cause the problem seen in all machines.

[2]
 diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw index 4c15a7fa2e..7cee238add 100644
 --- a/config/x86/cross-mingw
 +++ b/config/x86/cross-mingw
 @@ -9,5 +9,5 @@ pkgconfig = 'x86_64-w64-mingw32-pkg-config' [host_machine]
  system = 'windows'
  cpu_family = 'x86_64'
 -cpu = 'native'
 +cpu = 'corei7'
  endian = 'little'

Quoted 2 lines

@Ranjit, @Pallavi,
Are you building using mingw, and if so are you observing same problem?

We usually build using Clang. However, we verify with mingw as well before submitting the patch.
As mentioned in the patch [1] comments, we replaced #include x86intrin.h with <rte_vect.h> in the file i40e_rxtx_vec_avx2.c And this helped fixing an error related to conflicting types for '__m_prefethw' with Clang on Windows. I was able to build this patch using Clang as well as mingw.
[1] http://patches.dpdk.org/patch/84770/

I verified patch fix submitted by Rong, Leyi, it builds successfully with Clang.
However, I am getting same error "Error: invalid register for .seh_savexmm" using mingw for 'i40e_rxtx_vec_avx512.c' file.

Thanks,
Pallavi

#36 lore raw
Quoted 38 lines · Pallavi

On 1/20/2021 11:21 PM, Ferruh Yigit wrote:

And for the mingw, I have same result with Ali, I can reproduce with (Fedora MinGW 9.2.1-6.fc32).

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

[1] Error: invalid register for .seh_savexmm

There is a stackoverflow entry for it:
https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin

If I use '-fno-asynchronous-unwind-tables' as suggested there, the build works fine.

So the problem may not be just 'i40e_rxtx_vec_avx512.c'.

If I change the machine type from 'native' to 'corei7' [2], the build error reduced to only 'i40e_rxtx_vec_avx512.c', so the problem seems happens when avx512 is supported by CPU, in this case compiler seems has a defect. And since for 'i40e_rxtx_vec_avx512.c' the '-march=skylake-avx512' explicitly set can cause the problem seen in all machines.

[2]
diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw index 4c15a7fa2e..7cee238add 100644
--- a/config/x86/cross-mingw
+++ b/config/x86/cross-mingw
@@ -9,5 +9,5 @@ pkgconfig = 'x86_64-w64-mingw32-pkg-config'
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
-cpu = 'native'
+cpu = 'corei7'
endian = 'little'

Quoted 3 lines

@Ranjit, @Pallavi,
Are you building using mingw, and if so are you observing same problem?

Thanks Ferruh.

Quoted 8 lines

We usually build using Clang. However, we verify with mingw as well before submitting the patch.
As mentioned in the patch [1] comments, we replaced #include x86intrin.h with <rte_vect.h> in the file i40e_rxtx_vec_avx2.c And this helped fixing an error related to conflicting types for '__m_prefethw' with Clang on Windows. I was able to build this patch using Clang as well as mingw.
[1] http://patches.dpdk.org/patch/84770/

I verified patch fix submitted by Rong, Leyi, it builds successfully with Clang.
However, I am getting same error "Error: invalid register for .seh_savexmm" using mingw for 'i40e_rxtx_vec_avx512.c' file.

The patch I sent https://patchwork.dpdk.org/patch/86999/ is not enough. I have neither time nor environment to find a fix.

For now I simply stopped checking mingw builds.

Will it get fixed?

Signature · 1 line
David Marchand
author
#37 lore raw
Quoted 83 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Monday, January 25, 2021 10:35 PM
To: Kadam, Pallavi <[email protected]>
Cc: Yigit, Ferruh <[email protected]>; Ali Alnubani <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>; Richardson, Bruce <[email protected]>; Tal Shnaiderman <[email protected]>; Odi Assli <[email protected]>; Rong, Leyi <[email protected]>; Zhang, Qi Z <[email protected]>; Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Menon, Ranjit <[email protected]>; [email protected]; Raslan Darawsheh <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3 0/3] AVX512 vPMD on i40e

Quoted 3 lines · Pallavi

On 1/20/2021 11:21 PM, Ferruh Yigit wrote:

And for the mingw, I have same result with Ali, I can reproduce with (Fedora

MinGW 9.2.1-6.fc32).

Quoted 8 lines

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

Quoted 8 lines

[1] Error: invalid register for .seh_savexmm

There is a stackoverflow entry for it:
https://stackoverflow.com/questions/43152633/invalid-register-for-seh-
savexmm-in-cygwin

If I use '-fno-asynchronous-unwind-tables' as suggested there, the build works

fine.

Quoted 5 lines

So the problem may not be just 'i40e_rxtx_vec_avx512.c'.

If I change the machine type from 'native' to 'corei7' [2], the build error

reduced to only 'i40e_rxtx_vec_avx512.c', so the problem seems happens when avx512 is supported by CPU, in this case compiler seems has a defect.

Quoted 1 line

And since for 'i40e_rxtx_vec_avx512.c' the '-march=skylake-avx512' explicitly

set can cause the problem seen in all machines.

Quoted 14 lines

[2]
diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw index
4c15a7fa2e..7cee238add 100644
--- a/config/x86/cross-mingw
+++ b/config/x86/cross-mingw
@@ -9,5 +9,5 @@ pkgconfig = 'x86_64-w64-mingw32-pkg-config'
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
-cpu = 'native'
+cpu = 'corei7'
endian = 'little'

Quoted 3 lines

@Ranjit, @Pallavi,
Are you building using mingw, and if so are you observing same problem?

Thanks Ferruh.

Quoted 1 line

We usually build using Clang. However, we verify with mingw as well before

submitting the patch.

Quoted 2 lines

As mentioned in the patch [1] comments, we replaced #include x86intrin.h with <rte_vect.h> in the file i40e_rxtx_vec_avx2.c And this helped

fixing an error related to conflicting types for '__m_prefethw' with Clang on Windows.

Quoted 5 lines

I was able to build this patch using Clang as well as mingw.
[1] http://patches.dpdk.org/patch/84770/

I verified patch fix submitted by Rong, Leyi, it builds successfully with Clang. However, I am getting same error "Error: invalid register for .seh_savexmm"

using mingw for 'i40e_rxtx_vec_avx512.c' file.

The patch I sent https://patchwork.dpdk.org/patch/86999/ is not enough. I have neither time nor environment to find a fix.

Quoted 7 lines

For now I simply stopped checking mingw builds.

Will it get fixed?

--
David Marchand

Hi,

Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround. Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.

#38 lore raw

26/01/2021 17:17, Rong, Leyi:

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines · Ferruh Yigit

And for the mingw, I have same result with Ali, I can reproduce with (Fedora

MinGW 9.2.1-6.fc32).

Quoted 7 lines

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

[...]

Quoted 2 lines

Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround. Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.

Ferruh mentioned errors with other files outside of i40e.

#39 lore raw
Quoted 12 lines · Thomas Monjalon

26/01/2021 17:17, Rong, Leyi:

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines · Ferruh Yigit

And for the mingw, I have same result with Ali, I can reproduce with (Fedora

MinGW 9.2.1-6.fc32).

Quoted 7 lines

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

Quoted 6 lines

[...]

Quoted 2 lines

Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround. Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.

Ferruh mentioned errors with other files outside of i40e.

The patch globally disables the avx512 for windows cross build, not just for i40e, so I confirm it fixes the build errors in my environment.

But disabling avx512 like this is not best option.

#40 lore raw

26/01/2021 17:39, Ferruh Yigit:

Quoted 17 lines · Thomas Monjalon
Quoted 16 lines

26/01/2021 17:17, Rong, Leyi:

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines · Ferruh Yigit

And for the mingw, I have same result with Ali, I can reproduce with (Fedora

MinGW 9.2.1-6.fc32).

Quoted 7 lines

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

[...]

Quoted 2 lines

Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround. Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.

Quoted 7 lines
Quoted 2 lines

Ferruh mentioned errors with other files outside of i40e.

The patch globally disables the avx512 for windows cross build, not just for i40e, so I confirm it fixes the build errors in my environment.

But disabling avx512 like this is not best option.

Some may argue that AVX512 is not the best option ;)

#41 lore raw
Quoted 21 lines · Thomas Monjalon

26/01/2021 17:39, Ferruh Yigit:

Quoted 20 lines · Thomas Monjalon
Quoted 18 lines

26/01/2021 17:17, Rong, Leyi:

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines · Ferruh Yigit

And for the mingw, I have same result with Ali, I can reproduce with (Fedora

MinGW 9.2.1-6.fc32).

Quoted 7 lines

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

[...]

Quoted 2 lines

Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround. Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.

Ferruh mentioned errors with other files outside of i40e.

Quoted 7 lines
Quoted 4 lines

The patch globally disables the avx512 for windows cross build, not just for i40e, so I confirm it fixes the build errors in my environment.

But disabling avx512 like this is not best option.

Some may argue that AVX512 is not the best option ;)

flame war mode activated.

#42 lore raw
Quoted 25 lines · Ferruh Yigit
Quoted 24 lines · Thomas Monjalon

26/01/2021 17:39, Ferruh Yigit:

Quoted 23 lines · Thomas Monjalon
Quoted 12 lines

26/01/2021 17:17, Rong, Leyi:

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines · Ferruh Yigit

And for the mingw, I have same result with Ali, I can reproduce with (Fedora

MinGW 9.2.1-6.fc32).

Quoted 7 lines

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

Quoted 6 lines

[...]

Quoted 2 lines

Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround. Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.

Ferruh mentioned errors with other files outside of i40e.

The patch globally disables the avx512 for windows cross build, not just for i40e, so I confirm it fixes the build errors in my environment.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

But disabling avx512 like this is not best option.

Some may argue that AVX512 is not the best option ;)

flame war mode activated.

I found the following fix working:

drivers/net/i40e/meson.build +3 -0
@@ -60,6 +60,9 @@ if arch_subdir == 'x86'
 		if cc.has_argument('-march=skylake-avx512')
 			avx512_args += '-march=skylake-avx512'
 		endif
+		if is_windows and cc.get_id() == 'gcc'
+			avx512_args += '-fno-asynchronous-unwind-tables'
+		endif
 		i40e_avx512_lib = static_library('i40e_avx512_lib',
 				'i40e_rxtx_vec_avx512.c',
 				dependencies: [static_rte_ethdev,

It's admittedly from StackOverflow, but after reading about -fno-asynchronous-unwind-tables I see no harm disabling it, at least for just one file.

#43 lore raw

28/01/2021 21:35, Dmitry Kozlyuk:

Quoted 48 lines · Ferruh Yigit
Quoted 25 lines · Thomas Monjalon
Quoted 24 lines

26/01/2021 17:39, Ferruh Yigit:

Quoted 23 lines · Thomas Monjalon
Quoted 12 lines

26/01/2021 17:17, Rong, Leyi:

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines · Ferruh Yigit

And for the mingw, I have same result with Ali, I can reproduce with (Fedora

MinGW 9.2.1-6.fc32).

Quoted 7 lines

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

Quoted 6 lines

[...]

Quoted 2 lines

Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround. Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.

Ferruh mentioned errors with other files outside of i40e.

The patch globally disables the avx512 for windows cross build, not just for i40e, so I confirm it fixes the build errors in my environment.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

But disabling avx512 like this is not best option.

Some may argue that AVX512 is not the best option ;)

flame war mode activated.

I found the following fix working:

drivers/net/i40e/meson.build +3 -0
@@ -60,6 +60,9 @@ if arch_subdir == 'x86'
 		if cc.has_argument('-march=skylake-avx512')
 			avx512_args += '-march=skylake-avx512'
 		endif
+		if is_windows and cc.get_id() == 'gcc'
+			avx512_args += '-fno-asynchronous-unwind-tables'
+		endif
 		i40e_avx512_lib = static_library('i40e_avx512_lib',
 				'i40e_rxtx_vec_avx512.c',
 				dependencies: [static_rte_ethdev,
Quoted 3 lines

It's admittedly from StackOverflow, but after reading about -fno-asynchronous-unwind-tables I see no harm disabling it, at least for just one file.

Thanks, it will require some tests and approvals.
For now, I take the patch proposing a simple disabling of AVX512 with MinGW.