From: Ciara Loftus <ciara.loftus@intel.com>
To: dev@dpdk.org
Cc: Ciara Loftus <ciara.loftus@intel.com>
Subject: [PATCH 06/13] net/i40e: use same Tx path across processes
Date: Tue, 9 Dec 2025 11:26:45 +0000 [thread overview]
Message-ID: <20251209112652.963981-7-ciara.loftus@intel.com> (raw)
In-Reply-To: <20251209112652.963981-1-ciara.loftus@intel.com>
In the interest of simplicity, let the primary process select the Tx
path to be used by all processes using the given device.
The many logs which report individual Tx path selections have been
consolidated into one single log.
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
drivers/net/intel/i40e/i40e_ethdev.h | 11 +++
drivers/net/intel/i40e/i40e_rxtx.c | 118 +++++++++++++++------------
2 files changed, 76 insertions(+), 53 deletions(-)
diff --git a/drivers/net/intel/i40e/i40e_ethdev.h b/drivers/net/intel/i40e/i40e_ethdev.h
index 3fca089d6c..9a89f94f0e 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.h
+++ b/drivers/net/intel/i40e/i40e_ethdev.h
@@ -1243,6 +1243,16 @@ enum i40e_rx_func_type {
I40E_RX_ALTIVEC_SCATTERED,
};
+enum i40e_tx_func_type {
+ I40E_TX_DEFAULT,
+ I40E_TX_SCALAR_SIMPLE,
+ I40E_TX_SSE,
+ I40E_TX_AVX2,
+ I40E_TX_AVX512,
+ I40E_TX_NEON,
+ I40E_TX_ALTIVEC,
+};
+
/*
* Structure to store private data for each PF/VF instance.
*/
@@ -1260,6 +1270,7 @@ struct i40e_adapter {
bool tx_vec_allowed;
enum i40e_rx_func_type rx_func_type;
+ enum i40e_tx_func_type tx_func_type;
uint64_t mbuf_check; /* mbuf check flags. */
uint16_t max_pkt_len; /* Maximum packet length */
diff --git a/drivers/net/intel/i40e/i40e_rxtx.c b/drivers/net/intel/i40e/i40e_rxtx.c
index 255414dd03..04c3a6c311 100644
--- a/drivers/net/intel/i40e/i40e_rxtx.c
+++ b/drivers/net/intel/i40e/i40e_rxtx.c
@@ -3519,6 +3519,46 @@ i40e_set_tx_function_flag(struct rte_eth_dev *dev, struct ci_tx_queue *txq)
txq->queue_id);
}
+static const struct {
+ eth_tx_burst_t pkt_burst;
+ const char *info;
+} i40e_tx_burst_infos[] = {
+ [I40E_TX_DEFAULT] = {
+ .pkt_burst = i40e_xmit_pkts,
+ .info = "Scalar",
+ },
+ [I40E_TX_SCALAR_SIMPLE] = {
+ .pkt_burst = i40e_xmit_pkts_simple,
+ .info = "Scalar Simple",
+ },
+#ifdef RTE_ARCH_X86
+ [I40E_TX_SSE] = {
+ .pkt_burst = i40e_xmit_pkts_vec,
+ .info = "Vector SSE",
+ },
+ [I40E_TX_AVX2] = {
+ .pkt_burst = i40e_xmit_pkts_vec_avx2,
+ .info = "Vector AVX2",
+ },
+#ifdef CC_AVX512_SUPPORT
+ [I40E_TX_AVX512] = {
+ .pkt_burst = i40e_xmit_pkts_vec_avx512,
+ .info = "Vector AVX512",
+ },
+#endif
+#elif defined(RTE_ARCH_ARM64)
+ [I40E_TX_NEON] = {
+ .pkt_burst = i40e_xmit_pkts_vec,
+ .info = "Vector Neon",
+ },
+#elif defined(RTE_ARCH_PPC_64)
+ [I40E_TX_ALTIVEC] = {
+ .pkt_burst = i40e_xmit_pkts_vec,
+ .info = "Vector AltiVec",
+ },
+#endif
+};
+
void __rte_cold
i40e_set_tx_function(struct rte_eth_dev *dev)
{
@@ -3527,19 +3567,20 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
uint64_t mbuf_check = ad->mbuf_check;
int i;
- if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+ /* The primary process selects the tx path for all processes. */
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ goto out;
#ifdef RTE_ARCH_X86
- ad->tx_simd_width = i40e_get_max_simd_bitwidth();
+ ad->tx_simd_width = i40e_get_max_simd_bitwidth();
#endif
- if (ad->tx_vec_allowed) {
- for (i = 0; i < dev->data->nb_tx_queues; i++) {
- struct ci_tx_queue *txq =
- dev->data->tx_queues[i];
+ if (ad->tx_vec_allowed) {
+ for (i = 0; i < dev->data->nb_tx_queues; i++) {
+ struct ci_tx_queue *txq =
+ dev->data->tx_queues[i];
- if (txq && i40e_txq_vec_setup(txq)) {
- ad->tx_vec_allowed = false;
- break;
- }
+ if (txq && i40e_txq_vec_setup(txq)) {
+ ad->tx_vec_allowed = false;
+ break;
}
}
}
@@ -3552,66 +3593,37 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
#ifdef RTE_ARCH_X86
if (ad->tx_simd_width == RTE_VECT_SIMD_512) {
#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;
+ ad->tx_func_type = I40E_TX_AVX512;
#else
- PMD_DRV_LOG(ERR, "Invalid Tx SIMD width reported, defaulting to "
- "using scalar Tx (port %d).",
- dev->data->port_id);
- dev->tx_pkt_burst = i40e_xmit_pkts;
+ ad->tx_func_type = I40E_TX_DEFAULT;
#endif
} else {
- PMD_INIT_LOG(DEBUG, "Using %sVector Tx (port %d).",
- ad->tx_simd_width == RTE_VECT_SIMD_256 ? "avx2 " : "",
- dev->data->port_id);
- dev->tx_pkt_burst = ad->tx_simd_width == RTE_VECT_SIMD_256 ?
- i40e_xmit_pkts_vec_avx2 :
- i40e_xmit_pkts_vec;
+ ad->tx_func_type = ad->tx_simd_width == RTE_VECT_SIMD_256 ?
+ I40E_TX_AVX2 :
+ I40E_TX_SSE;
dev->recycle_tx_mbufs_reuse = i40e_recycle_tx_mbufs_reuse_vec;
}
#else /* RTE_ARCH_X86 */
- PMD_INIT_LOG(DEBUG, "Using Vector Tx (port %d).",
- dev->data->port_id);
- dev->tx_pkt_burst = i40e_xmit_pkts_vec;
+ ad->tx_func_type = I40E_TX_SSE;
dev->recycle_tx_mbufs_reuse = i40e_recycle_tx_mbufs_reuse_vec;
#endif /* RTE_ARCH_X86 */
} else {
- PMD_INIT_LOG(DEBUG, "Simple tx finally be used.");
- dev->tx_pkt_burst = i40e_xmit_pkts_simple;
+ ad->tx_func_type = I40E_TX_SCALAR_SIMPLE;
dev->recycle_tx_mbufs_reuse = i40e_recycle_tx_mbufs_reuse_vec;
}
dev->tx_pkt_prepare = i40e_simple_prep_pkts;
} else {
- PMD_INIT_LOG(DEBUG, "Xmit tx finally be used.");
- dev->tx_pkt_burst = i40e_xmit_pkts;
+ ad->tx_func_type = I40E_TX_DEFAULT;
dev->tx_pkt_prepare = i40e_prep_pkts;
}
- if (mbuf_check) {
- ad->tx_pkt_burst = dev->tx_pkt_burst;
- dev->tx_pkt_burst = i40e_xmit_pkts_check;
- }
-}
+out:
+ dev->tx_pkt_burst = mbuf_check ? i40e_xmit_pkts_check :
+ i40e_tx_burst_infos[ad->tx_func_type].pkt_burst;
-static const struct {
- eth_tx_burst_t pkt_burst;
- const char *info;
-} i40e_tx_burst_infos[] = {
- { 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)
- { i40e_xmit_pkts_vec, "Vector Neon" },
-#elif defined(RTE_ARCH_PPC_64)
- { i40e_xmit_pkts_vec, "Vector AltiVec" },
-#endif
-};
+ PMD_DRV_LOG(NOTICE, "Using %s (port %d).",
+ i40e_tx_burst_infos[ad->tx_func_type].info, dev->data->port_id);
+}
int
i40e_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
--
2.43.0
next prev parent reply other threads:[~2025-12-09 11:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 11:26 [PATCH 00/13] net/intel: tx path selection simplification Ciara Loftus
2025-12-09 11:26 ` [PATCH 01/13] net/intel: introduce infrastructure for Tx path selection Ciara Loftus
2025-12-11 10:25 ` Bruce Richardson
2025-12-09 11:26 ` [PATCH 02/13] net/ice: use same Tx path across processes Ciara Loftus
2025-12-11 11:39 ` Bruce Richardson
2025-12-09 11:26 ` [PATCH 03/13] net/ice: use common Tx path selection infrastructure Ciara Loftus
2025-12-11 11:56 ` Bruce Richardson
2025-12-11 12:02 ` Bruce Richardson
2025-12-09 11:26 ` [PATCH 04/13] net/iavf: use same Tx path across processes Ciara Loftus
2025-12-09 11:26 ` [PATCH 05/13] net/iavf: use common Tx path selection infrastructure Ciara Loftus
2025-12-09 11:26 ` Ciara Loftus [this message]
2025-12-09 11:26 ` [PATCH 07/13] net/i40e: " Ciara Loftus
2025-12-09 11:26 ` [PATCH 08/13] net/idpf: " Ciara Loftus
2025-12-09 11:26 ` [PATCH 09/13] net/cpfl: " Ciara Loftus
2025-12-09 11:26 ` [PATCH 10/13] docs: fix TSO and checksum offload feature status in ice doc Ciara Loftus
2025-12-11 11:58 ` Bruce Richardson
2025-12-09 11:26 ` [PATCH 11/13] docs: fix TSO feature status in iavf driver documentation Ciara Loftus
2025-12-11 11:58 ` Bruce Richardson
2025-12-09 11:26 ` [PATCH 12/13] docs: fix inline crypto feature status in iavf driver doc Ciara Loftus
2025-12-11 11:59 ` Bruce Richardson
2025-12-09 11:26 ` [PATCH 13/13] docs: fix TSO feature status in i40e driver documentation Ciara Loftus
2025-12-11 11:59 ` Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251209112652.963981-7-ciara.loftus@intel.com \
--to=ciara.loftus@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).