The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: b53: be VLAN unaware when not filtering
@ 2026-08-05  7:26 Semih Baskan
  2026-08-05  7:44 ` Jonas Gorski
  0 siblings, 1 reply; 6+ messages in thread
From: Semih Baskan @ 2026-08-05  7:26 UTC (permalink / raw)
  To: florian.fainelli, jonas.gorski, andrew, olteanv, davem, edumazet,
	kuba, pabeni
  Cc: vladimir.oltean, netdev, linux-kernel

b53 keeps the VLAN table enabled at all times, so a tagged frame whose VID
is not in the table resolves to an empty member set and is dropped before
it reaches the CPU. Documentation/networking/switchdev.rst requires a
standalone port to keep every VLAN configured on top of it working, and a
port that is not filtering to forward frames whose VID is absent from the
table.

Turn the table off in that case. It also selects shared VLAN learning,
which b53_arl_rw_op() already ties to the same flag. Switches with no tag
protocol keep the CPU port tagged in every VLAN and identify the source
port from that tag, so they stay VLAN aware.

b53_configure_vlan() has to stop passing dev->vlan_enabled back in as the
requested state. b53_enable_vlan() stores its result there, so the disabled
state latches and enabling VLAN filtering later would not re-enable the
table.

An 8021q upper on a standalone port is the case that breaks, for example a
PPPoE WAN on VLAN 35. The PADO comes back tagged and is dropped, so no
session comes up and there is no default route.

Tested on an Asus RT-N18U (BCM53011 rev 5) against a PPPoE concentrator on
a VLAN 35 subinterface. pppd timed out waiting for PADO before, and the
session establishes after. With VLAN filtering enabled the table is still
programmed and still enforces port membership.

Fixes: 06cfb2df7eb0 ("net: dsa: don't advertise 'rx-vlan-filter' when not needed")
Cc: stable@vger.kernel.org
Signed-off-by: Semih Baskan <strst.gs@gmail.com>
---
I tried setting ds->needs_standalone_vlan_filtering on hardware first. It is
not sufficient on b53: f089652b6b16 ("net: dsa: b53: do not program vlans
when vlan filtering is off") makes .port_vlan_add return before the hardware
write while filtering is off, so the VID still never reaches the table.
rx-vlan-filter flipped to on and tagged frames were still dropped, 0 of 5.

Relaxing that check instead also works, but only together with the opt-in
above, since without the feature bit 8021q never calls .port_vlan_add at
all. Making the port VLAN unaware follows the same switchdev rule that
commit cites.

I also checked the case where another bridge on the same chip has
vlan_filtering=1, since b53 sets vlan_filtering_is_global. DSA offloads the
uppers on the standalone port too, so rx-vlan-filter goes on there and the
tagged frames keep arriving. This patch cannot execute in that state.

 drivers/net/dsa/b53/b53_common.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 3f5b9592794d..76378afe4993 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -385,6 +385,9 @@ static void b53_enable_vlan(struct b53_device *dev, int port, bool enable,
 {
 	u8 mgmt, vc0, vc1, vc4 = 0, vc5;
 
+	if (!enable_filtering && dev->tag_protocol != DSA_TAG_PROTO_NONE)
+		enable = false;
+
 	b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
 	b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL0, &vc0);
 	b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL1, &vc1);
@@ -916,7 +919,7 @@ int b53_configure_vlan(struct dsa_switch *ds)
 		b53_do_vlan_op(dev, VTA_CMD_CLEAR);
 	}
 
-	b53_enable_vlan(dev, -1, dev->vlan_enabled, dev->vlan_filtering);
+	b53_enable_vlan(dev, -1, true, dev->vlan_filtering);
 
 	/* Create an untagged VLAN entry for the default PVID in case
 	 * CONFIG_VLAN_8021Q is disabled and there are no calls to

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

end of thread, other threads:[~2026-08-06 11:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05  7:26 [PATCH net] net: dsa: b53: be VLAN unaware when not filtering Semih Baskan
2026-08-05  7:44 ` Jonas Gorski
2026-08-05  9:50   ` Semih Baskan
2026-08-06 10:23   ` Vladimir Oltean
2026-08-06 11:08     ` Semih Baskan
2026-08-06 11:09     ` Jonas Gorski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox