Now that the dynamic mbuf field method has been removed, packet type is
the only mechanism used to detect LLDP packets on the transmit path.
Using the word 'ptype' in the 'enable_ptype_lldp' devarg is therefore
unnecessary and an implementation detail that no longer needs to be
exposed to users.

Rename the devarg to 'enable_lldp'. The old 'enable_ptype_lldp' name is
rejected with an error directing the user to the new name. This is
considered safe because the old devarg name only featured in one
release.

Signed-off-by: Ciara Loftus <[email protected]>
---
* Hard fail instead of warning when old devarg is used
---
 doc/guides/nics/intel_vf.rst           |  9 +++++++--
 doc/guides/rel_notes/release_26_11.rst |  7 ++++++-
 drivers/net/intel/iavf/iavf.h          |  2 +-
 drivers/net/intel/iavf/iavf_ethdev.c   | 17 +++++++++++++----
 drivers/net/intel/iavf/iavf_rxtx.c     |  2 +-
 5 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/doc/guides/nics/intel_vf.rst b/doc/guides/nics/intel_vf.rst
index e635c1fac2..a075167d5f 100644
--- a/doc/guides/nics/intel_vf.rst
+++ b/doc/guides/nics/intel_vf.rst
@@ -684,10 +684,15 @@ Tx LLDP Testing
 
 To trigger LLDP packet transmission from the VF, set the ``packet_type``
 of the mbuf to ``RTE_PTYPE_L2_ETHER_LLDP``.
-This, in conjunction with enabling the ``enable_ptype_lldp`` devarg
+This, in conjunction with enabling the ``enable_lldp`` devarg
 will cause such packets to be transmitted::
 
-    -a 0000:xx:xx.x,enable_ptype_lldp=1
+    -a 0000:xx:xx.x,enable_lldp=1
+
+.. note::
+
+   The ``enable_lldp`` devarg was previously named ``enable_ptype_lldp``.
+   The old name is no longer accepted.
 
 
 Limitations or Knowing issues
diff --git a/doc/guides/rel_notes/release_26_11.rst 
b/doc/guides/rel_notes/release_26_11.rst
index 8dc82c016d..438610b468 100644
--- a/doc/guides/rel_notes/release_26_11.rst
+++ b/doc/guides/rel_notes/release_26_11.rst
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Updated Intel iavf driver.**
+
+  * Renamed the ``enable_ptype_lldp`` devarg to ``enable_lldp``.
+    The old name is no longer accepted.
+
 
 Removed Items
 -------------
@@ -80,7 +85,7 @@ Removed Items
 * net/iavf: Removed the dynamic mbuf field method for detecting LLDP packets
   on the transmit path, along with the ``set tx lldp on`` testpmd command.
   The only remaining method for detecting LLDP packets is by using the mbuf
-  packet type in conjunction with the ``enable_ptype_lldp`` devarg.
+  packet type in conjunction with the ``enable_lldp`` devarg.
 
 
 API Changes
diff --git a/drivers/net/intel/iavf/iavf.h b/drivers/net/intel/iavf/iavf.h
index 293adaf6c9..dc33ba5a4b 100644
--- a/drivers/net/intel/iavf/iavf.h
+++ b/drivers/net/intel/iavf/iavf.h
@@ -326,7 +326,7 @@ struct iavf_devargs {
        int auto_reconfig;
        int no_poll_on_link_down;
        uint64_t mbuf_check;
-       int enable_ptype_lldp;
+       int enable_lldp;
 };
 
 struct iavf_security_ctx;
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c 
b/drivers/net/intel/iavf/iavf_ethdev.c
index 5d9d889a08..ad30930492 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -45,6 +45,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_LLDP_ARG       "enable_lldp"
 #define IAVF_ENABLE_PTYPE_LLDP_ARG "enable_ptype_lldp"
 uint64_t iavf_timestamp_dynflag;
 int iavf_timestamp_dynfield_offset = -1;
@@ -57,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_LLDP_ARG,
        IAVF_ENABLE_PTYPE_LLDP_ARG,
        NULL
 };
@@ -1029,12 +1031,12 @@ iavf_dev_start(struct rte_eth_dev *dev)
        if (rte_mbuf_dynfield_lookup("intel_pmd_dynfield_tx_lldp", NULL) >= 0)
                PMD_DRV_LOG(WARNING,
                        "Tx LLDP dynamic mbuf field is no longer supported. "
-                       "Use enable_ptype_lldp devarg and packet type 
instead.");
+                       "Use enable_lldp devarg and packet type instead.");
 
        for (uint16_t i = 0; i < dev->data->nb_tx_queues; i++) {
                struct ci_tx_queue *txq = dev->data->tx_queues[i];
                if (txq)
-                       txq->lldp_enabled = adapter->devargs.enable_ptype_lldp;
+                       txq->lldp_enabled = adapter->devargs.enable_lldp;
        }
 
        if (iavf_init_queues(dev) != 0) {
@@ -2523,8 +2525,15 @@ 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 (rte_kvargs_count(kvlist, IAVF_ENABLE_PTYPE_LLDP_ARG) > 0) {
+               PMD_INIT_LOG(ERR, "devarg '%s' has been renamed to '%s'",
+                       IAVF_ENABLE_PTYPE_LLDP_ARG, IAVF_ENABLE_LLDP_ARG);
+               ret = -EINVAL;
+               goto bail;
+       }
+
+       ret = rte_kvargs_process(kvlist, IAVF_ENABLE_LLDP_ARG,
+                                &parse_bool, &ad->devargs.enable_lldp);
        if (ret)
                goto bail;
 
diff --git a/drivers/net/intel/iavf/iavf_rxtx.c 
b/drivers/net/intel/iavf/iavf_rxtx.c
index c15486fa28..e2c8686ab0 100644
--- a/drivers/net/intel/iavf/iavf_rxtx.c
+++ b/drivers/net/intel/iavf/iavf_rxtx.c
@@ -3928,7 +3928,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 (adapter->devargs.enable_ptype_lldp)
+       if (adapter->devargs.enable_lldp)
                req_features.ctx_desc = true;
 
        for (i = 0; i < dev->data->nb_tx_queues; i++) {
-- 
2.43.0

Reply via email to