[PATCH 03/13] net/iavf: use separate params for VLAN and QinQ position

Loftus, Ciara ciara.loftus at intel.com
Mon Sep 14 16:24:25 CEST 2026


> Subject: [PATCH 03/13] net/iavf: use separate params for VLAN and QinQ
> position
> 
> Like is the case with the scalar path, use separate offload parameters
> for the vector path to distinguish between the position of the single
> VLAN tag and the QinQ outer tag. With iavf these are currently always
> the same, but other drivers - with whom we may want to share code - have
> different positions for these.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
>  drivers/net/intel/iavf/iavf_rxtx_vec_avx2.c   | 64 +++++++++++--------
>  drivers/net/intel/iavf/iavf_rxtx_vec_avx512.c | 62 ++++++++++--------
>  drivers/net/intel/iavf/iavf_rxtx_vec_common.h | 13 ++--
>  3 files changed, 79 insertions(+), 60 deletions(-)
> 

<snip>

> diff --git a/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
> b/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
> index 1e9ce924ee..74446fcf4a 100644
> --- a/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
> +++ b/drivers/net/intel/iavf/iavf_rxtx_vec_common.h
> @@ -121,14 +121,13 @@ iavf_tx_vec_dev_check_default(struct rte_eth_dev
> *dev)
> 
>  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, enum ci_l2tag_pos single_vlan_pos,
> +			enum ci_l2tag_pos qinq_outer_pos)
>  {
>  	uint64_t ol_flags = tx_pkt->ol_flags;
>  	uint32_t td_cmd = 0;
>  	uint32_t td_offset = 0;
> 
> -	RTE_SET_USED(vlan_flag);
> -
>  	/* Set MACLEN */
>  	if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)
>  		td_offset |= (tx_pkt->outer_l2_len >> 1)
> @@ -179,12 +178,14 @@ iavf_txd_enable_offload(__rte_unused struct
> rte_mbuf *tx_pkt,
> 
>  	if (ol_flags & RTE_MBUF_F_TX_QINQ) {
>  		td_cmd |= IAVF_TX_DESC_CMD_IL2TAG1;
> -		/* vlan_flag specifies outer tag location for QinQ. */
> -		if (vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG1)
> +		/* L2Tag1 always carries a tag for QinQ: the outer tag if that's
> +		 * where it is placed, otherwise the inner.
> +		 */

Nit: I feel like the sentence after the colon is unnecessary and states the
obvious. Code LGTM.

Acked-by: Ciara Loftus <ciara.loftus at intel.com>

> +		if (qinq_outer_pos == CI_TAG_IN_DATA_DESC)
>  			*txd_hi |= ((uint64_t)tx_pkt->vlan_tci_outer <<
> CI_TXD_QW1_L2TAG1_S);
>  		else
>  			*txd_hi |= ((uint64_t)tx_pkt->vlan_tci <<
> CI_TXD_QW1_L2TAG1_S);
> -	} else if (ol_flags & RTE_MBUF_F_TX_VLAN && vlan_flag &
> IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG1) {
> +	} else if (ol_flags & RTE_MBUF_F_TX_VLAN && single_vlan_pos ==
> CI_TAG_IN_DATA_DESC) {
>  		td_cmd |= CI_TX_DESC_CMD_IL2TAG1;
>  		*txd_hi |= ((uint64_t)tx_pkt->vlan_tci <<
> CI_TXD_QW1_L2TAG1_S);
>  	}


More information about the dev mailing list