From: Zhichao Zeng <zhichaox.zeng@intel.com>
To: dev@dpdk.org
Cc: qi.z.zhang@intel.com, Zhichao Zeng <zhichaox.zeng@intel.com>,
Jingjing Wu <jingjing.wu@intel.com>,
Beilei Xing <beilei.xing@intel.com>,
Bruce Richardson <bruce.richardson@intel.com>,
Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Subject: [PATCH v4 2/3] net/iavf: support Tx LLDP on AVX512
Date: Thu, 21 Dec 2023 15:28:26 +0800 [thread overview]
Message-ID: <20231221072827.1808983-3-zhichaox.zeng@intel.com> (raw)
In-Reply-To: <20231221072827.1808983-1-zhichaox.zeng@intel.com>
This patch adds an avx512 ctx Tx path that supports context descriptor,
filling in the SWTCH_UPLINK bit based on mbuf
dynfield IAVF_TX_LLDP_DYNFIELD to support sending LLDP packet.
Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
drivers/net/iavf/iavf_rxtx.c | 5 +++++
drivers/net/iavf/iavf_rxtx.h | 3 +++
drivers/net/iavf/iavf_rxtx_vec_avx512.c | 19 +++++++++++++++++++
drivers/net/iavf/iavf_rxtx_vec_common.h | 5 +++++
4 files changed, 32 insertions(+)
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 3107102911..000449fe5c 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -4051,6 +4051,11 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
dev->tx_pkt_prepare = iavf_prep_pkts;
PMD_DRV_LOG(DEBUG, "Using AVX512 OFFLOAD Vector Tx (port %d).",
dev->data->port_id);
+ } else if (check_ret == IAVF_VECTOR_CTX_PATH) {
+ dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx512_ctx;
+ dev->tx_pkt_prepare = iavf_prep_pkts;
+ PMD_DRV_LOG(DEBUG, "Using AVX512 CONTEXT Vector Tx (port %d).",
+ dev->data->port_id);
} else {
dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx512_ctx_offload;
dev->tx_pkt_prepare = iavf_prep_pkts;
diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h
index f6954a83c2..f0f928928c 100644
--- a/drivers/net/iavf/iavf_rxtx.h
+++ b/drivers/net/iavf/iavf_rxtx.h
@@ -66,6 +66,7 @@
#define IAVF_VECTOR_PATH 0
#define IAVF_VECTOR_OFFLOAD_PATH 1
#define IAVF_VECTOR_CTX_OFFLOAD_PATH 2
+#define IAVF_VECTOR_CTX_PATH 3
#define DEFAULT_TX_RS_THRESH 32
#define DEFAULT_TX_FREE_THRESH 32
@@ -755,6 +756,8 @@ uint16_t iavf_xmit_pkts_vec_avx512_offload(void *tx_queue,
uint16_t nb_pkts);
uint16_t iavf_xmit_pkts_vec_avx512_ctx_offload(void *tx_queue, struct rte_mbuf **tx_pkts,
uint16_t nb_pkts);
+uint16_t iavf_xmit_pkts_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
int iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq);
uint8_t iavf_proto_xtr_type_to_rxdid(uint8_t xtr_type);
diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/iavf_rxtx_vec_avx512.c
index 7a7df6d258..95fdb26a33 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c
+++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c
@@ -2206,6 +2206,10 @@ ctx_vtx1(volatile struct iavf_tx_desc *txdp, struct rte_mbuf *pkt,
low_ctx_qw |= (uint64_t)pkt->vlan_tci << IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
}
}
+ if (*RTE_MBUF_DYNFIELD(pkt,
+ iavf_tx_lldp_dynfield_offset, uint8_t *) > 0)
+ high_ctx_qw |= IAVF_TX_CTX_DESC_SWTCH_UPLINK
+ << IAVF_TXD_CTX_QW1_CMD_SHIFT;
uint64_t high_data_qw = (IAVF_TX_DESC_DTYPE_DATA |
((uint64_t)flags << IAVF_TXD_QW1_CMD_SHIFT) |
((uint64_t)pkt->data_len << IAVF_TXD_QW1_TX_BUF_SZ_SHIFT));
@@ -2258,6 +2262,10 @@ ctx_vtx(volatile struct iavf_tx_desc *txdp,
(uint64_t)pkt[1]->vlan_tci << IAVF_TXD_QW1_L2TAG1_SHIFT;
}
}
+ if (*RTE_MBUF_DYNFIELD(pkt[1],
+ iavf_tx_lldp_dynfield_offset, uint8_t *) > 0)
+ hi_ctx_qw1 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK
+ << IAVF_TXD_CTX_QW1_CMD_SHIFT;
if (pkt[0]->ol_flags & RTE_MBUF_F_TX_VLAN) {
if (vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2) {
@@ -2270,6 +2278,10 @@ ctx_vtx(volatile struct iavf_tx_desc *txdp,
(uint64_t)pkt[0]->vlan_tci << IAVF_TXD_QW1_L2TAG1_SHIFT;
}
}
+ if (*RTE_MBUF_DYNFIELD(pkt[0],
+ iavf_tx_lldp_dynfield_offset, uint8_t *) > 0)
+ hi_ctx_qw0 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK
+ << IAVF_TXD_CTX_QW1_CMD_SHIFT;
if (offload) {
iavf_txd_enable_offload(pkt[1], &hi_data_qw1);
@@ -2520,3 +2532,10 @@ iavf_xmit_pkts_vec_avx512_ctx_offload(void *tx_queue, struct rte_mbuf **tx_pkts,
{
return iavf_xmit_pkts_vec_avx512_ctx_cmn(tx_queue, tx_pkts, nb_pkts, true);
}
+
+uint16_t
+iavf_xmit_pkts_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts)
+{
+ return iavf_xmit_pkts_vec_avx512_ctx_cmn(tx_queue, tx_pkts, nb_pkts, false);
+}
diff --git a/drivers/net/iavf/iavf_rxtx_vec_common.h b/drivers/net/iavf/iavf_rxtx_vec_common.h
index e18cdc3f11..e4432d1473 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_common.h
+++ b/drivers/net/iavf/iavf_rxtx_vec_common.h
@@ -249,6 +249,11 @@ iavf_tx_vec_queue_default(struct iavf_tx_queue *txq)
if (txq->offloads & IAVF_TX_NO_VECTOR_FLAGS)
return -1;
+ if (rte_mbuf_dynfield_lookup(IAVF_TX_LLDP_DYNFIELD, NULL) > 0) {
+ txq->use_ctx = 1;
+ return IAVF_VECTOR_CTX_PATH;
+ }
+
/**
* Vlan tci needs to be inserted via ctx desc, if the vlan_flag is L2TAG2.
* Tunneling parameters and other fields need be configured in ctx desc
--
2.34.1
next prev parent reply other threads:[~2023-12-21 7:19 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 6:08 [PATCH] net/iavf: support Tx LLDP on scalar and AVX512 Zhichao Zeng
2023-12-14 6:58 ` [PATCH v2 0/3] " Zhichao Zeng
2023-12-14 6:58 ` [PATCH v2 1/3] net/iavf: support Tx LLDP on scalar Zhichao Zeng
2023-12-14 6:58 ` [PATCH v2 2/3] net/iavf: support Tx LLDP on AVX512 Zhichao Zeng
2023-12-14 6:58 ` [PATCH v2 3/3] net/iavf: add Tx LLDP command Zhichao Zeng
2023-12-20 9:32 ` [PATCH v3 0/3] net/iavf: support Tx LLDP on scalar and AVX512 Zhichao Zeng
2023-12-20 9:32 ` [PATCH v3 1/3] net/iavf: support Tx LLDP on scalar Zhichao Zeng
2023-12-21 7:28 ` [PATCH v4 0/3] net/iavf: support Tx LLDP on scalar and AVX512 Zhichao Zeng
2023-12-21 7:28 ` [PATCH v4 1/3] net/iavf: support Tx LLDP on scalar Zhichao Zeng
2023-12-27 4:34 ` Zhang, Qi Z
2023-12-21 7:28 ` Zhichao Zeng [this message]
2023-12-21 7:28 ` [PATCH v4 3/3] net/iavf: add Tx LLDP command Zhichao Zeng
2023-12-25 3:14 ` [PATCH v4 0/3] net/iavf: support Tx LLDP on scalar and AVX512 Zhichao Zeng
2023-12-25 3:14 ` [PATCH v4 1/3] net/iavf: support Tx LLDP on scalar Zhichao Zeng
2023-12-25 3:14 ` [PATCH v4 2/3] net/iavf: support Tx LLDP on AVX512 Zhichao Zeng
2023-12-25 3:14 ` [PATCH v4 3/3] net/iavf: add Tx LLDP command Zhichao Zeng
2023-12-28 3:22 ` [PATCH v5 0/3] net/iavf: support Tx LLDP on scalar and AVX512 Zhichao Zeng
2023-12-28 3:22 ` [PATCH v5 1/3] net/iavf: support Tx LLDP on scalar Zhichao Zeng
2023-12-28 3:22 ` [PATCH v5 2/3] net/iavf: support Tx LLDP on AVX512 Zhichao Zeng
2023-12-28 3:22 ` [PATCH v5 3/3] net/iavf: add Tx LLDP command Zhichao Zeng
2024-01-03 7:47 ` [PATCH v6 0/3] net/iavf: support Tx LLDP on scalar and AVX512 Zhichao Zeng
2024-01-03 7:47 ` [PATCH v6 1/3] net/iavf: support Tx LLDP on scalar Zhichao Zeng
2024-01-03 7:47 ` [PATCH v6 2/3] net/iavf: support Tx LLDP on AVX512 Zhichao Zeng
2024-01-03 7:47 ` [PATCH v6 3/3] net/iavf: add Tx LLDP command Zhichao Zeng
2024-01-04 0:26 ` [PATCH v5 0/3] net/iavf: support Tx LLDP on scalar and AVX512 Zhang, Qi Z
2023-12-20 9:32 ` [PATCH v3 2/3] net/iavf: support Tx LLDP on AVX512 Zhichao Zeng
2023-12-20 9:32 ` [PATCH v3 3/3] net/iavf: add Tx LLDP command Zhichao Zeng
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=20231221072827.1808983-3-zhichaox.zeng@intel.com \
--to=zhichaox.zeng@intel.com \
--cc=beilei.xing@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=konstantin.v.ananyev@yandex.ru \
--cc=qi.z.zhang@intel.com \
/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).