Skip to contentSkip to conversation

net/i40e: fix QinQ stripping

PATCH Applied Anurag Mandal 2 participants 5 messages Dec 6, 2025 – Jan 13 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/i40e: fix QinQ stripping

Outer VLAN strip gets disabled when inner VLAN stripping is enabled/disabled after enabling outer VLAN stripping.
This happens because the respective register is overridden by the vsi params update of inner VLAN stripping.

This patch fixes the issue by re-enabling outer VLAN stripping after modification of inner VLAN stripping.

Fixes c52ff36686a4 ("net/i40e: enable QinQ stripping")
---
 drivers/net/intel/i40e/i40e_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/net/intel/i40e/i40e_ethdev.c +10 -0
index b8ce79061b..c8153f3351 100644
@@ -4150,6 +4150,16 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 			i40e_vsi_config_vlan_stripping(vsi, TRUE);
 		else
 			i40e_vsi_config_vlan_stripping(vsi, FALSE);
+
+		/* When VLAN strip is enabled/disabled
+		 * after enabling outer VLAN stripping,
+		 * outer VLAN stripping gets disabled
+		 * as the register gets overridden by
+		 * VLAN's strip vsi param update.
+		 * Hence, re-enable outer VLAN stripping.
+		 */
+		if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP)
+			i40e_vsi_config_outer_vlan_stripping(vsi, TRUE);
 	}
 
 	if (mask & RTE_ETH_VLAN_EXTEND_MASK) {
Signature · 1 line
2.43.0
#1 lore raw
Quoted 29 lines · Anurag Mandal

Outer VLAN strip gets disabled when inner VLAN stripping is enabled/disabled after enabling outer VLAN stripping.
This happens because the respective register is overridden by the vsi params update of inner VLAN stripping.

This patch fixes the issue by re-enabling outer VLAN stripping after modification of inner VLAN stripping.

Fixes c52ff36686a4 ("net/i40e: enable QinQ stripping")
---
 drivers/net/intel/i40e/i40e_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/net/intel/i40e/i40e_ethdev.c +2 -0
index b8ce79061b..c8153f3351 100644
@@ -4150,6 +4150,16 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 			i40e_vsi_config_vlan_stripping(vsi, TRUE);
 		else
 			i40e_vsi_config_vlan_stripping(vsi, FALSE);
+
+		/* When VLAN strip is enabled/disabled

drivers/net/intel/i40e/i40e_ethdev.c i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask) · line 4164

Quoted 10 lines
drivers/net/intel/i40e/i40e_ethdev.c +8 -0
+		 * after enabling outer VLAN stripping,
+		 * outer VLAN stripping gets disabled
+		 * as the register gets overridden by
+		 * VLAN's strip vsi param update.
+		 * Hence, re-enable outer VLAN stripping.
+		 */
+		if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP)
+			i40e_vsi_config_outer_vlan_stripping(vsi, TRUE);
 	}
 

Hi,

to help me test this patch, can you provide a set of instructions as to how to demonstrate the issue with i40e and how to verify the fix?

Thanks,
/Bruce

#2 lore raw

-----Original Message-----

From: Richardson, Bruce <[email protected]<mailto:[email protected]>>

Sent: 11 December 2025 20:11

To: Mandal, Anurag <[email protected]<mailto:[email protected]>>

Subject: Re: [PATCH] net/i40e: fix QinQ stripping

Quoted 74 lines · Anurag Mandal

Outer VLAN strip gets disabled when inner VLAN stripping is

enabled/disabled after enabling outer VLAN stripping.

This happens because the respective register is overridden by the vsi

params update of inner VLAN stripping.

This patch fixes the issue by re-enabling outer VLAN stripping after

modification of inner VLAN stripping.

Fixes c52ff36686a4 ("net/i40e: enable QinQ stripping")

---

 drivers/net/intel/i40e/i40e_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
(quoted diff) +0 -0

b/drivers/net/intel/i40e/i40e_ethdev.c

index b8ce79061b..c8153f3351 100644

--- a/drivers/net/intel/i40e/i40e_ethdev.c

+++ b/drivers/net/intel/i40e/i40e_ethdev.c

