All of 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>,
	Ciara Loftus <ciara.loftus@intel.com>,
	Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Subject: [PATCH v2 7/7] net/iavf: remove undocumented conditional macros
Date: Thu,  3 Sep 2026 15:37:29 +0100	[thread overview]
Message-ID: <20260903143827.327131-8-bruce.richardson@intel.com> (raw)
In-Reply-To: <20260903143827.327131-1-bruce.richardson@intel.com>

The iavf driver included two #defines which enabled the QinQ and
checksum offload in the code. The intent as documented in code comments
was that any user not taking advantage of these features could remove
the #defines to cut out some code. However, this was never actually
publicly documented, and the use of these defines was never tested in
any builds, making them fragile - if not already broken. Therefore, just
remove these build time macros.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
---
 drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c   |  6 ------
 drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c |  6 ------
 drivers/net/intel/iavf/iavf_rxtx_vec_common.h | 18 ------------------
 3 files changed, 30 deletions(-)

diff --git a/drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c b/drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c
index d05e6101ad..7217f32cef 100644
--- a/drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c
+++ b/drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c
@@ -1910,7 +1910,6 @@ ctx_vtx1(volatile struct ci_tx_desc *txdp, struct rte_mbuf *pkt,
 
 	if (offload) {
 		iavf_fill_ctx_desc_tunneling_avx2(&low_ctx_qw, pkt);
-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
 		if (pkt->ol_flags & RTE_MBUF_F_TX_QINQ) {
 			uint64_t qinq_tag = vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2 ?
 				(uint64_t)pkt->vlan_tci_outer :
@@ -1922,7 +1921,6 @@ ctx_vtx1(volatile struct ci_tx_desc *txdp, struct rte_mbuf *pkt,
 			high_ctx_qw |= IAVF_TX_CTX_DESC_IL2TAG2 << IAVF_TXD_CTX_QW1_CMD_SHIFT;
 			low_ctx_qw |= (uint64_t)pkt->vlan_tci << IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
 		}
-#endif
 	}
 	if (IAVF_CHECK_TX_LLDP(pkt, ptype_lldp_enabled))
 		high_ctx_qw |= IAVF_TX_CTX_DESC_SWTCH_UPLINK << IAVF_TXD_CTX_QW1_CMD_SHIFT;
@@ -1967,7 +1965,6 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
 				((uint64_t)pkt[0]->data_len <<
 					IAVF_TXD_QW1_TX_BUF_SZ_SHIFT);
 
-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
 		if (offload) {
 			/* tunnel fill assigns low_ctx_qw1; must run before QinQ/VLAN OR below */
 			iavf_fill_ctx_desc_tunneling_field(&low_ctx_qw1, pkt[1]);
@@ -1986,11 +1983,9 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
 					(uint64_t)pkt[1]->vlan_tci << IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
 			}
 		}
-#endif
 		if (IAVF_CHECK_TX_LLDP(pkt[1], ptype_lldp_enabled))
 			hi_ctx_qw1 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK << IAVF_TXD_CTX_QW1_CMD_SHIFT;
 
-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
 		if (offload) {
 			/* tunnel fill assigns low_ctx_qw0; must run before QinQ/VLAN OR below */
 			iavf_fill_ctx_desc_tunneling_field(&low_ctx_qw0, pkt[0]);
@@ -2009,7 +2004,6 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
 					(uint64_t)pkt[0]->vlan_tci << IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
 			}
 		}
-#endif
 		if (IAVF_CHECK_TX_LLDP(pkt[0], ptype_lldp_enabled))
 			hi_ctx_qw0 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK << IAVF_TXD_CTX_QW1_CMD_SHIFT;
 
