The enum for VLAN tag placement was badly named, and it's purpose as
described in the comments was unclear. Update the names to be clearer,
and more general for future uses and remove the incorrect comments.

Fixes: 6ea6d67bebfe ("net/intel: support configurable VLAN insertion on Tx")
Cc: [email protected]

Signed-off-by: Bruce Richardson <[email protected]>
---
 drivers/net/intel/common/tx.h             | 14 ++++++--------
 drivers/net/intel/common/tx_scalar.h      |  6 +++---
 drivers/net/intel/i40e/i40e_rxtx.c        |  2 +-
 drivers/net/intel/iavf/iavf_rxtx.c        |  2 +-
 drivers/net/intel/ice/ice_rxtx.c          |  5 +++--
 drivers/net/intel/idpf/idpf_common_rxtx.c |  2 +-
 6 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/net/intel/common/tx.h b/drivers/net/intel/common/tx.h
index 55757d34d7..2d4a8b5d3c 100644
--- a/drivers/net/intel/common/tx.h
+++ b/drivers/net/intel/common/tx.h
@@ -46,20 +46,18 @@
 #define CI_TX_CTX_DESC_IL2TAG2          0x04

 /**
- * L2TAG1 Field Source Selection
- * Specifies which mbuf VLAN field to use for the L2TAG1 field in data 
descriptors.
- * Context descriptor VLAN handling (L2TAG2) is managed by driver-specific 
callbacks.
+ * Enum to specify where a VLAN tag is to be placed for packet Tx.
  */