(quoted diff) +10 -0
@@ -4150,6 +4150,16 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 
                                        i40e_vsi_config_vlan_stripping(vsi, TRUE);
 
                          else
 
                                        i40e_vsi_config_vlan_stripping(vsi, FALSE);
 
+
 
+                       /* When VLAN strip is enabled/disabled
 
+                       * after enabling outer VLAN stripping,
 
+                       * outer VLAN stripping gets disabled
 
+                       * as the register gets overridden by
 
+                       * VLAN's strip vsi param update.
 
+                       * Hence, re-enable outer VLAN stripping.
 
+                       */
 
+                       if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP)
 
+                                      i40e_vsi_config_outer_vlan_stripping(vsi, TRUE);
 
           }
Quoted 7 lines

Hi,

to help me test this patch, can you provide a set of instructions as to how to demonstrate the issue with

i40e and how to verify the fix?

Hi Bruce,

Thank you for your queries. PFB my response.

Traffic: To observe the issue, one needs QinQ traffic with outer VLAN 802.1ad (0x88A8)/802.1Q(0x8100) and inner VLAN 802.1Q(0x8100).

Instructions :Assuming outer VLAN id as 201, inner vlan can be any other. a. set promisc 0 off

b. vlan set extend on 0

c. vlan set filter on 0

d. vlan set outer tpid 0x88a8 0

e. vlan set inner tpid 0x8100 0

f. vlan set qinq_strip on 0
g. vlan set strip on 0

h.rx_vlan add 201 0

i. set fwd macswap

j. set verbose 8

k. start

Objective: To get both outer and inner VLANs stripped from the incoming double tagged traffic.

Issue:

When outer VLAN strip (qinq_strip) is enabled first[point f) and afterwards, inner vlan strip is enabled[point g], QinQ stripping fails. In verbose o/p we can see incoming packets will still have either type=0x88a8 or 0x8100 VLAN tag present which is the outer VLAN tag.

Verifying Fix:
No change in instruction order. Verbose o/p will show type=0x0800 in incoming order indicating both VLAN tags are removed.

P.S: If traffic type is 0x8100+0x8100, then points d and e are Not needed as when we set VLAN extend, both outer & inner VLAN TPIDs are set to 802.1Q(0x8100) by default.

Also, if inner VLAN strip is enabled first and then outer VLAN strip is set, QinQ stripping happens smoothly and incoming traffic shows type=0x0800.

Thank you.

Regards,

Anurag M

-----Original Message-----

From: Richardson, Bruce <[email protected]<mailto:[email protected]>>

Sent: 11 December 2025 20:11

To: Mandal, Anurag <[email protected]<mailto:[email protected]>>

Subject: Re: [PATCH] net/i40e: fix QinQ stripping

Quoted 63 lines · Anurag Mandal

Outer VLAN strip gets disabled when inner VLAN stripping is

enabled/disabled after enabling outer VLAN stripping.

This happens because the respective register is overridden by the vsi

params update of inner VLAN stripping.

This patch fixes the issue by re-enabling outer VLAN stripping after

modification of inner VLAN stripping.

Fixes c52ff36686a4 ("net/i40e: enable QinQ stripping")

---

 drivers/net/intel/i40e/i40e_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
(quoted diff) +0 -0

b/drivers/net/intel/i40e/i40e_ethdev.c

index b8ce79061b..c8153f3351 100644

--- a/drivers/net/intel/i40e/i40e_ethdev.c

+++ b/drivers/net/intel/i40e/i40e_ethdev.c

(quoted diff) +6 -0
@@ -4150,6 +4150,16 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 
                                        i40e_vsi_config_vlan_stripping(vsi, TRUE);
 
                          else
 
                                        i40e_vsi_config_vlan_stripping(vsi, FALSE);
 
+
 
+                       /* When VLAN strip is enabled/disabled
 
+                       * after enabling outer VLAN stripping,
 
+                       * outer VLAN stripping gets disabled
 
+                       * as the register gets overridden by
 
+                       * VLAN's strip vsi param update.

Review i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask)

Quoted 10 lines
(quoted diff) +4 -0
 
+                       * Hence, re-enable outer VLAN stripping.
 
+                       */
 
+                       if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP)
 
+                                      i40e_vsi_config_outer_vlan_stripping(vsi, TRUE);
 
           }

Hi,

