From: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
To: maxime.chevallier@bootlin.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, mcoquelin.stm32@gmail.com,
alexandre.torgue@foss.st.com, shuah@kernel.org,
joabreu@synopsys.com, jun.ann.lai@intel.com,
yi.fang.gan@intel.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kselftest@vger.kernel.org,
Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Subject: [PATCH net v3 0/5] net: stmmac: Fix double VLAN 802.1ad tag handling
Date: Tue, 25 Aug 2026 16:45:17 +0000 [thread overview]
Message-ID: <20260825164522.4244-1-ovidiu.panait.rb@renesas.com> (raw)
Currently, hardware VLAN stripping is broken for 802.1ad tags. vlan_rx_hw()
hardcodes ETH_P_8021Q when putting the hardware tag into the skb, rather
than using the actual protocol from the packet. Because of this, packets
that contain an 802.1ad outer tag are incorrectly passed up the stack as
having an 802.1Q tag.
This issue was observed on the Renesas RZ/V2H platform (which has a dwmac4
IP), when testing QinQ ping:
# DUT
ip link add link end0 name end0.100 type vlan proto 802.1ad id 100
ip link add link end0.100 name end0.100.200 type vlan proto 802.1q id 200
ip addr add 172.16.3.2/24 dev end0.100.200
ip link set end0 up
ip link set end0.100 up
ip link set end0.100.200 up
# Peer
ip link add link eth0 name eth0.100 type vlan proto 802.1ad id 100
ip link add link eth0.100 name eth0.100.200 type vlan proto 802.1q id 200
ip addr add 172.16.3.1/24 dev eth0.100.200
ip link set eth0 up
ip link set eth0.100 up
ip link set eth0.100.200 up
ping 172.16.3.2
-- FAIL --
Note that this series only fixes the issue on dwmac4. dwxgmac2 has the same
issue but I do not have access to hw to test on.
Since dwmac4 does not expose the tag type in the RDES3 descriptor, it
cannot support hardware double VLAN stripping correctly. This series
disables double VLAN stripping for it, so the 802.1ad tags are left in
place and are handled by the software VLAN path.
v3:
- Dropped patch "net: stmmac: Enable double VLAN processing only when
supported" from this series, as Joseph reported that double VLAN and
S-Tag are separate features, so it would not be correct to gate
everything behind dma_cap.dvlan.
- Moved the selftest to drivers/net/hw, as the _hw test variants couldn't
be run with netdevsim.
- Fixed "ruff check" and "pylint --disable=R" for the VLAN selftest.
- Picked up "Reviewed-by" tags from Maxime.
v2: https://lore.kernel.org/all/20260821170959.79708-1-ovidiu.panait.rb@renesas.com/
- Added a net selftest for VLAN.
- Dropped patch "net: stmmac: Fix double VLAN stripping on dwxgmac2" from
this series, as it was compile tested only and Nazim reported that it
doesn't actually fix the issue on his board. More investigation is
needed on dwxgmac2, but it should not block this series.
- Addressed some issues reported by Sashiko, to fix the advertised STAG
offload features mismatch.
v1: https://lore.kernel.org/all/20260729095110.164157-1-ovidiu.panait.rb@renesas.com/
Ovidiu Panait (5):
net: stmmac: Remove VLAN perfect matching dead code
net: stmmac: Move double VLAN handling to a dedicated op
net: stmmac: Disable double VLAN handling on dwmac4
selftests: drv-net: Move _set_ethtool_feat() into lib
selftests: drv-net: Add VLAN test
drivers/net/ethernet/stmicro/stmmac/hwif.h | 6 +-
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 23 ++--
.../net/ethernet/stmicro/stmmac/stmmac_vlan.c | 81 +++----------
tools/testing/selftests/drivers/net/gro.py | 65 ++++-------
.../testing/selftests/drivers/net/hw/Makefile | 1 +
tools/testing/selftests/drivers/net/hw/config | 1 +
.../drivers/net/hw/lib/py/__init__.py | 3 +-
.../testing/selftests/drivers/net/hw/vlan.py | 109 ++++++++++++++++++
.../selftests/drivers/net/lib/py/__init__.py | 3 +-
.../selftests/drivers/net/lib/py/feat.py | 35 ++++++
10 files changed, 200 insertions(+), 127 deletions(-)
create mode 100755 tools/testing/selftests/drivers/net/hw/vlan.py
create mode 100644 tools/testing/selftests/drivers/net/lib/py/feat.py
--
2.34.1
next reply other threads:[~2026-08-25 16:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 16:45 Ovidiu Panait [this message]
2026-08-25 16:45 ` [PATCH net v3 1/5] net: stmmac: Remove VLAN perfect matching dead code Ovidiu Panait
2026-08-25 16:45 ` [PATCH net v3 2/5] net: stmmac: Move double VLAN handling to a dedicated op Ovidiu Panait
2026-08-28 4:07 ` Joseph Steel
2026-08-25 16:45 ` [PATCH net v3 3/5] net: stmmac: Disable double VLAN handling on dwmac4 Ovidiu Panait
2026-08-25 16:45 ` [PATCH net v3 4/5] selftests: drv-net: Move _set_ethtool_feat() into lib Ovidiu Panait
2026-08-25 16:45 ` [PATCH net v3 5/5] selftests: drv-net: Add VLAN test Ovidiu Panait
2026-08-31 23:49 ` Jakub Kicinski
2026-08-31 23:43 ` [PATCH net v3 0/5] net: stmmac: Fix double VLAN 802.1ad tag handling Jakub Kicinski
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=20260825164522.4244-1-ovidiu.panait.rb@renesas.com \
--to=ovidiu.panait.rb@renesas.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=jun.ann.lai@intel.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=yi.fang.gan@intel.com \
/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