In Double VLAN Mode (DVM) i.e. when RTE_ETH_RX_OFFLOAD_VLAN_EXTEND
is enabled iavf_config_vlan_strip_v2() only toggles the inner
VLAN strip setting (0x8100) for the RTE_ETH_RX_OFFLOAD_VLAN_STRIP
offload, while the outer VLAN strip is controlled independently
through the QinQ strip path.

However, in DVM, most hardwares place a single (non-QinQ) VLAN
tag in the outer position
As a result, when a single VLAN packet is received and the
application disables single VLAN tag stripping, only the inner
VLAN tag strip gets turned off and the outer VLAN tag strip
stays enabled.
Hence, the single VLAN tag still gets stripped.
This does not honor the application's request.

This patch fixes the aforesaid case.
When DVM and QinQ stripping are both enabled, also apply the strip
enable/disable to the outer VLAN so that single VLAN packets received
in double VLAN mode respect the single VLAN strip configuration.

Fixes: 8599d7604e0a ("net/iavf: support QinQ strip")
Cc: [email protected]

Signed-off-by: Anurag Mandal <[email protected]>
Tested-by: Ye Chen <[email protected]>
---
V2: Spelling correction in commit message

 .mailmap                            | 1 +
 drivers/net/intel/iavf/iavf_vchnl.c | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/.mailmap b/.mailmap
index 05a55c0bd6..7ac425f800 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1893,6 +1893,7 @@ Yaron Illouz <[email protected]>
 Yaroslav Brustinov <[email protected]>
 Yash Sharma <[email protected]>
 Yasufumi Ogawa <[email protected]> <[email protected]>
+Ye Chen <[email protected]>
 Yehor Malikov <[email protected]>
 Yelena Krivosheev <[email protected]>
 Yerden Zhumabekov <[email protected]> <[email protected]>
diff --git a/drivers/net/intel/iavf/iavf_vchnl.c 
b/drivers/net/intel/iavf/iavf_vchnl.c
index cd6e8325fc..a3cc5459d6 100644
--- a/drivers/net/intel/iavf/iavf_vchnl.c
+++ b/drivers/net/intel/iavf/iavf_vchnl.c
@@ -922,8 +922,13 @@ iavf_config_vlan_strip_v2(struct iavf_adapter *adapter, 
bool enable)
        uint32_t *ethertype;
        int qinq = adapter->dev_data->dev_conf.rxmode.offloads &
                   RTE_ETH_RX_OFFLOAD_VLAN_EXTEND;
+       bool strip_qinq = adapter->dev_data->dev_conf.rxmode.offloads &
+                         RTE_ETH_RX_OFFLOAD_QINQ_STRIP;
        int ret;
 
+       if (qinq && strip_qinq)
+               iavf_config_outer_vlan_strip_v2(adapter, enable);
+
        stripping_caps = &vf->vlan_v2_caps.offloads.stripping_support;
 
        /* When VLAN extend is disabled, Single VLAN mode which is Outer VLAN
-- 
2.34.1

Reply via email to