to help me test this patch, can you provide a set of instructions as to how to demonstrate the issue with i40e and how to verify the fix?

Thanks,

/Bruce

Tested-by Acked-by
#3 lore raw
Quoted 157 lines · Anurag

-----Original Message-----

From: Richardson, Bruce <[1][email protected]>

Sent: 11 December 2025 20:11

To: Mandal, Anurag <[2][email protected]>

Subject: Re: [PATCH] net/i40e: fix QinQ stripping

Review i40e_vlan_offload_set(struct rte_eth_dev *dev,

Quoted 43 lines · Anurag Mandal

Outer VLAN strip gets disabled when inner VLAN stripping is

enabled/disabled after enabling outer VLAN stripping.

This happens because the respective register is overridden by the vsi

params update of inner VLAN stripping.

This patch fixes the issue by re-enabling outer VLAN stripping after

modification of inner VLAN stripping.

Fixes c52ff36686a4 ("net/i40e: enable QinQ stripping")

---

 drivers/net/intel/i40e/i40e_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
(quoted diff) +0 -0

b/drivers/net/intel/i40e/i40e_ethdev.c

index b8ce79061b..c8153f3351 100644

--- a/drivers/net/intel/i40e/i40e_ethdev.c

+++ b/drivers/net/intel/i40e/i40e_ethdev.c

(quoted diff) +0 -0
@@ -4150,6 +4150,16 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev,

int mask)

Quoted 1 line

i40e_vsi_config_vlan_stripping(vsi, TRUE);

Quoted 3 lines

else

i40e_vsi_config_vlan_stripping(vsi, FALSE);

Quoted 7 lines
(quoted diff) +4 -0
+
 
+                       /* When VLAN strip is enabled/disabled
 
+                       * after enabling outer VLAN stripping,
 
+                       * outer VLAN stripping gets disabled

Review

Quoted 10 lines
(quoted diff) +5 -0
 
+                       * as the register gets overridden by
 
+                       * VLAN's strip vsi param update.
 
+                       * Hence, re-enable outer VLAN stripping.
 
+                       */
 
+                       if (rxmode->offloads &

RTE_ETH_RX_OFFLOAD_QINQ_STRIP)

Quoted 1 line

+

i40e_vsi_config_outer_vlan_stripping(vsi, TRUE);

Quoted 8 lines
           }

Hi,

to help me test this patch, can you provide a set of instructions as

to how to demonstrate the issue with

Quoted 1 line

i40e and how to verify the fix?

Hi Bruce,

Thank you for your queries. PFB my response.
Traffic: To observe the issue, one needs QinQ traffic with outer VLAN 802.1ad (0x88A8)/802.1Q(0x8100) and inner VLAN 802.1Q(0x8100).

Instructions :Assuming outer VLAN id as 201, inner vlan can be any other.
a. set promisc 0 off

b. vlan set extend on 0

c. vlan set filter on 0

d. vlan set outer tpid 0x88a8 0

e. vlan set inner tpid 0x8100 0

f. vlan set qinq_strip on 0
g. vlan set strip on 0

h.rx_vlan add 201 0

i. set fwd macswap

j. set verbose 8

k. start

Objective: To get both outer and inner VLANs stripped from the incoming double tagged traffic.

Issue:

When outer VLAN strip (qinq_strip) is enabled first[point f) and afterwards, inner vlan strip is enabled[point g], QinQ stripping fails. In verbose o/p we can see incoming packets will still have either type=0x88a8 or 0x8100 VLAN tag present which is the outer VLAN tag.

Verifying Fix:
No change in instruction order. Verbose o/p will show type=0x0800 in incoming order indicating both VLAN tags are removed. P.S: If traffic type is 0x8100+0x8100, then points d and e are Not needed as when we set VLAN extend, both outer & inner VLAN TPIDs are set to 802.1Q(0x8100) by default.

Also, if inner VLAN strip is enabled first and then outer VLAN strip is set, QinQ stripping happens smoothly and incoming traffic shows type=0x0800.

Quoted 8 lines

Thank you.

Regards,

Anurag M

Thanks for the instructions. I've finally got around to testing things and indeed I see the behaviour you described - sending packet with two 0x8100 tags I don't see them stripped unless I reverse the qinq_strip and vlan strip commands. This patch makes it work with both orderings.

