Thread (12 messages) 12 messages, 3 authors, 3h ago
HOTtoday

[PATCH net 0/5] net: stmmac: Fix double VLAN 802.1ad tag handling

From: Ovidiu Panait <hidden>
Date: 2026-07-29 09:51:26
Also in: linux-arm-kernel, lkml

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 --

This series addresses the issue for both dwmac4 and dwxgmac2:
- dwmac4: 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.

- dwxgmac2: the RDES3 descriptor does report the type, so the code was
  updated to read it instead of hardcoding ETH_P_8021Q.

Note: patch 5/5 was compile tested only, as I do not have the hardware.
However, it uses the same codepath as dwmac4, so it has the same issue.

Ovidiu Panait (5):
  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 stripping on dwmac4
  net: stmmac: Fix double VLAN stripping on dwxgmac2

 .../ethernet/stmicro/stmmac/dwxgmac2_descs.c  | 15 ++++
 drivers/net/ethernet/stmicro/stmmac/hwif.h    |  8 +-
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 16 +---
 .../net/ethernet/stmicro/stmmac/stmmac_vlan.c | 87 +++++--------------
 4 files changed, 47 insertions(+), 79 deletions(-)

-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help