DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	stable@dpdk.org,
	Vladimir Medvedkin <vladimir.medvedkin@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Praveen Shetty <praveen.shetty@intel.com>
Subject: [PATCH 4/7] net/intel: fix unclear enum names
Date: Mon, 31 Aug 2026 11:26:17 +0100	[thread overview]
Message-ID: <20260831102621.495759-5-bruce.richardson@intel.com> (raw)
In-Reply-To: <20260831102621.495759-1-bruce.richardson@intel.com>

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: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 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


  parent reply	other threads:[~2026-08-31 10:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 10:26 [PATCH 0/7] VLAN and QinQ fixes for iavf Bruce Richardson
2026-08-31 10:26 ` [PATCH 1/7] net/iavf: disable broken QinQ strip on Rx Bruce Richardson
2026-09-03 13:58   ` Loftus, Ciara
2026-08-31 10:26 ` [PATCH 2/7] net/iavf: fix VLAN tag placement logic Bruce Richardson
2026-09-03 13:59   ` Loftus, Ciara
2026-08-31 10:26 ` [PATCH 3/7] net/iavf: fix VLAN outer TPID setting on Tx Bruce Richardson
2026-09-03 12:58   ` Loftus, Ciara
2026-09-03 14:27     ` Bruce Richardson
2026-08-31 10:26 ` Bruce Richardson [this message]
2026-09-03 14:01   ` [PATCH 4/7] net/intel: fix unclear enum names Loftus, Ciara
2026-08-31 10:26 ` [PATCH 5/7] net/intel: fix VLAN and QinQ tag position logic Bruce Richardson
2026-09-03 14:04   ` Loftus, Ciara
2026-08-31 10:26 ` [PATCH 6/7] net/iavf: fix missing outer QinQ tag for tunnelled packets Bruce Richardson
2026-09-03 14:07   ` Loftus, Ciara
2026-08-31 10:26 ` [PATCH 7/7] net/iavf: remove undocumented conditional macros Bruce Richardson
2026-08-31 10:58   ` David Marchand
2026-08-31 11:01     ` Bruce Richardson
2026-09-03 14:15   ` Loftus, Ciara
2026-09-03 14:37 ` [PATCH v2 0/7] VLAN and QinQ fixes for iavf Bruce Richardson
2026-09-03 14:37   ` [PATCH v2 1/7] net/iavf: disable broken QinQ strip on Rx Bruce Richardson
2026-09-03 14:37   ` [PATCH v2 2/7] net/iavf: fix VLAN tag placement logic Bruce Richardson
2026-09-03 14:37   ` [PATCH v2 3/7] net/iavf: fix VLAN outer TPID setting on Tx Bruce Richardson
2026-09-03 14:37   ` [PATCH v2 4/7] net/intel: fix unclear enum names Bruce Richardson
2026-09-03 14:37   ` [PATCH v2 5/7] net/intel: fix VLAN and QinQ tag position logic Bruce Richardson
2026-09-03 14:37   ` [PATCH v2 6/7] net/iavf: fix missing outer QinQ tag for tunnelled packets Bruce Richardson
2026-09-03 14:37   ` [PATCH v2 7/7] net/iavf: remove undocumented conditional macros Bruce Richardson

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=20260831102621.495759-5-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=praveen.shetty@intel.com \
    --cc=stable@dpdk.org \
    --cc=vladimir.medvedkin@intel.com \
    /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