Re: [PATCH RFC net 0/2] net: dsa: felix: fix VLAN-unaware reception

From: Vladimir Oltean
Date: Sun Dec 15 2024 - 12:09:41 EST


On Sun, Dec 15, 2024 at 05:33:32PM +0100, Robert Hodaszi wrote:
> 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.

Give me an example traffic pattern, Linux configuration and corruption,
please. I spent a lot of time trying to make sure I am not introducing
regressions, and I have no idea what you are seeing that is wrong.
Please don't try to make assumptions, just let me see what you see.