mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Hodaszi <robert.hodaszi@digi.com>
To: netdev@vger.kernel.org, vladimir.oltean@nxp.com,
	claudiu.manoil@nxp.com, alexandre.belloni@bootlin.com,
	UNGLinuxDriver@microchip.com, andrew@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org,
	linux-kernel@vger.kernel.org
Cc: Robert Hodaszi <robert.hodaszi@digi.com>
Subject: [PATCH RFC net 0/2] net: dsa: felix: fix VLAN-unaware reception
Date: Sun, 15 Dec 2024 17:33:32 +0100	[thread overview]
Message-ID: <20241215163334.615427-1-robert.hodaszi@digi.com> (raw)

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


             reply	other threads:[~2024-12-15 16:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-15 16:33 Robert Hodaszi [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241215163334.615427-1-robert.hodaszi@digi.com \
    --to=robert.hodaszi@digi.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®