iavf: use ptype for LLDP and add AVX2 ctx paths
cover iavf: use ptype for LLDP and add AVX2 ctx paths
This series changes the iavf driver to use the mbuf packet type field instead of a dynamic field for LLDP packets, and adds new AVX2 context descriptor Tx paths which support LLDP.
Ciara Loftus (2):
net/iavf: use mbuf packet type instead of dynfield for LLDP net/iavf: add AVX2 context descriptor Tx paths
doc/guides/nics/intel_vf.rst | 16 +- doc/guides/rel_notes/release_26_03.rst | 2 + drivers/net/intel/iavf/iavf.h | 2 + drivers/net/intel/iavf/iavf_ethdev.c | 13 +- drivers/net/intel/iavf/iavf_rxtx.c | 21 +- drivers/net/intel/iavf/iavf_rxtx.h | 12 +- drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c | 386 ++++++++++++++++++++ drivers/net/intel/iavf/iavf_testpmd.c | 20 +- drivers/net/intel/iavf/rte_pmd_iavf.h | 10 + 9 files changed, 448 insertions(+), 34 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/2 net/iavf: use mbuf packet type instead of dynfield for LLDP
Instead of using a dynamic mbuf field to flag a packet as LLDP, instead utilise the mbuf packet type field as the identifier instead. If the type is RTE_PTYPE_L2_ETHER_LLDP the packet is identified as LLDP. This approach is preferable because the use of dynamic mbuf fields should be reserved for features that are not easily implemented using the existing mbuf infrastructure. No negative performance impacts were observed with the new approach.
--- doc/guides/nics/intel_vf.rst | 16 +++++++++------- doc/guides/rel_notes/release_26_03.rst | 1 + drivers/net/intel/iavf/iavf_ethdev.c | 13 ++++++++----- drivers/net/intel/iavf/iavf_rxtx.c | 3 +-- drivers/net/intel/iavf/iavf_rxtx.h | 8 +++----- drivers/net/intel/iavf/iavf_testpmd.c | 20 +++++--------------- drivers/net/intel/iavf/rte_pmd_iavf.h | 10 ++++++++++ 7 files changed, 37 insertions(+), 34 deletions(-)
doc/guides/nics/intel_vf.rst +9 -7
@@ -668,19 +668,21 @@ Inline IPsec Support Diagnostic Utilities -------------------- -Register mbuf dynfield to test Tx LLDP -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Enable Tx LLDP +~~~~~~~~~~~~~~ -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. - -For ``dpdk-testpmd`` application, it needs to stop and restart Tx port to take effect. +In order for the iavf PMD to transmit LLDP packets, two conditions must be met: +1. mbufs carrying LLDP packets must have their ptype set to RTE_PTYPE_L2_ETHER_LLDP +2. LLDP needs to be explicitly enabled eg. via ``dpdk-testpmd``: Usage:: testpmd> set tx lldp on +Note: the feature should be enabled before the device is started, so that a transmit +path that is capable of transmitting LLDP packets is selected ie. one that supports +context descriptors. + Limitations or Knowing issues -----------------------------
doc/guides/rel_notes/release_26_03.rst +1 -0
@@ -62,6 +62,7 @@ New Features * **Updated Intel iavf driver.** * Added support for pre and post VF reset callbacks. + * Changed LLDP packet detection from dynamic mbuf field to mbuf packet_type. Removed Items
drivers/net/intel/iavf/iavf_ethdev.c +8 -5
@@ -45,7 +45,7 @@#define IAVF_MBUF_CHECK_ARG "mbuf_check"uint64_t iavf_timestamp_dynflag;int iavf_timestamp_dynfield_offset =-1 ; -int rte_pmd_iavf_tx_lldp_dynfield_offset =-1 ; +bool iavf_tx_lldp_enabled;static const char *const iavf_valid_args[] = {IAVF_PROTO_XTR_ARG ,
@@ -1024,10 +1024,6 @@ 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 (iavf_init_queues (dev) !=0 ) {PMD_DRV_LOG (ERR ,"failed to do Queue init" );return -1 ;
@@ -3203,6 +3199,13 @@ rte_pmd_iavf_reinit(uint16_t port)return 0 ; } +RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_iavf_enable_tx_lldp, 26.03) +void +rte_pmd_iavf_enable_tx_lldp (bool enable) +{ + iavf_tx_lldp_enabled = enable; +} +static int iavf_validate_reset_cb (uint16_t port,void *cb,void *cb_arg) {
drivers/net/intel/iavf/iavf_rxtx.c +1 -2
@@ -4243,8 +4243,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 ) - req_features.ctx_desc = true; + req_features.ctx_desc = iavf_tx_lldp_enabled;for (i =0 ; i < dev->data->nb_tx_queues; i++) { txq = dev->data->tx_queues[i];
drivers/net/intel/iavf/iavf_rxtx.h +3 -5
@@ -168,14 +168,12 @@#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_tx_lldp_enabled && \ + ((m)->packet_type & RTE_PTYPE_L2_MASK) == RTE_PTYPE_L2_ETHER_LLDP)extern uint64_t iavf_timestamp_dynflag;extern int iavf_timestamp_dynfield_offset; -extern int rte_pmd_iavf_tx_lldp_dynfield_offset; +extern bool iavf_tx_lldp_enabled; typedef void (*iavf_rxd_to_pkt_fields_t)(struct ci_rx_queue *rxq, struct rte_mbuf *mb,
drivers/net/intel/iavf/iavf_testpmd.c +5 -15
@@ -39,21 +39,11 @@ cmd_enable_tx_lldp_parsed(void *parsed_result, __rte_unused struct cmdline *cl, __rte_unused void *data) { struct cmd_enable_tx_lldp_result *res = parsed_result; -const struct rte_mbuf_dynfield iavf_tx_lldp_dynfield = { - .name =IAVF_TX_LLDP_DYNFIELD , - .size =sizeof (uint8_t ), - .align = alignof(uint8_t ), - .flags =0 - }; -int offset; - -if (strncmp (res->what,"on" ,2 ) ==0 ) { - offset =rte_mbuf_dynfield_register (&iavf_tx_lldp_dynfield); -printf ("rte_pmd_iavf_tx_lldp_dynfield_offset: %d" , offset); -if (offset <0 ) -fprintf (stderr, -"rte mbuf dynfield register failed, offset: %d" , offset); - } +bool enable =strncmp (res->what,"on" ,2 ) ==0 ; + +rte_pmd_iavf_enable_tx_lldp (enable); + +printf ("Tx LLDP %s on iavf driver\n" , enable ?"enabled" :"disabled" ); } static cmdline_parse_inst_t cmd_enable_tx_lldp = {
drivers/net/intel/iavf/rte_pmd_iavf.h +10 -0
@@ -154,6 +154,16 @@ int rte_pmd_iavf_register_post_reset_cb(uint16_t port,iavf_post_reset_cb_t post_reset_cb, void *post_reset_cb_arg); +/** +* Enable or disable Tx LLDP on the iavf driver. +* +* @param enable +* Set to true to enable Tx LLDP, false to disable. +*/ +__rte_experimental +void +rte_pmd_iavf_enable_tx_lldp (bool enable); +/** * The mbuf dynamic field pointer for flexible descriptor's extraction metadata. */
Signature · 1 line
2.43.0
Re: [PATCH 1/2] net/iavf: use mbuf packet type instead of dynfield for LLDP
Quoted 9 lines · Ciara Loftus
Instead of using a dynamic mbuf field to flag a packet as LLDP, instead utilise the mbuf packet type field as the identifier instead. If the type is
RTE_PTYPE_L2_ETHER_LLDPthe packet is identified as LLDP. This approach is preferable because the use of dynamic mbuf fields should be reserved for features that are not easily implemented using the existing mbuf infrastructure. No negative performance impacts were observed with the new approach.Signed-off-by Ciara Loftus <[email protected]>
For ABI compatibility, though, I think we need to keep the old method of identifying LLDP packets there too. While I completely agree that using packet types is the better approach, we need to go through a deprecation process for the old dynamic field method, though.
Quoted 18 lines
--- doc/guides/nics/intel_vf.rst | 16 +++++++++------- doc/guides/rel_notes/release_26_03.rst | 1 + drivers/net/intel/iavf/iavf_ethdev.c | 13 ++++++++----- drivers/net/intel/iavf/iavf_rxtx.c | 3 +-- drivers/net/intel/iavf/iavf_rxtx.h | 8 +++----- drivers/net/intel/iavf/iavf_testpmd.c | 20 +++++--------------- drivers/net/intel/iavf/rte_pmd_iavf.h | 10 ++++++++++ 7 files changed, 37 insertions(+), 34 deletions(-)doc/guides/nics/intel_vf.rst +0
-0@@ -668,19 +668,21 @@ Inline IPsec Support Diagnostic Utilities --------------------
<snip>
doc/guides/nics/intel_vf.rst
Quoted 9 lines
doc/guides/nics/intel_vf.rst +7
-0+RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_iavf_enable_tx_lldp, 26.03) +void +rte_pmd_iavf_enable_tx_lldp(bool enable) +{ + iavf_tx_lldp_enabled = enable; +} +
Rather than a private function, this looks something that should be a feature flag or capability somewhere, e.g. like TSO.
RE: [PATCH 1/2] net/iavf: use mbuf packet type instead of dynfield for LLDP
Quoted 12 lines
Subject: Re: [PATCH 1/2] net/iavf: use mbuf packet type instead of dynfield for LLDP
Quoted 8 lines · Ciara Loftus
Instead of using a dynamic mbuf field to flag a packet as LLDP, instead utilise the mbuf packet type field as the identifier instead. If the type is
RTE_PTYPE_L2_ETHER_LLDPthe packet is identified as LLDP. This approach is preferable because the use of dynamic mbuf fields should be reserved for features that are not easily implemented using the existing mbuf infrastructure. No negative performance impacts were observed with the new approach.
Quoted 6 lines
Quoted 1 line
Signed-off-by Ciara Loftus <[email protected]>For ABI compatibility, though, I think we need to keep the old method of identifying LLDP packets there too. While I completely agree that using packet types is the better approach, we need to go through a deprecation process for the old dynamic field method, though.
I will submit a v2 supporting both the dynfield and ptype approach, and a deprecation notice flagging the future removal of the dynfield.
Quoted 25 lines
Quoted 19 lines
--- doc/guides/nics/intel_vf.rst | 16 +++++++++------- doc/guides/rel_notes/release_26_03.rst | 1 + drivers/net/intel/iavf/iavf_ethdev.c | 13 ++++++++----- drivers/net/intel/iavf/iavf_rxtx.c | 3 +-- drivers/net/intel/iavf/iavf_rxtx.h | 8 +++----- drivers/net/intel/iavf/iavf_testpmd.c | 20 +++++--------------- drivers/net/intel/iavf/rte_pmd_iavf.h | 10 ++++++++++ 7 files changed, 37 insertions(+), 34 deletions(-)doc/guides/nics/intel_vf.rst +0
-0@@ -668,19 +668,21 @@ Inline IPsec Support Diagnostic Utilities --------------------<snip>
Quoted 3 lines
+RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_iavf_enable_tx_lldp,
26.03)
Quoted 8 lines
doc/guides/nics/intel_vf.rst
Quoted 6 lines
doc/guides/nics/intel_vf.rst +6
-0+void +rte_pmd_iavf_enable_tx_lldp(bool enable) +{ + iavf_tx_lldp_enabled = enable; +} +Rather than a private function, this looks something that should be a feature flag or capability somewhere, e.g. like TSO.
I think that would be a neater solution for iavf, but I can't find any evidence of any other driver requiring this sort of explicit enabling of LLDP as a feature. So it would be hard to justify adding such a feature flag/capability when it looks like there might only be one driver to use it. I will consider this some more.
Since we are keeping the dynfield implementation for now, registering the dynfield is equivalent to enabling the feature so we don't need an API like this in the v2. When we eventually remove the dynfield I will try to find a better solution for enabling the feature, that isn't a private function.
PATCH 2/2 net/iavf: add AVX2 context descriptor Tx paths
In reply to Ciara LoftusPrior to this commit the transmit paths implemented for AVX2 used the transmit descriptor only, making some offloads and features unavailable on the AVX2 path, like LLDP. Enable two new AVX2 transmit paths, both of which support using a context descriptor, one which performs offload and the other which does not.
--- doc/guides/rel_notes/release_26_03.rst | 1 + drivers/net/intel/iavf/iavf.h | 2 + drivers/net/intel/iavf/iavf_rxtx.c | 18 + drivers/net/intel/iavf/iavf_rxtx.h | 4 + drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c | 386 ++++++++++++++++++++ 5 files changed, 411 insertions(+)
doc/guides/rel_notes/release_26_03.rst +1 -0
@@ -63,6 +63,7 @@ New Features * Added support for pre and post VF reset callbacks. * Changed LLDP packet detection from dynamic mbuf field to mbuf packet_type. + * Implemented AVX2 context descriptor transmit paths. Removed Items
drivers/net/intel/iavf/iavf.h +2 -0
@@ -357,6 +357,8 @@ enum iavf_tx_func_type {IAVF_TX_DEFAULT ,IAVF_TX_AVX2 ,IAVF_TX_AVX2_OFFLOAD , +IAVF_TX_AVX2_CTX , +IAVF_TX_AVX2_CTX_OFFLOAD ,IAVF_TX_AVX512 ,IAVF_TX_AVX512_OFFLOAD , IAVF_TX_AVX512_CTX,
drivers/net/intel/iavf/iavf_rxtx.c +18 -0
@@ -3974,6 +3974,24 @@ static const struct ci_tx_path_info iavf_tx_path_infos[] = { .simd_width = RTE_VECT_SIMD_256 } }, + [IAVF_TX_AVX2_CTX ] = { + .pkt_burst = iavf_xmit_pkts_vec_avx2_ctx, + .info ="Vector AVX2 Ctx" , + .features = { + .tx_offloads =IAVF_TX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .ctx_desc = true + } + }, + [IAVF_TX_AVX2_CTX_OFFLOAD ] = { + .pkt_burst = iavf_xmit_pkts_vec_avx2_ctx_offload, + .info ="Vector AVX2 Ctx Offload" , + .features = { + .tx_offloads =IAVF_TX_VECTOR_CTX_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .ctx_desc = true + } + }, #ifdef CC_AVX512_SUPPORT [IAVF_TX_AVX512 ] = { .pkt_burst = iavf_xmit_pkts_vec_avx512,
drivers/net/intel/iavf/iavf_rxtx.h +4 -0
@@ -609,6 +609,10 @@ uint16_t iavf_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);uint16_t iavf_xmit_pkts_vec_avx2_offload (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx2_ctx (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx2_ctx_offload (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts);int iavf_get_monitor_addr (void *rx_queue,struct rte_power_monitor_cond *pmc);int iavf_rx_vec_dev_check (struct rte_eth_dev *dev);int iavf_tx_vec_dev_check (struct rte_eth_dev *dev);
drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c +386 -0
392 lines not on this page · raw message
Signature · 1 line
2.43.0
v2 cover iavf: LLDP ptype and AVX2 ctx paths
In reply to Ciara LoftusThis series adds another way to detect LLDP packets in the Tx paths of the iavf PMD, which is based on the mbuf packet type field. This is in addition to the existing method of using a dynamic field. The series also adds new AVX2 context descriptor Tx paths that support LLDP. Finally, a deprecation notice is added to the documentation to flag that the dynamic mbuf field method of LLDP packet detection will be removed in a future release.
v2:
* Support both dynfield and ptype to preserve ABI
* Add deprecation notice for dynfield approach
Ciara Loftus (3):
net/iavf: support LLDP Tx based on mbuf ptype or dynfield net/iavf: add AVX2 context descriptor Tx paths
doc: announce change to LLDP packet detection in iavf PMD
doc/guides/nics/intel_vf.rst | 6 + doc/guides/rel_notes/deprecation.rst | 4 + doc/guides/rel_notes/release_26_03.rst | 2 + drivers/net/intel/iavf/iavf.h | 2 + drivers/net/intel/iavf/iavf_rxtx.c | 18 + drivers/net/intel/iavf/iavf_rxtx.h | 9 +- drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c | 386 ++++++++++++++++++++ 7 files changed, 424 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0
PATCH v2 1/3 net/iavf: support LLDP Tx based on mbuf ptype or dynfield
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.
---
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(-)
doc/guides/nics/intel_vf.rst +6 -0
@@ -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 -----------------------------
doc/guides/rel_notes/release_26_03.rst +1 -0
@@ -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.**
drivers/net/intel/iavf/iavf_rxtx.h +2 -3
@@ -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;
Signature · 1 line
2.43.0
PATCH v2 2/3 net/iavf: add AVX2 context descriptor Tx paths
In reply to Ciara LoftusPrior to this commit the transmit paths implemented for AVX2 used the transmit descriptor only, making some offloads and features unavailable on the AVX2 path, like LLDP. Enable two new AVX2 transmit paths, both of which support using a context descriptor, one which performs offload and the other which does not.
--- doc/guides/rel_notes/release_26_03.rst | 1 + drivers/net/intel/iavf/iavf.h | 2 + drivers/net/intel/iavf/iavf_rxtx.c | 18 + drivers/net/intel/iavf/iavf_rxtx.h | 4 + drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c | 386 ++++++++++++++++++++ 5 files changed, 411 insertions(+)
doc/guides/rel_notes/release_26_03.rst +1 -0
@@ -81,6 +81,7 @@ New Features * Added support for pre and post VF reset callbacks. * Added support for transmitting LLDP packets based on mbuf packet type. + * Implemented AVX2 context descriptor transmit paths. * **Updated Intel ice driver.**
drivers/net/intel/iavf/iavf.h +2 -0
@@ -357,6 +357,8 @@ enum iavf_tx_func_type {IAVF_TX_DEFAULT ,IAVF_TX_AVX2 ,IAVF_TX_AVX2_OFFLOAD , +IAVF_TX_AVX2_CTX , +IAVF_TX_AVX2_CTX_OFFLOAD ,IAVF_TX_AVX512 ,IAVF_TX_AVX512_OFFLOAD , IAVF_TX_AVX512_CTX,
drivers/net/intel/iavf/iavf_rxtx.c +18 -0
@@ -3616,6 +3616,24 @@ static const struct ci_tx_path_info iavf_tx_path_infos[] = { .simd_width = RTE_VECT_SIMD_256 } }, + [IAVF_TX_AVX2_CTX ] = { + .pkt_burst = iavf_xmit_pkts_vec_avx2_ctx, + .info ="Vector AVX2 Ctx" , + .features = { + .tx_offloads =IAVF_TX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .ctx_desc = true + } + }, + [IAVF_TX_AVX2_CTX_OFFLOAD ] = { + .pkt_burst = iavf_xmit_pkts_vec_avx2_ctx_offload, + .info ="Vector AVX2 Ctx Offload" , + .features = { + .tx_offloads =IAVF_TX_VECTOR_CTX_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .ctx_desc = true + } + }, #ifdef CC_AVX512_SUPPORT [IAVF_TX_AVX512 ] = { .pkt_burst = iavf_xmit_pkts_vec_avx512,
drivers/net/intel/iavf/iavf_rxtx.h +4 -0
@@ -587,6 +587,10 @@ uint16_t iavf_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);uint16_t iavf_xmit_pkts_vec_avx2_offload (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx2_ctx (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx2_ctx_offload (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts);int iavf_get_monitor_addr (void *rx_queue,struct rte_power_monitor_cond *pmc);int iavf_rx_vec_dev_check (struct rte_eth_dev *dev);int iavf_tx_vec_dev_check (struct rte_eth_dev *dev);
drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c +386 -0
392 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v2 3/3 doc: announce change to LLDP packet detection in iavf PMD
In reply to Ciara LoftusThe iavf PMD transmit paths currently use two methods to identify if an mbuf holds an LLDP packet: a dynamic mbuf field and the mbuf ptype. A future release will remove the dynamic mbuf field approach at which point the ptype will be the only approach used.
--- doc/guides/rel_notes/deprecation.rst | 4 ++++ 1 file changed, 4 insertions(+)
doc/guides/rel_notes/deprecation.rst +4 -0
@@ -139,3 +139,7 @@ Deprecation Notices * bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK. Those API functions are used internally by DPDK core and netvsc PMD. + +* net/iavf: The method of detecting an LLDP packet on the transmit path + in the iavf PMD will be changed. Instead of using either a dynamic mbuf + field or the mbuf ptype, only the mbuf ptype will be used.
Signature · 1 line
2.43.0
v3 cover iavf: LLDP ptype and AVX2 ctx paths
In reply to Ciara LoftusThis series adds another way to detect LLDP packets in the Tx paths of the iavf PMD, which is based on the mbuf packet type field. This is in addition to the existing method of using a dynamic field. The series also adds new AVX2 context descriptor Tx paths that support LLDP. Finally, a deprecation notice is added to the documentation to flag that the dynamic mbuf field method of LLDP packet detection will be removed in a future release.
v3:
* Enable the ptype support via a new devarg enable_ptype_lldp
Ciara Loftus (3):
net/iavf: support LLDP Tx via mbuf ptype or dynfield net/iavf: add AVX2 context descriptor Tx paths
doc: announce change to LLDP packet detection in iavf PMD
doc/guides/nics/intel_vf.rst | 21 +- doc/guides/rel_notes/deprecation.rst | 4 + doc/guides/rel_notes/release_26_07.rst | 6 + drivers/net/intel/iavf/iavf.h | 3 + drivers/net/intel/iavf/iavf_ethdev.c | 15 + drivers/net/intel/iavf/iavf_rxtx.c | 20 +- drivers/net/intel/iavf/iavf_rxtx.h | 13 +- drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c | 386 ++++++++++++++++++++ 8 files changed, 458 insertions(+), 10 deletions(-)
Signature · 1 line
2.43.0
PATCH v3 1/3 net/iavf: support LLDP Tx via mbuf ptype or dynfield
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.
---
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(-)
doc/guides/nics/intel_vf.rst +16 -5
@@ -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 -----------------------------
doc/guides/rel_notes/release_26_07.rst +5 -0
@@ -56,6 +56,11 @@ New Features ======================================================= +* **Updated Intel iavf driver.** + + * Added support for transmitting LLDP packets based on mbuf packet type. + + Removed Items -------------
drivers/net/intel/iavf/iavf.h +1 -0
@@ -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 ;
drivers/net/intel/iavf/iavf_ethdev.c +15 -0
@@ -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 ; }
drivers/net/intel/iavf/iavf_rxtx.c +1 -1
@@ -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++) {
drivers/net/intel/iavf/iavf_rxtx.h +5 -4
@@ -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,
Signature · 1 line
2.43.0
Re: [PATCH v3 1/3] net/iavf: support LLDP Tx via mbuf ptype or dynfield
Quoted 13 lines · Ciara Loftus
Previously, the only way to transmit LLDP packets via the iavf PMD was to register the
IAVF_TX_LLDP_DYNFIELDdynamic 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_lldpis set to 1, and if the mbuf packet type is set toRTE_PTYPE_L2_ETHER_LLDPthen 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.
Quoted 5 lines
Signed-off-by Ciara Loftus <[email protected]>---
v3:
* Enable ptype LLDP via new devarg
---
Some feedback around documentation inline below.
/Bruce
Quoted 20 lines
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(-)doc/guides/nics/intel_vf.rst +2
-2@@ -675,12 +675,14 @@ Inline IPsec Support Diagnostic Utilities -------------------- -Register mbuf dynfield to test Tx LLDP -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Tx LLDP Testing +~~~~~~~~~~~~~~~
doc/guides/nics/intel_vf.rst Inline IPsec Support · line 686
Quoted 10 lines
doc/guides/nics/intel_vf.rst +5
-3-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.
Switch the order of the methods in the docs. We should always start with the best/recommended method first, so the user doesn't have to read through the less-recommended methods in order to get to the best one.
Also not when describing the dyn-field method that it is deprecated and will be removed in future.
Quoted 5 lines
doc/guides/nics/intel_vf.rst +0
-0For ``dpdk-testpmd`` application, it needs to stop and restart Tx port to take effect.@@ -688,6 +690,15 @@ Usage:: testpmd> set tx lldp on
doc/guides/nics/intel_vf.rst Usage:: · line 701
Quoted 10 lines
doc/guides/nics/intel_vf.rst +9
-0+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. +
The previous method describes testpmd use. Do we need such a description here too?
Quoted 56 lines
doc/guides/nics/intel_vf.rst +0
-0Limitations or Knowing issues -----------------------------doc/guides/rel_notes/release_26_07.rst +5
-0@@ -56,6 +56,11 @@ New Features ======================================================= +* **Updated Intel iavf driver.** + + * Added support for transmitting LLDP packets based on mbuf packet type. + + Removed Items -------------drivers/net/intel/iavf/iavf.h +1
-0@@ -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 ;drivers/net/intel/iavf/iavf_ethdev.c +3
-0@@ -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 };
drivers/net/intel/iavf/iavf_ethdev.c iavf_dev_start(struct rte_eth_dev *dev) · line 1024
Quoted 6 lines
drivers/net/intel/iavf/iavf_ethdev.c +3
-0@@ -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." );
I think this message could do with being expanded and clarified, even if it is longer. For example: "Using a dynamic mbuf field to identify LLDP packets is deprecated. Set the 'enable_ptype_lldp' driver option and mbuf LLDP ptypes instead"
Quoted 66 lines
drivers/net/intel/iavf/iavf_ethdev.c +9
-0+ 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 ; }drivers/net/intel/iavf/iavf_rxtx.c +1
-1@@ -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++) {drivers/net/intel/iavf/iavf_rxtx.h +5
-4@@ -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,Signature · 1 line
2.43.0
RE: [PATCH v3 1/3] net/iavf: support LLDP Tx via mbuf ptype or dynfield
Quoted 14 lines
doc/guides/nics/intel_vf.rst Usage:: · line 693
Quoted 5 lines
doc/guides/nics/intel_vf.rst +1
-0@@ -688,6 +690,15 @@ Usage:: testpmd> set tx lldp on +An alternative method for transmitting LLDP packets is to set the``packet_type`` of
Review Usage:: · line 694
Quoted 1 line
(quoted diff) +1
-0+the mbuf to ``RTE_PTYPE_L2_ETHER_LLDP``. This, in conjunction withenabling the
doc/guides/nics/intel_vf.rst Usage::
Quoted 5 lines
doc/guides/nics/intel_vf.rst +5
-0+``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 detectionis
Quoted 8 lines
Review Usage:: · line 700
Quoted 1 line
(quoted diff) +1
-0+disabled, but LLDP transmission via the dynamic mbuf field remainsavailable.
Review Usage:: · line 701
Quoted 1 line
(quoted diff) +1
-0+The previous method describes testpmd use. Do we need such a description here too?
Quoted 1 line
The ptype method doesn't require any specific enabling steps in testpmd, it is enabled only via the devarg. I've updated the documentation to make that clearer.
PATCH v3 2/3 net/iavf: add AVX2 context descriptor Tx paths
In reply to Ciara LoftusPrior to this commit the transmit paths implemented for AVX2 used the transmit descriptor only, making some offloads and features unavailable on the AVX2 path, like LLDP. Enable two new AVX2 transmit paths, both of which support using a context descriptor, one which performs offload and the other which does not.
--- doc/guides/rel_notes/release_26_07.rst | 1 + drivers/net/intel/iavf/iavf.h | 2 + drivers/net/intel/iavf/iavf_rxtx.c | 18 + drivers/net/intel/iavf/iavf_rxtx.h | 4 + drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c | 386 ++++++++++++++++++++ 5 files changed, 411 insertions(+)
doc/guides/rel_notes/release_26_07.rst +1 -0
@@ -59,6 +59,7 @@ New Features * **Updated Intel iavf driver.** * Added support for transmitting LLDP packets based on mbuf packet type. + * Implemented AVX2 context descriptor transmit paths. Removed Items
drivers/net/intel/iavf/iavf.h +2 -0
@@ -360,6 +360,8 @@ enum iavf_tx_func_type {IAVF_TX_DEFAULT ,IAVF_TX_AVX2 ,IAVF_TX_AVX2_OFFLOAD , +IAVF_TX_AVX2_CTX , +IAVF_TX_AVX2_CTX_OFFLOAD ,IAVF_TX_AVX512 ,IAVF_TX_AVX512_OFFLOAD , IAVF_TX_AVX512_CTX,
drivers/net/intel/iavf/iavf_rxtx.c +18 -0
@@ -3616,6 +3616,24 @@ static const struct ci_tx_path_info iavf_tx_path_infos[] = { .simd_width = RTE_VECT_SIMD_256 } }, + [IAVF_TX_AVX2_CTX ] = { + .pkt_burst = iavf_xmit_pkts_vec_avx2_ctx, + .info ="Vector AVX2 Ctx" , + .features = { + .tx_offloads =IAVF_TX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .ctx_desc = true + } + }, + [IAVF_TX_AVX2_CTX_OFFLOAD ] = { + .pkt_burst = iavf_xmit_pkts_vec_avx2_ctx_offload, + .info ="Vector AVX2 Ctx Offload" , + .features = { + .tx_offloads =IAVF_TX_VECTOR_CTX_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .ctx_desc = true + } + }, #ifdef CC_AVX512_SUPPORT [IAVF_TX_AVX512 ] = { .pkt_burst = iavf_xmit_pkts_vec_avx512,
drivers/net/intel/iavf/iavf_rxtx.h +4 -0
@@ -589,6 +589,10 @@ uint16_t iavf_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);uint16_t iavf_xmit_pkts_vec_avx2_offload (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx2_ctx (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx2_ctx_offload (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts);int iavf_get_monitor_addr (void *rx_queue,struct rte_power_monitor_cond *pmc);int iavf_rx_vec_dev_check (struct rte_eth_dev *dev);int iavf_tx_vec_dev_check (struct rte_eth_dev *dev);
drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c +386 -0
392 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v3 3/3 doc: announce change to LLDP packet detection in iavf PMD
In reply to Ciara LoftusThe iavf PMD transmit paths currently use two methods to identify if an mbuf holds an LLDP packet: a dynamic mbuf field and the mbuf ptype. The ptype method is enabled via the enable_ptype_lldp devarg. A future release will remove the dynamic mbuf field approach at which point the ptype will be the only approach used.
--- doc/guides/rel_notes/deprecation.rst | 4 ++++ 1 file changed, 4 insertions(+)
doc/guides/rel_notes/deprecation.rst +4 -0
@@ -154,3 +154,7 @@ Deprecation Notices * bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK. Those API functions are used internally by DPDK core and netvsc PMD. + +* net/iavf: The dynamic mbuf field used to detect LLDP packets on the + transmit path in the iavf PMD will be removed in a future release. + After removal, only packet type-based detection will be supported.
Signature · 1 line
2.43.0
v4 cover iavf: LLDP ptype and AVX2 ctx paths
In reply to Ciara LoftusThis series adds another way to detect LLDP packets in the Tx paths of the iavf PMD, which is based on the mbuf packet type field. This is in addition to the existing method of using a dynamic field. The series also adds new AVX2 context descriptor Tx paths that support LLDP. Finally, a deprecation notice is added to the documentation to flag that the dynamic mbuf field method of LLDP packet detection will be removed in a future release.
v4:
* Fix build error by replacing commas with semicolons in patch 2
Ciara Loftus (3):
net/iavf: support LLDP Tx via mbuf ptype or dynfield net/iavf: add AVX2 context descriptor Tx paths
doc: announce change to LLDP packet detection in iavf PMD
doc/guides/nics/intel_vf.rst | 21 +- doc/guides/rel_notes/deprecation.rst | 4 + doc/guides/rel_notes/release_26_07.rst | 6 + drivers/net/intel/iavf/iavf.h | 3 + drivers/net/intel/iavf/iavf_ethdev.c | 15 + drivers/net/intel/iavf/iavf_rxtx.c | 20 +- drivers/net/intel/iavf/iavf_rxtx.h | 13 +- drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c | 386 ++++++++++++++++++++ 8 files changed, 458 insertions(+), 10 deletions(-)
Signature · 1 line
2.43.0
PATCH v4 1/3 net/iavf: support LLDP Tx via mbuf ptype or dynfield
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.
--- 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(-)
doc/guides/nics/intel_vf.rst +16 -5
@@ -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 -----------------------------
doc/guides/rel_notes/release_26_07.rst +5 -0
@@ -56,6 +56,11 @@ New Features ======================================================= +* **Updated Intel iavf driver.** + + * Added support for transmitting LLDP packets based on mbuf packet type. + + Removed Items -------------
drivers/net/intel/iavf/iavf.h +1 -0
@@ -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 ;
drivers/net/intel/iavf/iavf_ethdev.c +15 -0
@@ -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 ; }
drivers/net/intel/iavf/iavf_rxtx.c +1 -1
@@ -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++) {
drivers/net/intel/iavf/iavf_rxtx.h +5 -4
@@ -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,
Signature · 1 line
2.43.0
Re: [PATCH v4 1/3] net/iavf: support LLDP Tx via mbuf ptype or dynfield
Quoted 14 lines · Ciara Loftus
Previously, the only way to transmit LLDP packets via the iavf PMD was to register the
IAVF_TX_LLDP_DYNFIELDdynamic 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_lldpis set to 1, and if the mbuf packet type is set toRTE_PTYPE_L2_ETHER_LLDPthen 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 <[email protected]>
Quoted 9 lines
--- 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(-)
Comments from v3 still apply, I believe.
PATCH v4 2/3 net/iavf: add AVX2 context descriptor Tx paths
In reply to Ciara LoftusPrior to this commit the transmit paths implemented for AVX2 used the transmit descriptor only, making some offloads and features unavailable on the AVX2 path, like LLDP. Enable two new AVX2 transmit paths, both of which support using a context descriptor, one which performs offload and the other which does not.
---
v4:
* Use semicolons instead of commas to separate statements.
--- doc/guides/rel_notes/release_26_07.rst | 1 + drivers/net/intel/iavf/iavf.h | 2 + drivers/net/intel/iavf/iavf_rxtx.c | 18 + drivers/net/intel/iavf/iavf_rxtx.h | 4 + drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c | 386 ++++++++++++++++++++ 5 files changed, 411 insertions(+)
doc/guides/rel_notes/release_26_07.rst +1 -0
@@ -59,6 +59,7 @@ New Features * **Updated Intel iavf driver.** * Added support for transmitting LLDP packets based on mbuf packet type. + * Implemented AVX2 context descriptor transmit paths. Removed Items
drivers/net/intel/iavf/iavf.h +2 -0
@@ -360,6 +360,8 @@ enum iavf_tx_func_type {IAVF_TX_DEFAULT ,IAVF_TX_AVX2 ,IAVF_TX_AVX2_OFFLOAD , +IAVF_TX_AVX2_CTX , +IAVF_TX_AVX2_CTX_OFFLOAD ,IAVF_TX_AVX512 ,IAVF_TX_AVX512_OFFLOAD , IAVF_TX_AVX512_CTX,
drivers/net/intel/iavf/iavf_rxtx.c +18 -0
@@ -3616,6 +3616,24 @@ static const struct ci_tx_path_info iavf_tx_path_infos[] = { .simd_width = RTE_VECT_SIMD_256 } }, + [IAVF_TX_AVX2_CTX ] = { + .pkt_burst = iavf_xmit_pkts_vec_avx2_ctx, + .info ="Vector AVX2 Ctx" , + .features = { + .tx_offloads =IAVF_TX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .ctx_desc = true + } + }, + [IAVF_TX_AVX2_CTX_OFFLOAD ] = { + .pkt_burst = iavf_xmit_pkts_vec_avx2_ctx_offload, + .info ="Vector AVX2 Ctx Offload" , + .features = { + .tx_offloads =IAVF_TX_VECTOR_CTX_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .ctx_desc = true + } + }, #ifdef CC_AVX512_SUPPORT [IAVF_TX_AVX512 ] = { .pkt_burst = iavf_xmit_pkts_vec_avx512,
drivers/net/intel/iavf/iavf_rxtx.h +4 -0
@@ -589,6 +589,10 @@ uint16_t iavf_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);uint16_t iavf_xmit_pkts_vec_avx2_offload (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx2_ctx (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx2_ctx_offload (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts);int iavf_get_monitor_addr (void *rx_queue,struct rte_power_monitor_cond *pmc);int iavf_rx_vec_dev_check (struct rte_eth_dev *dev);int iavf_tx_vec_dev_check (struct rte_eth_dev *dev);
drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c +386 -0
392 lines not on this page · raw message
Signature · 1 line
2.43.0
Re: [PATCH v4 2/3] net/iavf: add AVX2 context descriptor Tx paths
Quoted 7 lines · Ciara Loftus
Prior to this commit the transmit paths implemented for AVX2 used the transmit descriptor only, making some offloads and features unavailable on the AVX2 path, like LLDP. Enable two new AVX2 transmit paths, both of which support using a context descriptor, one which performs offload and the other which does not.
Signed-off-by Ciara Loftus <[email protected]>
PATCH v4 3/3 doc: announce change to LLDP packet detection in iavf PMD
In reply to Ciara LoftusThe iavf PMD transmit paths currently use two methods to identify if an mbuf holds an LLDP packet: a dynamic mbuf field and the mbuf ptype. The ptype method is enabled via the enable_ptype_lldp devarg. A future release will remove the dynamic mbuf field approach at which point the ptype will be the only approach used.
--- doc/guides/rel_notes/deprecation.rst | 4 ++++ 1 file changed, 4 insertions(+)
doc/guides/rel_notes/deprecation.rst +4 -0
@@ -154,3 +154,7 @@ Deprecation Notices * bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK. Those API functions are used internally by DPDK core and netvsc PMD. + +* net/iavf: The dynamic mbuf field used to detect LLDP packets on the + transmit path in the iavf PMD will be removed in a future release. + After removal, only packet type-based detection will be supported.
Signature · 1 line
2.43.0
v5 cover iavf: LLDP ptype and AVX2 ctx paths
This series adds another way to detect LLDP packets in the Tx paths of the iavf PMD, which is based on the mbuf packet type field. This is in addition to the existing method of using a dynamic field. The series also adds new AVX2 context descriptor Tx paths that support LLDP. Finally, a deprecation notice is added to the documentation to flag that the dynamic mbuf field method of LLDP packet detection will be removed in a future release.
Patch 1 flags "CHECK:MACRO_ARG_REUSE" in checkpatch for the IAVF_CHECK_TX_LLDP macro. This is a false positive because the inputs to the macro are not reused in a way that would cause issues.
v5:
* Updated the documentation
* Made the "lldp mode" per-device rather than a global value. This is necessary because the devarg is per-device unlike the global dynfield. The mode is added to the iavf-specific flags in the ci_tx_queue struct so that it can be read for each device on the datapath.
Ciara Loftus (3):
net/iavf: support LLDP Tx via mbuf ptype or dynfield net/iavf: add AVX2 context descriptor Tx paths
doc: announce change to LLDP packet detection in iavf PMD
doc/guides/nics/intel_vf.rst | 33 +- doc/guides/rel_notes/deprecation.rst | 4 + doc/guides/rel_notes/release_26_07.rst | 6 + drivers/net/intel/common/tx.h | 1 + drivers/net/intel/iavf/iavf.h | 3 + drivers/net/intel/iavf/iavf_ethdev.c | 27 ++ drivers/net/intel/iavf/iavf_rxtx.c | 33 +- drivers/net/intel/iavf/iavf_rxtx.h | 21 +- drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c | 387 ++++++++++++++++++ drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c | 21 +- 10 files changed, 508 insertions(+), 28 deletions(-)
Signature · 1 line
2.43.0
PATCH v5 1/3 net/iavf: support LLDP Tx via mbuf ptype or dynfield
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.
--- doc/guides/nics/intel_vf.rst | 33 +++++++++++++++---- doc/guides/rel_notes/release_26_07.rst | 5 +++ drivers/net/intel/common/tx.h | 1 + drivers/net/intel/iavf/iavf.h | 1 + drivers/net/intel/iavf/iavf_ethdev.c | 27 +++++++++++++++ drivers/net/intel/iavf/iavf_rxtx.c | 15 +++++---- drivers/net/intel/iavf/iavf_rxtx.h | 17 +++++++--- drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c | 21 ++++++------ 8 files changed, 92 insertions(+), 28 deletions(-)
doc/guides/nics/intel_vf.rst +27 -6
@@ -675,19 +675,40 @@ 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. -For ``dpdk-testpmd`` application, it needs to stop and restart Tx port to take effect. +The first (and recommended) method 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 + +An alternative 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. + +.. note:: + + The dynamic mbuf field method is deprecated and will be removed in a future + release. Users should migrate to the ``enable_ptype_lldp`` devarg and mbuf + LLDP ptype method described above. + +For ``dpdk-testpmd`` application, the dynamic mbuf field is registered when the +following command is issued: Usage:: testpmd> set tx lldp on +One must then stop and restart the port for it to take effect. +These requirements only apply for the dynamic mbuf field method; no special +steps are needed for the ``enable_ptype_lldp`` devarg method. +If both methods are enabled, the ptype based method will take precedence over the +dynamic mbuf field method. + Limitations or Knowing issues -----------------------------
doc/guides/rel_notes/release_26_07.rst +5 -0
@@ -56,6 +56,11 @@ New Features ======================================================= +* **Updated Intel iavf driver.** + + * Added support for transmitting LLDP packets based on mbuf packet type. + + Removed Items -------------
drivers/net/intel/common/tx.h +1 -0
@@ -196,6 +196,7 @@ struct ci_tx_queue {uint8_t vlan_flag;uint8_t tc;bool use_ctx;/* with ctx info, each pkt needs two descriptors */ +uint8_t lldp_mode;/* ptype or dynfield */ };struct {/* ixgbe specific values */ const struct ixgbe_txq_ops *ops;
drivers/net/intel/iavf/iavf.h +1 -0
@@ -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 ;
drivers/net/intel/iavf/iavf_ethdev.c +27 -0
@@ -44,6 +44,7 @@#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 ;
@@ -56,6 +57,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 +1018,26 @@ 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 , +"Using a dynamic mbuf field to identify LLDP packets is deprecated. " +"Set the 'enable_ptype_lldp' driver option and mbuf LLDP ptypes instead." ); +if (adapter->devargs.enable_ptype_lldp) +PMD_DRV_LOG (WARNING , +"Both ptype and dynfield LLDP enabled; ptype takes precedence." ); + } + +for (uint16_t i =0 ; i < dev->data->nb_tx_queues; i++) { +struct ci_tx_queue *txq = dev->data->tx_queues[i]; +if (txq) { +if (adapter->devargs.enable_ptype_lldp) + txq->lldp_mode =IAVF_LLDP_PTYPE ; +else if (rte_pmd_iavf_tx_lldp_dynfield_offset >0 ) + txq->lldp_mode =IAVF_LLDP_DYNFIELD ; +else + txq->lldp_mode =IAVF_LLDP_DISABLED ; + } + }if (iavf_init_queues (dev) !=0 ) {PMD_DRV_LOG (ERR ,"failed to do Queue init" );
@@ -2445,6 +2467,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;
drivers/net/intel/iavf/iavf_rxtx.c +8 -7
@@ -2343,7 +2343,7 @@ iavf_recv_pkts_bulk_alloc(void *rx_queue,/* Check if the context descriptor is needed for TX offloading */ static inline uint16_t -iavf_calc_context_desc (const struct rte_mbuf *mb,uint8_t vlan_flag) +iavf_calc_context_desc (const struct rte_mbuf *mb,uint8_t vlan_flag,uint8_t lldp_mode) {uint64_t flags = mb->ol_flags; if (flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG |
@@ -2354,7 +2354,7 @@ iavf_calc_context_desc(const struct rte_mbuf *mb, uint8_t vlan_flag) vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2)return 1 ; -if (IAVF_CHECK_TX_LLDP (mb)) +if (IAVF_CHECK_TX_LLDP (mb, lldp_mode))return 1 ;return 0 ;
@@ -2542,17 +2542,18 @@ iavf_get_context_desc(uint64_t ol_flags, const struct rte_mbuf *mbuf,const struct ci_tx_queue *txq, uint64_t *qw0, uint64_t *qw1) { - uint8_t iavf_vlan_flag; + uint8_t iavf_vlan_flag, lldp_mode;uint16_t cd_l2tag2 =0 ;uint64_t cd_type_cmd =IAVF_TX_DESC_DTYPE_CONTEXT ;uint64_t cd_tunneling_params =0 ;struct iavf_ipsec_crypto_pkt_metadata *ipsec_md =NULL ; -/* Use IAVF-specific vlan_flag from txq */ +/* Use IAVF-specific flags from txq */ iavf_vlan_flag = txq->vlan_flag; + lldp_mode = txq->lldp_mode;/* Check if context descriptor is needed using existing IAVF logic */ -if (!iavf_calc_context_desc (mbuf, iavf_vlan_flag)) +if (!iavf_calc_context_desc (mbuf, iavf_vlan_flag, lldp_mode))return 0 ;/* Get IPsec metadata if needed */
@@ -2584,7 +2585,7 @@ iavf_get_context_desc(uint64_t ol_flags, const struct rte_mbuf *mbuf, }/* LLDP switching field */ -if (IAVF_CHECK_TX_LLDP (mbuf)) +if (IAVF_CHECK_TX_LLDP (mbuf, lldp_mode)) cd_type_cmd |=IAVF_TX_CTX_DESC_SWTCH_UPLINK <<IAVF_TXD_CTX_QW1_CMD_SHIFT ;/* Tunneling field */
@@ -3886,7 +3887,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 (adapter->devargs.enable_ptype_lldp || rte_pmd_iavf_tx_lldp_dynfield_offset >0 ) req_features.ctx_desc = true;for (i =0 ; i < dev->data->nb_tx_queues; i++) {
drivers/net/intel/iavf/iavf_rxtx.h +12 -5
@@ -156,11 +156,18 @@ (RTE_MBUF_F_TX_OFFLOAD_MASK ^ IAVF_TX_OFFLOAD_MASK)#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 *))) + +/* LLDP Tx modes */ +#define IAVF_LLDP_DISABLED 0 +#define IAVF_LLDP_PTYPE 1 +#define IAVF_LLDP_DYNFIELD 2 + +#define IAVF_CHECK_TX_LLDP (m, lldp_mode) \ + ((lldp_mode) && \ + ((((lldp_mode) == IAVF_LLDP_PTYPE) && \ + ((m)->packet_type & RTE_PTYPE_L2_MASK) == RTE_PTYPE_L2_ETHER_LLDP) || \ + (((lldp_mode) == IAVF_LLDP_DYNFIELD) && \ + *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;
drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c +11 -10
@@ -2059,7 +2059,7 @@ iavf_fill_ctx_desc_tunnelling_field(volatile uint64_t *qw0, static __rte_always_inline voidctx_vtx1 (volatile struct ci_tx_desc *txdp,struct rte_mbuf *pkt, -uint64_t flags,bool offload,uint8_t vlan_flag) +uint64_t flags,bool offload,uint8_t vlan_flag,uint8_t lldp_mode) {uint64_t high_ctx_qw =IAVF_TX_DESC_DTYPE_CONTEXT ;uint64_t low_ctx_qw =0 ;
@@ -2080,7 +2080,7 @@ ctx_vtx1(volatile struct ci_tx_desc *txdp, struct rte_mbuf *pkt, }#endif } -if (IAVF_CHECK_TX_LLDP (pkt)) +if (IAVF_CHECK_TX_LLDP (pkt, lldp_mode)) high_ctx_qw |=IAVF_TX_CTX_DESC_SWTCH_UPLINK <<IAVF_TXD_CTX_QW1_CMD_SHIFT ; uint64_t high_data_qw = (CI_TX_DESC_DTYPE_DATA |
@@ -2098,13 +2098,13 @@ ctx_vtx1(volatile struct ci_tx_desc *txdp, struct rte_mbuf *pkt, static __rte_always_inline voidctx_vtx (volatile struct ci_tx_desc *txdp,struct rte_mbuf **pkt,uint16_t nb_pkts,uint64_t flags, -bool offload,uint8_t vlan_flag) +bool offload,uint8_t vlan_flag,uint8_t lldp_mode) {uint64_t hi_data_qw_tmpl = (CI_TX_DESC_DTYPE_DATA | (flags <<CI_TXD_QW1_CMD_S ));/* if unaligned on 32-bit boundary, do one to align */ if (((uintptr_t )txdp &0x1F ) !=0 && nb_pkts !=0 ) { -ctx_vtx1 (txdp, *pkt, flags, offload, vlan_flag); +ctx_vtx1 (txdp, *pkt, flags, offload, vlan_flag, lldp_mode); nb_pkts--; txdp++; pkt++; }
@@ -2137,7 +2137,7 @@ ctx_vtx(volatile struct ci_tx_desc *txdp, } }#endif -if (IAVF_CHECK_TX_LLDP (pkt[1 ])) +if (IAVF_CHECK_TX_LLDP (pkt[1 ], lldp_mode)) hi_ctx_qw1 |=IAVF_TX_CTX_DESC_SWTCH_UPLINK <<CI_TXD_QW1_CMD_S ;
@@ -2157,7 +2157,7 @@ ctx_vtx(volatile struct ci_tx_desc *txdp, } }#endif -if (IAVF_CHECK_TX_LLDP (pkt[0 ])) +if (IAVF_CHECK_TX_LLDP (pkt[0 ], lldp_mode)) hi_ctx_qw0 |=IAVF_TX_CTX_DESC_SWTCH_UPLINK <<CI_TXD_QW1_CMD_S ;if (offload) {
@@ -2177,7 +2177,7 @@ ctx_vtx(volatile struct ci_tx_desc *txdp, }if (nb_pkts) -ctx_vtx1 (txdp, *pkt, flags, offload, vlan_flag); +ctx_vtx1 (txdp, *pkt, flags, offload, vlan_flag, lldp_mode); }static __rte_always_inline uint16_t
@@ -2258,6 +2258,7 @@ iavf_xmit_fixed_burst_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts,/* bit2 is reserved and must be set to 1 according to Spec */ uint64_t flags =CI_TX_DESC_CMD_EOP |CI_TX_DESC_CMD_ICRC ;uint64_t rs =CI_TX_DESC_CMD_RS | flags; +uint8_t lldp_mode = txq->lldp_mode;if (txq->nb_tx_free < txq->tx_free_thresh)ci_tx_free_bufs_vec (txq, iavf_tx_desc_done, true);
@@ -2280,10 +2281,10 @@ iavf_xmit_fixed_burst_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts, nb_mbuf = n >>1 ;tx_backlog_entry_avx512 (txep, tx_pkts, nb_mbuf); -ctx_vtx (txdp, tx_pkts, nb_mbuf -1 , flags, offload, txq->vlan_flag); +ctx_vtx (txdp, tx_pkts, nb_mbuf -1 , flags, offload, txq->vlan_flag, lldp_mode); tx_pkts += (nb_mbuf -1 ); txdp += (n -2 ); -ctx_vtx1 (txdp, *tx_pkts++, rs, offload, txq->vlan_flag); +ctx_vtx1 (txdp, *tx_pkts++, rs, offload, txq->vlan_flag, lldp_mode); nb_commit = (uint16_t )(nb_commit - n);
@@ -2297,7 +2298,7 @@ iavf_xmit_fixed_burst_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts, nb_mbuf = nb_commit >>1 ;tx_backlog_entry_avx512 (txep, tx_pkts, nb_mbuf); -ctx_vtx (txdp, tx_pkts, nb_mbuf, flags, offload, txq->vlan_flag); +ctx_vtx (txdp, tx_pkts, nb_mbuf, flags, offload, txq->vlan_flag, lldp_mode); tx_id = (uint16_t )(tx_id + nb_commit);if (tx_id > txq->tx_next_rs) {
Signature · 1 line
2.43.0
PATCH v5 2/3 net/iavf: add AVX2 context descriptor Tx paths
In reply to Ciara LoftusPrior to this commit the transmit paths implemented for AVX2 used the transmit descriptor only, making some offloads and features unavailable on the AVX2 path, like LLDP. Enable two new AVX2 transmit paths, both of which support using a context descriptor, one which performs offload and the other which does not.
--- doc/guides/rel_notes/release_26_07.rst | 1 + drivers/net/intel/iavf/iavf.h | 2 + drivers/net/intel/iavf/iavf_rxtx.c | 18 + drivers/net/intel/iavf/iavf_rxtx.h | 4 + drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c | 387 ++++++++++++++++++++ 5 files changed, 412 insertions(+)
doc/guides/rel_notes/release_26_07.rst +1 -0
@@ -59,6 +59,7 @@ New Features * **Updated Intel iavf driver.** * Added support for transmitting LLDP packets based on mbuf packet type. + * Implemented AVX2 context descriptor transmit paths. Removed Items
drivers/net/intel/iavf/iavf.h +2 -0
@@ -360,6 +360,8 @@ enum iavf_tx_func_type {IAVF_TX_DEFAULT ,IAVF_TX_AVX2 ,IAVF_TX_AVX2_OFFLOAD , +IAVF_TX_AVX2_CTX , +IAVF_TX_AVX2_CTX_OFFLOAD ,IAVF_TX_AVX512 ,IAVF_TX_AVX512_OFFLOAD , IAVF_TX_AVX512_CTX,
drivers/net/intel/iavf/iavf_rxtx.c +18 -0
@@ -3617,6 +3617,24 @@ static const struct ci_tx_path_info iavf_tx_path_infos[] = { .simd_width = RTE_VECT_SIMD_256 } }, + [IAVF_TX_AVX2_CTX ] = { + .pkt_burst = iavf_xmit_pkts_vec_avx2_ctx, + .info ="Vector AVX2 Ctx" , + .features = { + .tx_offloads =IAVF_TX_VECTOR_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .ctx_desc = true + } + }, + [IAVF_TX_AVX2_CTX_OFFLOAD ] = { + .pkt_burst = iavf_xmit_pkts_vec_avx2_ctx_offload, + .info ="Vector AVX2 Ctx Offload" , + .features = { + .tx_offloads =IAVF_TX_VECTOR_CTX_OFFLOAD_OFFLOADS , + .simd_width =RTE_VECT_SIMD_256 , + .ctx_desc = true + } + }, #ifdef CC_AVX512_SUPPORT [IAVF_TX_AVX512 ] = { .pkt_burst = iavf_xmit_pkts_vec_avx512,
drivers/net/intel/iavf/iavf_rxtx.h +4 -0
@@ -595,6 +595,10 @@ uint16_t iavf_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);uint16_t iavf_xmit_pkts_vec_avx2_offload (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx2_ctx (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx2_ctx_offload (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts);int iavf_get_monitor_addr (void *rx_queue,struct rte_power_monitor_cond *pmc);int iavf_rx_vec_dev_check (struct rte_eth_dev *dev);int iavf_tx_vec_dev_check (struct rte_eth_dev *dev);
drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c +387 -0
393 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v5 3/3 doc: announce change to LLDP packet detection in iavf PMD
In reply to Ciara LoftusThe iavf PMD transmit paths currently use two methods to identify if an mbuf holds an LLDP packet: a dynamic mbuf field and the mbuf ptype. The ptype method is enabled via the enable_ptype_lldp devarg. A future release will remove the dynamic mbuf field approach at which point the ptype will be the only approach used.
--- doc/guides/rel_notes/deprecation.rst | 4 ++++ 1 file changed, 4 insertions(+)
doc/guides/rel_notes/deprecation.rst +4 -0
@@ -154,3 +154,7 @@ Deprecation Notices * bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK. Those API functions are used internally by DPDK core and netvsc PMD. + +* net/iavf: The dynamic mbuf field used to detect LLDP packets on the + transmit path in the iavf PMD will be removed in a future release. + After removal, only packet type-based detection will be supported.
Signature · 1 line
2.43.0
Bruce Richardson
AppliedRe: [PATCH v5 0/3] iavf: LLDP ptype and AVX2 ctx paths
In reply to Ciara LoftusQuoted 19 lines · Ciara Loftus
This series adds another way to detect LLDP packets in the Tx paths of the iavf PMD, which is based on the mbuf packet type field. This is in addition to the existing method of using a dynamic field. The series also adds new AVX2 context descriptor Tx paths that support LLDP. Finally, a deprecation notice is added to the documentation to flag that the dynamic mbuf field method of LLDP packet detection will be removed in a future release.
Patch 1 flags "CHECK:MACRO_ARG_REUSE" in checkpatch for the
IAVF_CHECK_TX_LLDPmacro. This is a false positive because the inputs to the macro are not reused in a way that would cause issues.v5:
* Updated the documentation
* Made the "lldp mode" per-device rather than a global value. This is necessary because the devarg is per-device unlike the global dynfield. The mode is added to the iavf-specific flags in theci_tx_queuestruct so that it can be read for each device on the datapath.
Quoted 5 lines
Ciara Loftus (3):
net/iavf: support LLDP Tx via mbuf ptype or dynfield net/iavf: add AVX2 context descriptor Tx paths
doc: announce change to LLDP packet detection in iavf PMD
Applied to dpdk-next-net-intel.
Thanks,
/Bruce