-enum ci_tx_l2tag1_field {
-       /** For VLAN (not QinQ), use L2Tag1 field in data desc */
-       CI_VLAN_IN_L2TAG1,
+enum ci_l2tag_pos {
+       /** Insert via the data descriptor's L2Tag1 field. */
+       CI_TAG_IN_DATA_DESC,

-       /** For VLAN (not QinQ), use L2Tag2 field in ctx desc.
+       /** Insert via the context descriptor's L2Tag2 field.
         * NOTE: When set, drivers must set the VLAN tag in the context
         * descriptor callback function, rather than relying on the
         * common Tx code to insert it.
         */
-       CI_VLAN_IN_L2TAG2,
+       CI_TAG_IN_CTX_DESC,
 };

 /* Common TX Descriptor Length Field Shifts */
diff --git a/drivers/net/intel/common/tx_scalar.h 
b/drivers/net/intel/common/tx_scalar.h
index 11ab6c08fc..4df279e729 100644
--- a/drivers/net/intel/common/tx_scalar.h
+++ b/drivers/net/intel/common/tx_scalar.h
@@ -372,7 +372,7 @@ static inline uint16_t
 ci_xmit_pkts(struct ci_tx_queue *txq,
             struct rte_mbuf **tx_pkts,
             uint16_t nb_pkts,
-            enum ci_tx_l2tag1_field l2tag1_field,
+            enum ci_l2tag_pos l2tag_pos,
             ci_get_ctx_desc_fn get_ctx_desc,
             const struct ci_ipsec_ops *ipsec_ops,
             const struct ci_timestamp_queue_fns *ts_fns)
@@ -480,10 +480,10 @@ ci_xmit_pkts(struct ci_tx_queue *txq,
                }

                /* Descriptor based VLAN/QinQ insertion */
-               /* for single vlan offload, only insert in data desc with 
VLAN_IN_L2TAG1 is set
+               /* for single vlan offload, only insert in data desc when 
CI_TAG_IN_DATA_DESC is set
                 * for qinq offload, we always put inner tag in L2Tag1
                 */
-               if (((ol_flags & RTE_MBUF_F_TX_VLAN) && l2tag1_field == 
CI_VLAN_IN_L2TAG1) ||
+               if (((ol_flags & RTE_MBUF_F_TX_VLAN) && l2tag_pos == 
CI_TAG_IN_DATA_DESC) ||
                                (ol_flags & RTE_MBUF_F_TX_QINQ)) {
                        td_cmd |= CI_TX_DESC_CMD_IL2TAG1;
                        td_tag = tx_pkt->vlan_tci;
diff --git a/drivers/net/intel/i40e/i40e_rxtx.c 
b/drivers/net/intel/i40e/i40e_rxtx.c
index e29fcff661..ef7041cebd 100644
--- a/drivers/net/intel/i40e/i40e_rxtx.c
+++ b/drivers/net/intel/i40e/i40e_rxtx.c
@@ -1007,7 +1007,7 @@ uint16_t
 i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 {
        /* i40e does not support IPsec or timestamp queues, so pass NULL for 
both */
-       return ci_xmit_pkts(tx_queue, tx_pkts, nb_pkts, CI_VLAN_IN_L2TAG1,
+       return ci_xmit_pkts(tx_queue, tx_pkts, nb_pkts, CI_TAG_IN_DATA_DESC,
                        get_context_desc, NULL, NULL);
 }

diff --git a/drivers/net/intel/iavf/iavf_rxtx.c 
b/drivers/net/intel/iavf/iavf_rxtx.c
index 39bcbebf56..1354e2d6d6 100644
--- a/drivers/net/intel/iavf/iavf_rxtx.c
+++ b/drivers/net/intel/iavf/iavf_rxtx.c
@@ -2605,7 +2605,7 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, 
uint16_t nb_pkts)
        /* IAVF does not support timestamp queues, so pass NULL for ts_fns */
        return ci_xmit_pkts(txq, tx_pkts, nb_pkts,
                            (txq->vlan_flag & 
IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG1) ?
-                               CI_VLAN_IN_L2TAG1 : CI_VLAN_IN_L2TAG2,
+                               CI_TAG_IN_DATA_DESC : CI_TAG_IN_CTX_DESC,
                            iavf_get_context_desc, &ipsec_ops, NULL);
 }

diff --git a/drivers/net/intel/ice/ice_rxtx.c b/drivers/net/intel/ice/ice_rxtx.c
index c4b5454c53..22d1d5d602 100644
--- a/drivers/net/intel/ice/ice_rxtx.c
+++ b/drivers/net/intel/ice/ice_rxtx.c
@@ -3125,10 +3125,11 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf 
**tx_pkts, uint16_t nb_pkts)
        struct ci_tx_queue *txq = (struct ci_tx_queue *)tx_queue;

        if (txq->tsq != NULL && txq->tsq->ts_flag > 0)
-               return ci_xmit_pkts(txq, tx_pkts, nb_pkts, CI_VLAN_IN_L2TAG1,
+               return ci_xmit_pkts(txq, tx_pkts, nb_pkts, CI_TAG_IN_DATA_DESC,
                                get_context_desc, NULL, &ts_fns);

-       return ci_xmit_pkts(txq, tx_pkts, nb_pkts, CI_VLAN_IN_L2TAG1, 
get_context_desc, NULL, NULL);
+       return ci_xmit_pkts(txq, tx_pkts, nb_pkts, CI_TAG_IN_DATA_DESC,
+                       get_context_desc, NULL, NULL);
 }

 static int
diff --git a/drivers/net/intel/idpf/idpf_common_rxtx.c 
b/drivers/net/intel/idpf/idpf_common_rxtx.c
index 2c87e02c98..128ebb6a88 100644
--- a/drivers/net/intel/idpf/idpf_common_rxtx.c
+++ b/drivers/net/intel/idpf/idpf_common_rxtx.c
@@ -1415,7 +1415,7 @@ uint16_t
 idpf_dp_singleq_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                          uint16_t nb_pkts)
 {
-       return ci_xmit_pkts(tx_queue, tx_pkts, nb_pkts, CI_VLAN_IN_L2TAG1,
+       return ci_xmit_pkts(tx_queue, tx_pkts, nb_pkts, CI_TAG_IN_DATA_DESC,
                        idpf_get_context_desc, NULL, NULL);
 }

--
2.53.0

Reply via email to