Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH net v2 0/6] net: stmmac: Fix double VLAN 802.1ad tag handling
@ 2026-08-21 17:09 Ovidiu Panait
  2026-08-21 17:09 ` [PATCH net v2 1/6] net: stmmac: Remove VLAN perfect matching dead code Ovidiu Panait
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Ovidiu Panait @ 2026-08-21 17:09 UTC (permalink / raw)
  To: maxime.chevallier, andrew+netdev, davem, edumazet, kuba, pabeni,
	mcoquelin.stm32, alexandre.torgue, shuah, joabreu, yi.fang.gan,
	jun.ann.lai
  Cc: linux-kernel, netdev, linux-stm32, linux-arm-kernel,
	linux-kselftest, Ovidiu Panait

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.

v2 changes:
- 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 (6):
  net: stmmac: Remove VLAN perfect matching dead code
  net: stmmac: Enable double VLAN processing only when supported
  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 |  26 +++--
 .../net/ethernet/stmicro/stmmac/stmmac_vlan.c |  81 +++-----------
 tools/testing/selftests/drivers/net/Makefile  |   1 +
 tools/testing/selftests/drivers/net/gro.py    |  65 ++++--------
 .../selftests/drivers/net/lib/py/__init__.py  |   3 +-
 .../selftests/drivers/net/lib/py/feat.py      |  37 +++++++
 tools/testing/selftests/drivers/net/vlan.py   | 100 ++++++++++++++++++
 8 files changed, 193 insertions(+), 126 deletions(-)
 create mode 100644 tools/testing/selftests/drivers/net/lib/py/feat.py
 create mode 100755 tools/testing/selftests/drivers/net/vlan.py

-- 
2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-08-24 17:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 17:09 [PATCH net v2 0/6] net: stmmac: Fix double VLAN 802.1ad tag handling Ovidiu Panait
2026-08-21 17:09 ` [PATCH net v2 1/6] net: stmmac: Remove VLAN perfect matching dead code Ovidiu Panait
2026-08-23  7:48   ` Maxime Chevallier
2026-08-21 17:09 ` [PATCH net v2 2/6] net: stmmac: Enable double VLAN processing only when supported Ovidiu Panait
2026-08-23  7:49   ` Maxime Chevallier
2026-08-24  6:47   ` Joseph Steel
2026-08-24 14:06     ` Ovidiu Panait
2026-08-21 17:09 ` [PATCH net v2 3/6] net: stmmac: Move double VLAN handling to a dedicated op Ovidiu Panait
2026-08-23  7:52   ` Maxime Chevallier
2026-08-21 17:09 ` [PATCH net v2 4/6] net: stmmac: Disable double VLAN handling on dwmac4 Ovidiu Panait
2026-08-21 17:09 ` [PATCH net v2 5/6] selftests: drv-net: Move _set_ethtool_feat() into lib Ovidiu Panait
2026-08-21 17:09 ` [PATCH net v2 6/6] selftests: drv-net: Add VLAN test Ovidiu Panait
2026-08-23  0:04   ` Andrew Lunn
2026-08-24 11:50     ` Ovidiu Panait
2026-08-24 17:42       ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox