netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC net 0/2] net: dsa: felix: fix VLAN-unaware reception
@ 2024-12-15 16:33 Robert Hodaszi
  2024-12-15 16:33 ` [PATCH RFC net 1/2] net: dsa: provide a way to exclude switch ports from VLAN untagging Robert Hodaszi
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Robert Hodaszi @ 2024-12-15 16:33 UTC (permalink / raw)
  To: netdev, vladimir.oltean, claudiu.manoil, alexandre.belloni,
	UNGLinuxDriver, andrew, davem, edumazet, kuba, pabeni, horms,
	linux-kernel
  Cc: Robert Hodaszi

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


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

end of thread, other threads:[~2024-12-17 10:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-15 16:33 [PATCH RFC net 0/2] net: dsa: felix: fix VLAN-unaware reception Robert Hodaszi
2024-12-15 16:33 ` [PATCH RFC net 1/2] net: dsa: provide a way to exclude switch ports from VLAN untagging Robert Hodaszi
2024-12-15 16:33 ` [PATCH RFC net 2/2] net: dsa: felix: fix reception from VLAN-unaware ports Robert Hodaszi
2024-12-15 17:09 ` [PATCH RFC net 0/2] net: dsa: felix: fix VLAN-unaware reception Vladimir Oltean
2024-12-16 10:10   ` Robert Hodaszi
2024-12-16 13:51     ` Vladimir Oltean
2024-12-16 14:39       ` Robert Hodaszi
2024-12-16 14:48         ` Vladimir Oltean
2024-12-17 10:15           ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).