From: Ciara Loftus <ciara.loftus@intel.com>
To: dev@dpdk.org
Cc: Ciara Loftus <ciara.loftus@intel.com>
Subject: [PATCH v3 1/3] net/iavf: support LLDP Tx via mbuf ptype or dynfield
Date: Fri, 17 Apr 2026 10:08:02 +0000 [thread overview]
Message-ID: <20260417100804.1143121-2-ciara.loftus@intel.com> (raw)
In-Reply-To: <20260417100804.1143121-1-ciara.loftus@intel.com>
Previously, the only way to transmit LLDP packets via the iavf PMD
was to register the IAVF_TX_LLDP_DYNFIELD dynamic mbuf field and set
it to a non-zero value on each LLDP mbuf before Tx.
This patch adds an alternative. If the new devarg `enable_ptype_lldp` is
set to 1, and if the mbuf packet type is set to RTE_PTYPE_L2_ETHER_LLDP
then a Tx path with context descriptor support will be selected and any
packets with the LLDP ptype will be transmitted.
The dynamic mbuf field support is still present however it is intended
that it will be removed in a future release, at which point only the
packet type approach will be supported.
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
v3:
* Enable ptype LLDP via new devarg
---
doc/guides/nics/intel_vf.rst | 21 ++++++++++++++++-----
doc/guides/rel_notes/release_26_07.rst | 5 +++++
drivers/net/intel/iavf/iavf.h | 1 +
drivers/net/intel/iavf/iavf_ethdev.c | 15 +++++++++++++++
drivers/net/intel/iavf/iavf_rxtx.c | 2 +-
drivers/net/intel/iavf/iavf_rxtx.h | 9 +++++----
6 files changed, 43 insertions(+), 10 deletions(-)
diff --git a/doc/guides/nics/intel_vf.rst b/doc/guides/nics/intel_vf.rst
index 5fa2ddc9ea..4b65fa50cc 100644
--- a/doc/guides/nics/intel_vf.rst
+++ b/doc/guides/nics/intel_vf.rst
@@ -675,12 +675,14 @@ Inline IPsec Support
Diagnostic Utilities
--------------------
-Register mbuf dynfield to test Tx LLDP
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Tx LLDP Testing
+~~~~~~~~~~~~~~~
-Register an mbuf dynfield ``IAVF_TX_LLDP_DYNFIELD`` on ``dev_start``
-to indicate the need to send LLDP packet.
-This dynfield needs to be set to 1 when preparing packet.
+There are two methods to trigger LLDP packet transmission from the VF.
+
+The first method is to register an mbuf dynfield ``IAVF_TX_LLDP_DYNFIELD`` before
+``dev_start``. This dynfield needs to be set to 1 when preparing an LLDP packet
+intended for transmission.
For ``dpdk-testpmd`` application, it needs to stop and restart Tx port to take effect.
@@ -688,6 +690,15 @@ Usage::
testpmd> set tx lldp on
+An alternative method for transmitting LLDP packets is to set the ``packet_type`` of
+the mbuf to ``RTE_PTYPE_L2_ETHER_LLDP``. This, in conjunction with enabling the
+``enable_ptype_lldp`` devarg will cause such packets to be transmitted::
+
+ -a 0000:xx:xx.x,enable_ptype_lldp=1
+
+When ``enable_ptype_lldp`` is not set (default), ptype-based LLDP detection is
+disabled, but LLDP transmission via the dynamic mbuf field remains available.
+
Limitations or Knowing issues
-----------------------------
diff --git a/doc/guides/rel_notes/release_26_07.rst b/doc/guides/rel_notes/release_26_07.rst
index 060b26ff61..e0b27a554a 100644
--- a/doc/guides/rel_notes/release_26_07.rst
+++ b/doc/guides/rel_notes/release_26_07.rst
@@ -56,6 +56,11 @@ New Features
=======================================================
+* **Updated Intel iavf driver.**
+
+ * Added support for transmitting LLDP packets based on mbuf packet type.
+
+
Removed Items
-------------
diff --git a/drivers/net/intel/iavf/iavf.h b/drivers/net/intel/iavf/iavf.h
index f8008d0fda..ef503a1b64 100644
--- a/drivers/net/intel/iavf/iavf.h
+++ b/drivers/net/intel/iavf/iavf.h
@@ -323,6 +323,7 @@ struct iavf_devargs {
int auto_reconfig;
int no_poll_on_link_down;
uint64_t mbuf_check;
+ int enable_ptype_lldp;
};
struct iavf_security_ctx;
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index 3126d9b644..77e8c6b54b 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -44,9 +44,11 @@
#define IAVF_ENABLE_AUTO_RECONFIG_ARG "auto_reconfig"
#define IAVF_NO_POLL_ON_LINK_DOWN_ARG "no-poll-on-link-down"
#define IAVF_MBUF_CHECK_ARG "mbuf_check"
+#define IAVF_ENABLE_PTYPE_LLDP_ARG "enable_ptype_lldp"
uint64_t iavf_timestamp_dynflag;
int iavf_timestamp_dynfield_offset = -1;
int rte_pmd_iavf_tx_lldp_dynfield_offset = -1;
+bool iavf_ptype_lldp_enabled;
static const char * const iavf_valid_args[] = {
IAVF_PROTO_XTR_ARG,
@@ -56,6 +58,7 @@ static const char * const iavf_valid_args[] = {
IAVF_ENABLE_AUTO_RECONFIG_ARG,
IAVF_NO_POLL_ON_LINK_DOWN_ARG,
IAVF_MBUF_CHECK_ARG,
+ IAVF_ENABLE_PTYPE_LLDP_ARG,
NULL
};
@@ -1016,6 +1019,11 @@ iavf_dev_start(struct rte_eth_dev *dev)
/* Check Tx LLDP dynfield */
rte_pmd_iavf_tx_lldp_dynfield_offset =
rte_mbuf_dynfield_lookup(IAVF_TX_LLDP_DYNFIELD, NULL);
+ if (rte_pmd_iavf_tx_lldp_dynfield_offset > 0)
+ PMD_DRV_LOG(WARNING,
+ "The LLDP Tx dynamic mbuf field will be removed in a future release.");
+ iavf_ptype_lldp_enabled = adapter->devargs.enable_ptype_lldp ||
+ rte_pmd_iavf_tx_lldp_dynfield_offset > 0;
if (iavf_init_queues(dev) != 0) {
PMD_DRV_LOG(ERR, "failed to do Queue init");
@@ -2445,6 +2453,11 @@ static int iavf_parse_devargs(struct rte_eth_dev *dev)
if (ret)
goto bail;
+ ret = rte_kvargs_process(kvlist, IAVF_ENABLE_PTYPE_LLDP_ARG,
+ &parse_bool, &ad->devargs.enable_ptype_lldp);
+ if (ret)
+ goto bail;
+
bail:
rte_kvargs_free(kvlist);
return ret;
@@ -2795,6 +2808,8 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
*/
rte_pmd_iavf_tx_lldp_dynfield_offset =
rte_mbuf_dynfield_lookup(IAVF_TX_LLDP_DYNFIELD, NULL);
+ iavf_ptype_lldp_enabled = adapter->devargs.enable_ptype_lldp ||
+ rte_pmd_iavf_tx_lldp_dynfield_offset > 0;
iavf_set_tx_function(eth_dev);
return 0;
}
diff --git a/drivers/net/intel/iavf/iavf_rxtx.c b/drivers/net/intel/iavf/iavf_rxtx.c
index 4ff6c18dc4..bb62ab07de 100644
--- a/drivers/net/intel/iavf/iavf_rxtx.c
+++ b/drivers/net/intel/iavf/iavf_rxtx.c
@@ -3886,7 +3886,7 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
if (iavf_tx_vec_dev_check(dev) != -1)
req_features.simd_width = iavf_get_max_simd_bitwidth();
- if (rte_pmd_iavf_tx_lldp_dynfield_offset > 0)
+ if (iavf_ptype_lldp_enabled)
req_features.ctx_desc = true;
for (i = 0; i < dev->data->nb_tx_queues; i++) {
diff --git a/drivers/net/intel/iavf/iavf_rxtx.h b/drivers/net/intel/iavf/iavf_rxtx.h
index 80b06518b0..0157c4c37e 100644
--- a/drivers/net/intel/iavf/iavf_rxtx.h
+++ b/drivers/net/intel/iavf/iavf_rxtx.h
@@ -157,14 +157,15 @@
#define IAVF_TX_LLDP_DYNFIELD "intel_pmd_dynfield_tx_lldp"
#define IAVF_CHECK_TX_LLDP(m) \
- ((rte_pmd_iavf_tx_lldp_dynfield_offset > 0) && \
- (*RTE_MBUF_DYNFIELD((m), \
- rte_pmd_iavf_tx_lldp_dynfield_offset, \
- uint8_t *)))
+ (iavf_ptype_lldp_enabled && \
+ (((m)->packet_type & RTE_PTYPE_L2_MASK) == RTE_PTYPE_L2_ETHER_LLDP || \
+ (rte_pmd_iavf_tx_lldp_dynfield_offset > 0 && \
+ *RTE_MBUF_DYNFIELD((m), rte_pmd_iavf_tx_lldp_dynfield_offset, uint8_t *))))
extern uint64_t iavf_timestamp_dynflag;
extern int iavf_timestamp_dynfield_offset;
extern int rte_pmd_iavf_tx_lldp_dynfield_offset;
+extern bool iavf_ptype_lldp_enabled;
typedef void (*iavf_rxd_to_pkt_fields_t)(struct ci_rx_queue *rxq,
struct rte_mbuf *mb,
--
2.43.0
next prev parent reply other threads:[~2026-04-17 10:08 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-09 15:20 [PATCH 0/2] iavf: use ptype for LLDP and add AVX2 ctx paths Ciara Loftus
2026-02-09 15:20 ` [PATCH 1/2] net/iavf: use mbuf packet type instead of dynfield for LLDP Ciara Loftus
2026-02-09 16:10 ` Bruce Richardson
2026-03-06 11:49 ` Loftus, Ciara
2026-02-09 15:20 ` [PATCH 2/2] net/iavf: add AVX2 context descriptor Tx paths Ciara Loftus
2026-03-06 11:52 ` [PATCH v2 0/3] iavf: LLDP ptype and AVX2 ctx paths Ciara Loftus
2026-03-06 11:52 ` [PATCH v2 1/3] net/iavf: support LLDP Tx based on mbuf ptype or dynfield Ciara Loftus
2026-03-06 11:52 ` [PATCH v2 2/3] net/iavf: add AVX2 context descriptor Tx paths Ciara Loftus
2026-03-06 11:52 ` [PATCH v2 3/3] doc: announce change to LLDP packet detection in iavf PMD Ciara Loftus
2026-04-17 10:08 ` [PATCH v3 0/3] iavf: LLDP ptype and AVX2 ctx paths Ciara Loftus
2026-04-17 10:08 ` Ciara Loftus [this message]
2026-04-17 10:57 ` [PATCH v3 1/3] net/iavf: support LLDP Tx via mbuf ptype or dynfield Bruce Richardson
2026-04-22 9:19 ` Loftus, Ciara
2026-04-17 10:08 ` [PATCH v3 2/3] net/iavf: add AVX2 context descriptor Tx paths Ciara Loftus
2026-04-17 10:08 ` [PATCH v3 3/3] doc: announce change to LLDP packet detection in iavf PMD Ciara Loftus
2026-04-17 10:56 ` [PATCH v4 0/3] iavf: LLDP ptype and AVX2 ctx paths Ciara Loftus
2026-04-17 10:56 ` [PATCH v4 1/3] net/iavf: support LLDP Tx via mbuf ptype or dynfield Ciara Loftus
2026-04-17 13:00 ` Bruce Richardson
2026-04-17 10:56 ` [PATCH v4 2/3] net/iavf: add AVX2 context descriptor Tx paths Ciara Loftus
2026-04-17 12:59 ` Bruce Richardson
2026-04-17 10:56 ` [PATCH v4 3/3] doc: announce change to LLDP packet detection in iavf PMD Ciara Loftus
2026-04-22 9:16 ` [PATCH v5 0/3] iavf: LLDP ptype and AVX2 ctx paths Ciara Loftus
2026-04-22 9:16 ` [PATCH v5 1/3] net/iavf: support LLDP Tx via mbuf ptype or dynfield Ciara Loftus
2026-04-22 9:16 ` [PATCH v5 2/3] net/iavf: add AVX2 context descriptor Tx paths Ciara Loftus
2026-04-22 9:16 ` [PATCH v5 3/3] doc: announce change to LLDP packet detection in iavf PMD Ciara Loftus
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=20260417100804.1143121-2-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