[PATCH v2 1/3] net/iavf: support LLDP Tx based on mbuf ptype or dynfield
Ciara Loftus
ciara.loftus at intel.com
Fri Mar 6 12:52:12 CET 2026
Prior to this commit the only way to flag to the iavf PMD that an mbuf
contained an LLDP packet intended for transmission was to register and
set a dynamic mbuf field. This commit introduces an alternative
approach: rather than setting the dynamic mbuf field, the user may
instead set the packet type of the mbuf to RTE_PTYPE_L2_ETHER_LLDP. If
the LLDP feature is enabled (ie. if the dynamic mbuf field is
registered), on Tx the driver will check both the dynamic mbuf field and
the packet type, and if either indicates that the packet is an LLDP
packet, it will be transmitted.
Using the packet type to identify an LLDP packet instead of the dynamic
mbuf field is preferred because the use of dynamic mbuf fields should be
reserved for features that are not easily implemented using the existing
mbuf infrastructure. Also, it may remove some overhead in the
application if the Rx driver sets the packet type to LLDP as that would
remove the burden from the application to explicitly set any fields
before Tx. It is intended that the dynamic mbuf field approach will be
removed in a future release, at which point only the packet type
approach will be supported. A deprecation notice announcing this
intention will be submitted separately.
Signed-off-by: Ciara Loftus <ciara.loftus at intel.com>
---
v2:
* Support both dynfield and ptype methods to preserve ABI
---
doc/guides/nics/intel_vf.rst | 6 ++++++
doc/guides/rel_notes/release_26_03.rst | 1 +
drivers/net/intel/iavf/iavf_rxtx.h | 5 ++---
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/doc/guides/nics/intel_vf.rst b/doc/guides/nics/intel_vf.rst
index bc600e4b58..ad25389521 100644
--- a/doc/guides/nics/intel_vf.rst
+++ b/doc/guides/nics/intel_vf.rst
@@ -681,6 +681,12 @@ Usage::
testpmd> set tx lldp on
+An alternative method for transmitting LLDP packets is to register the dynamic field as
+above and, rather than setting the dynfield value, set the ``packet_type`` of the mbuf to
+``RTE_PTYPE_L2_ETHER_LLDP``. The driver will check both the dynamic field and the packet
+type, and if either indicates that the packet is an LLDP packet, the driver will transmit
+it.
+
Limitations or Knowing issues
-----------------------------
diff --git a/doc/guides/rel_notes/release_26_03.rst b/doc/guides/rel_notes/release_26_03.rst
index 884d2535df..5ad531aef5 100644
--- a/doc/guides/rel_notes/release_26_03.rst
+++ b/doc/guides/rel_notes/release_26_03.rst
@@ -80,6 +80,7 @@ New Features
* **Updated Intel iavf driver.**
* Added support for pre and post VF reset callbacks.
+ * Added support for transmitting LLDP packets based on mbuf packet type.
* **Updated Intel ice driver.**
diff --git a/drivers/net/intel/iavf/iavf_rxtx.h b/drivers/net/intel/iavf/iavf_rxtx.h
index 80b06518b0..1db1267eec 100644
--- a/drivers/net/intel/iavf/iavf_rxtx.h
+++ b/drivers/net/intel/iavf/iavf_rxtx.h
@@ -158,9 +158,8 @@
#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 *)))
+ ((*RTE_MBUF_DYNFIELD((m), rte_pmd_iavf_tx_lldp_dynfield_offset, uint8_t *)) || \
+ ((m)->packet_type & RTE_PTYPE_L2_MASK) == RTE_PTYPE_L2_ETHER_LLDP))
extern uint64_t iavf_timestamp_dynflag;
extern int iavf_timestamp_dynfield_offset;
--
2.43.0
More information about the dev
mailing list