From: Stephen Hemminger <stephen@networkplumber.org>
To: Ciara Loftus <ciara.loftus@intel.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2 1/6] net/iavf: fix compilation with VLAN insertion disabled
Date: Wed, 5 Nov 2025 11:31:01 -0800 [thread overview]
Message-ID: <20251105113101.7a6e577f@phoenix> (raw)
In-Reply-To: <20251105152642.2981673-2-ciara.loftus@intel.com>
On Wed, 5 Nov 2025 15:26:37 +0000
Ciara Loftus <ciara.loftus@intel.com> wrote:
> static __rte_always_inline void
> iavf_txd_enable_offload(__rte_unused struct rte_mbuf *tx_pkt,
> - uint64_t *txd_hi, uint8_t vlan_flag)
> + uint64_t *txd_hi,
> +#ifdef IAVF_TX_VLAN_QINQ_OFFLOAD
> + uint8_t vlan_flag)
> +#else
> + __rte_unused uint8_t vlan_flag)
> +#endif
This is not the best way to do this. Adding #ifdef there can confuse
static parsers etc. You can use RTE_SET_USED() macro instead.
The ifdef could be rearranged for clarity as well.
diff --git a/drivers/net/intel/iavf/iavf_rxtx_vec_common.h b/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
index f513777663..dbe7d2b2da 100644
--- a/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
+++ b/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
@@ -166,15 +166,14 @@ static __rte_always_inline void
iavf_txd_enable_offload(__rte_unused struct rte_mbuf *tx_pkt,
uint64_t *txd_hi, uint8_t vlan_flag)
{
+ uint32_t td_cmd = 0;
#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
-#ifdef IAVF_TX_CSUM_OFFLOAD
/* Set MACLEN */
if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)
td_offset |= (tx_pkt->outer_l2_len >> 1)
@@ -240,6 +239,8 @@ iavf_txd_enable_offload(__rte_unused struct rte_mbuf *tx_pkt,
*txd_hi |= ((uint64_t)tx_pkt->vlan_tci_outer <<
IAVF_TXD_QW1_L2TAG1_SHIFT);
}
+#else
+ RTE_SET_USED(vlan_flag);
#endif
*txd_hi |= ((uint64_t)td_cmd) << IAVF_TXD_QW1_CMD_SHIFT;
next prev parent reply other threads:[~2025-11-05 19:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-31 15:22 [PATCH 0/2] Fixes for iavf VLAN insertion offload Ciara Loftus
2025-10-31 15:22 ` [PATCH 1/2] net/iavf: fix AVX-512 double VLAN (QinQ) insertion Ciara Loftus
2025-11-04 17:13 ` Bruce Richardson
2025-11-04 17:16 ` Bruce Richardson
2025-10-31 15:22 ` [PATCH 2/2] net/iavf: fix single VLAN insertion positioning Ciara Loftus
2025-11-04 17:21 ` Bruce Richardson
2025-11-04 17:28 ` Bruce Richardson
2025-11-05 15:26 ` [PATCH v2 0/6] Fixes for iavf VLAN insertion offload Ciara Loftus
2025-11-05 15:26 ` [PATCH v2 1/6] net/iavf: fix compilation with VLAN insertion disabled Ciara Loftus
2025-11-05 19:31 ` Stephen Hemminger [this message]
2025-11-05 15:26 ` [PATCH v2 2/6] net/iavf: remove duplication in AVX-512 VLAN insert logic Ciara Loftus
2025-11-05 15:26 ` [PATCH v2 3/6] net/iavf: ensure correct conditions for AVX-512 VLAN offload Ciara Loftus
2025-11-05 15:26 ` [PATCH v2 4/6] net/iavf: fix single VLAN insertion positioning Ciara Loftus
2025-11-05 15:26 ` [PATCH v2 5/6] net/iavf: fix QinQ insertion for single packet Tx Ciara Loftus
2025-11-05 15:26 ` [PATCH v2 6/6] net/iavf: fix QinQ insertion with mbuf flags VLAN and QINQ Ciara Loftus
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=20251105113101.7a6e577f@phoenix \
--to=stephen@networkplumber.org \
--cc=ciara.loftus@intel.com \
--cc=dev@dpdk.org \
/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;
as well as URLs for NNTP newsgroup(s).