patch 'net/ice: fix VLAN stripping in double VLAN mode' has been queued to stable release 23.11.2

Xueming Li xuemingl at nvidia.com
Fri Jul 12 12:44:48 CEST 2024


Hi,

FYI, your patch has been queued to stable release 23.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=91eca591037cf382acca55cbaec9d26d6ea12b76

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 91eca591037cf382acca55cbaec9d26d6ea12b76 Mon Sep 17 00:00:00 2001
From: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
Date: Wed, 27 Mar 2024 18:44:13 +0000
Subject: [PATCH] net/ice: fix VLAN stripping in double VLAN mode
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 882ed13a2a8c3b5cba48c15af710bf09d445094a ]

The ICE hardware can operate in two modes - single VLAN mode or double
VLAN mode. Depending on the operating mode the hardware handles VLAN
header with single VLAN tag differently.  When double VLAN enabled, a
packet with a single VLAN is treated as a packet with outer VLAN only.
Otherwise, a single VLAN in a packet is treated as inner VLAN.

This patch fixes the logic of how VLAN stripping is programmed.

Bugzilla ID: 1402
Fixes: de5da9d16430 ("net/ice: support double VLAN")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/ice/ice_ethdev.c | 45 +++++++++++++++++++++++++-----------
 1 file changed, 32 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 3c3bc49dc2..c1d2b91ad7 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3750,7 +3750,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 	ice_set_tx_function(dev);
 
 	mask = RTE_ETH_VLAN_STRIP_MASK | RTE_ETH_VLAN_FILTER_MASK |
-			RTE_ETH_VLAN_EXTEND_MASK | RTE_ETH_QINQ_STRIP_MASK;
+			RTE_ETH_VLAN_EXTEND_MASK;
+	if (ice_is_dvm_ena(hw))
+		mask |= RTE_ETH_QINQ_STRIP_MASK;
+
 	ret = ice_vlan_offload_set(dev, mask);
 	if (ret) {
 		PMD_INIT_LOG(ERR, "Unable to set VLAN offload");
@@ -4820,19 +4823,35 @@ ice_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 			ice_vsi_config_vlan_filter(vsi, false);
 	}
 
-	if (mask & RTE_ETH_VLAN_STRIP_MASK) {
-		if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP)
-			ice_vsi_config_vlan_stripping(vsi, true);
-		else
-			ice_vsi_config_vlan_stripping(vsi, false);
-	}
+	struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+	if (!ice_is_dvm_ena(hw)) {
+		if (mask & RTE_ETH_VLAN_STRIP_MASK) {
+			if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP)
+				ice_vsi_config_vlan_stripping(vsi, true);
+			else
+				ice_vsi_config_vlan_stripping(vsi, false);
+		}
 
-	if (mask & RTE_ETH_QINQ_STRIP_MASK) {
-		/* Enable or disable outer VLAN stripping */
-		if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP)
-			ice_vsi_config_outer_vlan_stripping(vsi, true);
-		else
-			ice_vsi_config_outer_vlan_stripping(vsi, false);
+		if (mask & RTE_ETH_QINQ_STRIP_MASK) {
+			PMD_DRV_LOG(ERR, "Single VLAN mode (SVM) does not support qinq");
+			return -ENOTSUP;
+		}
+	} else {
+		if ((mask & RTE_ETH_VLAN_STRIP_MASK) |
+				(mask & RTE_ETH_QINQ_STRIP_MASK)) {
+			if (rxmode->offloads & (RTE_ETH_RX_OFFLOAD_VLAN_STRIP |
+						RTE_ETH_RX_OFFLOAD_QINQ_STRIP))
+				ice_vsi_config_outer_vlan_stripping(vsi, true);
+			else
+				ice_vsi_config_outer_vlan_stripping(vsi, false);
+		}
+
+		if (mask & RTE_ETH_QINQ_STRIP_MASK) {
+			if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP)
+				ice_vsi_config_vlan_stripping(vsi, true);
+			else
+				ice_vsi_config_vlan_stripping(vsi, false);
+		}
 	}
 
 	return 0;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-12 18:40:16.985708781 +0800
+++ 0062-net-ice-fix-VLAN-stripping-in-double-VLAN-mode.patch	2024-07-12 18:40:14.146594222 +0800
@@ -1 +1 @@
-From 882ed13a2a8c3b5cba48c15af710bf09d445094a Mon Sep 17 00:00:00 2001
+From 91eca591037cf382acca55cbaec9d26d6ea12b76 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 882ed13a2a8c3b5cba48c15af710bf09d445094a ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -25 +27 @@
-index 53a323ab14..194109b0f6 100644
+index 3c3bc49dc2..c1d2b91ad7 100644
@@ -28 +30 @@
-@@ -3840,7 +3840,10 @@ ice_dev_start(struct rte_eth_dev *dev)
+@@ -3750,7 +3750,10 @@ ice_dev_start(struct rte_eth_dev *dev)
@@ -40 +42 @@
-@@ -4910,19 +4913,35 @@ ice_vlan_offload_set(struct rte_eth_dev *dev, int mask)
+@@ -4820,19 +4823,35 @@ ice_vlan_offload_set(struct rte_eth_dev *dev, int mask)


More information about the stable mailing list