diff --git a/drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c
index bae9b2af9c..bf0245e8f4 100644
--- a/drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c
+++ b/drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c
@@ -2054,7 +2054,6 @@ ctx_vtx1(volatile struct ci_tx_desc *txdp, struct rte_mbuf *pkt,
 
 	if (offload) {
 		iavf_fill_ctx_desc_tunneling_avx512(&low_ctx_qw, pkt);
-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
 		if (pkt->ol_flags & RTE_MBUF_F_TX_QINQ) {
 			uint64_t qinq_tag = vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2 ?
 				(uint64_t)pkt->vlan_tci_outer :
@@ -2066,7 +2065,6 @@ ctx_vtx1(volatile struct ci_tx_desc *txdp, struct rte_mbuf *pkt,
 			high_ctx_qw |= IAVF_TX_CTX_DESC_IL2TAG2 << IAVF_TXD_CTX_QW1_CMD_SHIFT;
 			low_ctx_qw |= (uint64_t)pkt->vlan_tci << IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
 		}
-#endif
 	}
 	if (IAVF_CHECK_TX_LLDP(pkt, lldp_enabled))
 		high_ctx_qw |= IAVF_TX_CTX_DESC_SWTCH_UPLINK
@@ -2109,7 +2107,6 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
 		hi_data_qw0 = hi_data_qw_tmpl |
 				((uint64_t)pkt[0]->data_len << CI_TXD_QW1_TX_BUF_SZ_S);
 
-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
 		if (offload) {
 			/* tunnel fill assigns low_ctx_qw1; must run before QinQ/VLAN OR below */
 			iavf_fill_ctx_desc_tunnelling_field(&low_ctx_qw1, pkt[1]);
@@ -2126,12 +2123,10 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
 					(uint64_t)pkt[1]->vlan_tci << IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
 			}
 		}
-#endif
 		if (IAVF_CHECK_TX_LLDP(pkt[1], lldp_enabled))
 			hi_ctx_qw1 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK
 				<< CI_TXD_QW1_CMD_S;
 
-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
 		if (offload) {
 			/* tunnel fill assigns low_ctx_qw0; must run before QinQ/VLAN OR below */
 			iavf_fill_ctx_desc_tunnelling_field(&low_ctx_qw0, pkt[0]);
@@ -2148,7 +2143,6 @@ ctx_vtx(volatile struct ci_tx_desc *txdp,
 					(uint64_t)pkt[0]->vlan_tci << IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
 			}
 		}
-#endif
 		if (IAVF_CHECK_TX_LLDP(pkt[0], lldp_enabled))
 			hi_ctx_qw0 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK << CI_TXD_QW1_CMD_S;
 
diff --git a/drivers/net/intel/iavf/iavf_rxtx_vec_common.h b/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
index 1538a44892..1e9ce924ee 100644
--- a/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
+++ b/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
@@ -119,31 +119,16 @@ iavf_tx_vec_dev_check_default(struct rte_eth_dev *dev)
 	return ret;
 }
 
-/******************************************************************************
- * If user knows a specific offload is not enabled by APP,
- * the macro can be commented to save the effort of fast path.
- * Currently below 2 features are supported in TX path,
- * 1, checksum offload
- * 2, VLAN/QINQ insertion
- ******************************************************************************/
-#define IAVF_TX_CSUM_OFFLOAD
-#define IAVF_TX_VLAN_QINQ_OFFLOAD
-
 static __rte_always_inline void
 iavf_txd_enable_offload(__rte_unused struct rte_mbuf *tx_pkt,
 			uint64_t *txd_hi, uint8_t vlan_flag)
 {
-#if defined(IAVF_TX_CSUM_OFFLOAD) || defined(IAVF_TX_VLAN_QINQ_OFFLOAD)
 	uint64_t ol_flags = tx_pkt->ol_flags;
-#endif
 	uint32_t td_cmd = 0;
-#ifdef IAVF_TX_CSUM_OFFLOAD
 	uint32_t td_offset = 0;
-#endif
 
 	RTE_SET_USED(vlan_flag);
 
-#ifdef IAVF_TX_CSUM_OFFLOAD
 	/* Set MACLEN */
 	if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)
 		td_offset |= (tx_pkt->outer_l2_len >> 1)
@@ -191,9 +176,7 @@ iavf_txd_enable_offload(__rte_unused struct rte_mbuf *tx_pkt,
 	}
 
 	*txd_hi |= ((uint64_t)td_offset) << CI_TXD_QW1_OFFSET_S;
-#endif
 
-#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
 	if (ol_flags & RTE_MBUF_F_TX_QINQ) {
 		td_cmd |= IAVF_TX_DESC_CMD_IL2TAG1;
 		/* vlan_flag specifies outer tag location for QinQ. */
@@ -205,7 +188,6 @@ iavf_txd_enable_offload(__rte_unused struct rte_mbuf *tx_pkt,
 		td_cmd |= CI_TX_DESC_CMD_IL2TAG1;
 		*txd_hi |= ((uint64_t)tx_pkt->vlan_tci << CI_TXD_QW1_L2TAG1_S);
 	}
-#endif
 
 	*txd_hi |= ((uint64_t)td_cmd) << CI_TXD_QW1_CMD_S;
 }
-- 
2.53.0


  parent reply	other threads:[~2026-09-03 14:39 UTC|newest]

Thread overview: 29+ 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-09-04  8:11       ` Loftus, Ciara
2026-08-31 10:26 ` [PATCH 4/7] net/intel: fix unclear enum names Bruce Richardson
2026-09-03 14:01   ` 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-04  8:14     ` 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   ` Bruce Richardson [this message]
2026-09-04 10:09   ` [PATCH v2 0/7] VLAN and QinQ fixes for iavf 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=20260903143827.327131-8-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=ciara.loftus@intel.com \
    --cc=dev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.