#4 lore raw
Quoted 166 lines · Bruce Richardson
Quoted 157 lines · Anurag

-----Original Message-----

From: Richardson, Bruce <[1][email protected]>

Sent: 11 December 2025 20:11

To: Mandal, Anurag <[2][email protected]>

Subject: Re: [PATCH] net/i40e: fix QinQ stripping

Review i40e_vlan_offload_set(struct rte_eth_dev *dev,

Quoted 43 lines · Anurag Mandal

Outer VLAN strip gets disabled when inner VLAN stripping is

enabled/disabled after enabling outer VLAN stripping.

This happens because the respective register is overridden by the vsi

params update of inner VLAN stripping.

This patch fixes the issue by re-enabling outer VLAN stripping after

modification of inner VLAN stripping.

Fixes c52ff36686a4 ("net/i40e: enable QinQ stripping")

---

 drivers/net/intel/i40e/i40e_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
(quoted diff) +0 -0

b/drivers/net/intel/i40e/i40e_ethdev.c

index b8ce79061b..c8153f3351 100644

--- a/drivers/net/intel/i40e/i40e_ethdev.c

+++ b/drivers/net/intel/i40e/i40e_ethdev.c

(quoted diff) +0 -0
@@ -4150,6 +4150,16 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev,

int mask)

Quoted 1 line

i40e_vsi_config_vlan_stripping(vsi, TRUE);

Quoted 3 lines

else

i40e_vsi_config_vlan_stripping(vsi, FALSE);

Quoted 7 lines
(quoted diff) +4 -0
+
 
+                       /* When VLAN strip is enabled/disabled
 
+                       * after enabling outer VLAN stripping,
 
+                       * outer VLAN stripping gets disabled

Review

Quoted 10 lines
(quoted diff) +5 -0
 
+                       * as the register gets overridden by
 
+                       * VLAN's strip vsi param update.
 
+                       * Hence, re-enable outer VLAN stripping.
 
+                       */
 
+                       if (rxmode->offloads &

RTE_ETH_RX_OFFLOAD_QINQ_STRIP)

Quoted 1 line

+

i40e_vsi_config_outer_vlan_stripping(vsi, TRUE);

Quoted 8 lines
           }

Hi,

to help me test this patch, can you provide a set of instructions as

to how to demonstrate the issue with

Quoted 1 line

i40e and how to verify the fix?

Hi Bruce,

Thank you for your queries. PFB my response.
Traffic: To observe the issue, one needs QinQ traffic with outer VLAN 802.1ad (0x88A8)/802.1Q(0x8100) and inner VLAN 802.1Q(0x8100).

Instructions :Assuming outer VLAN id as 201, inner vlan can be any other.
a. set promisc 0 off

b. vlan set extend on 0

c. vlan set filter on 0

d. vlan set outer tpid 0x88a8 0

e. vlan set inner tpid 0x8100 0

f. vlan set qinq_strip on 0
g. vlan set strip on 0

h.rx_vlan add 201 0

i. set fwd macswap

j. set verbose 8

k. start

Objective: To get both outer and inner VLANs stripped from the incoming double tagged traffic.

Issue:

When outer VLAN strip (qinq_strip) is enabled first[point f) and afterwards, inner vlan strip is enabled[point g], QinQ stripping fails. In verbose o/p we can see incoming packets will still have either type=0x88a8 or 0x8100 VLAN tag present which is the outer VLAN tag.

Verifying Fix:
No change in instruction order. Verbose o/p will show type=0x0800 in incoming order indicating both VLAN tags are removed. P.S: If traffic type is 0x8100+0x8100, then points d and e are Not needed as when we set VLAN extend, both outer & inner VLAN TPIDs are set to 802.1Q(0x8100) by default.

Also, if inner VLAN strip is enabled first and then outer VLAN strip is set, QinQ stripping happens smoothly and incoming traffic shows type=0x0800.

Quoted 8 lines

Thank you.

Regards,

Anurag M

Quoted 8 lines

Thanks for the instructions. I've finally got around to testing things and indeed I see the behaviour you described - sending packet with two 0x8100 tags I don't see them stripped unless I reverse the qinq_strip and vlan strip commands. This patch makes it work with both orderings.

Applied to dpdk-next-net-intel