DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: KAVYA AV <kavyax.a.v@intel.com>
To: dev@dpdk.org, bruce.richardson@intel.com, aman.deep.singh@intel.com
Cc: shaiq.wani@intel.com, KAVYA AV <kavyax.a.v@intel.com>, stable@dpdk.org
Subject: [PATCH] net/ice: use configured outer TPID for VLAN filter in DVM
Date: Wed, 27 May 2026 16:14:42 +0000	[thread overview]
Message-ID: <20260527161442.394593-1-kavyax.a.v@intel.com> (raw)

In Double VLAN Mode (DVM), the hardware switch recipe
ICE_SW_LKUP_VLAN matches on both the VLAN ID and the TPID.
Previously, ice_vlan_filter_set() always initialized the VLAN
filter with the hardcoded RTE_ETHER_TYPE_VLAN (0x8100), regardless
of the outer TPID configured by the user via vlan_tpid_set().

This caused a mismatch when a non-standard outer TPID such as
0x88a8 (IEEE 802.1ad) was configured: the hardware filter was
programmed with TPID 0x8100 while incoming packets carried TPID
0x88a8, resulting in all such packets being dropped by the VLAN
pruning logic.

Fix this by replacing the hardcoded RTE_ETHER_TYPE_VLAN with
pf->outer_ethertype in the ICE_VLAN() macro call. This field is
already updated by ice_vlan_tpid_set() when the user configures
the outer TPID, and defaults to RTE_ETHER_TYPE_VLAN at
initialization, so the change is safe for standard 802.1q traffic.

In SVM, the TPID is not part of the hardware lookup key, so this
change has no functional impact in that mode.

Fixes: 295b34f55b00 ("net/ice: fix VLAN 0 adding based on VLAN mode")
Cc: stable@dpdk.org

Signed-off-by: KAVYA AV <kavyax.a.v@intel.com>
---
 drivers/net/intel/ice/ice_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index 0f2e7aee14..eaf3354000 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -5038,7 +5038,8 @@ static int
 ice_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 {
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
-	struct ice_vlan vlan = ICE_VLAN(RTE_ETHER_TYPE_VLAN, vlan_id);
+	/* Use the configured outer_ethertype instead of hardcoded 0x8100 */
+	struct ice_vlan vlan = ICE_VLAN(pf->outer_ethertype, vlan_id);
 	struct ice_vsi *vsi = pf->main_vsi;
 	int ret;
 
-- 
2.43.0


             reply	other threads:[~2026-05-27  5:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27 16:14 KAVYA AV [this message]
2026-06-09 10:03 ` [PATCH] net/ice: use configured outer TPID for VLAN filter in DVM Bruce Richardson

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=20260527161442.394593-1-kavyax.a.v@intel.com \
    --to=kavyax.a.v@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=shaiq.wani@intel.com \
    --cc=stable@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