[PATCH RFC net 0/2] net: dsa: felix: fix VLAN-unaware reception
From: Robert Hodaszi
Date: Sun Dec 15 2024 - 11:34:50 EST
Hello,
This patchset supposed to fix the currently non-working ocelot-8021q
mode of the Felix driver if bridge is VLAN-unaware.
As can see in the commit messages, the driver enables
'untag_vlan_aware_bridge_pvid' to software VLAN untag all packets, but
tagging is only enabled if VLAN-filtering is enabled
(push_inner_tag=1).
Untagging packets from VLAN-unaware bridge ports is wrong, and corrupts
the packets.
It was tempting to simply restore dsa_software_vlan_untag()'s checking
as it was before:
/* Move VLAN tag from data to hwaccel **
if (!skb_vlan_tag_present(skb) && skb->protocol == htons(proto)) {
skb = skb_vlan_untag(skb);
if (!skb)
return NULL;
}
And so untagging only VLAN packets, but that's not really a solution,
VLAN-tagged packets may arrive on VLAN-unaware ports, and those would
get untagged incorrectly.
So I added a way to mark ports as untagged when untagging is enabled,
and return without altering the packet.
Robert Hodaszi (2):
net: dsa: provide a way to exclude switch ports from VLAN untagging
net: dsa: felix: fix reception from VLAN-unaware ports
drivers/net/dsa/ocelot/felix.c | 9 ++++++++-
include/net/dsa.h | 7 +++++++
net/dsa/tag.h | 4 ++++
3 files changed, 19 insertions(+), 1 deletion(-)
--
2.43.0