On networks of KSZ9893-based devices, we saw frames take unexpected
paths and suspected a loop. With STP off, the KSZ bridges could not
help to find it: unlike a software bridge, they did not relay BPDUs,
so other bridges could not detect a loop through them. With STP on, we
hit other problems, fixed in net-next by the series merged in
6e0542a18a75 ("Merge branch
'net-dsa-make-a-shorter-bridge-ageing-time-take-effect'").
A Linux bridge with STP off relays BPDUs between its ports (commit
a598f6aebea2 ("bridge: relay bridge multicast pkgs if !STP")), and so do
bridges on mv88e6xxx and b53 switches. On the KSZ9477 family and
LAN937x, the switch traps BPDUs to the CPU, and the tagger marks them as
forwarded in hardware, so the bridge never sends them to the other ports
of the switch.
This series leaves trapped link-local frames unmarked, with a new DSA
helper. As a side effect, group_fwd_mask now also works for most other
trapped groups. The other patches handle what follows from that. FDB and
MDB entries for these groups would bypass the trap, so the driver
refuses them. The bridge now sends such frames back through the CPU
port, so the CPU port no longer learns addresses. That makes an old FDB
bug easy to hit; without the series it is hard to hit, so its fix comes
with the series to net-next.
The ksz8.c switches keep their behaviour. On the KSZ88x3 and KSZ8463
the static MAC table has only 8 entries, and of the ksz8.c switches I
can test only a KSZ8873.
To reproduce on a KSZ9893, with link partners on lan1 and lan2:
ip link add br0 type bridge # STP off by default
ip link set lan1 master br0 up; ip link set lan2 master br0 up
ip link set br0 up
# Send BPDUs (01:80:C2:00:00:00) into lan1. Without the series none
# reach lan2; with it, all do.
Tested on a KSZ9893.
Changes in v2:
- Link to v1: https://lore.kernel.org/r/2026…@pengutronix.de
---
Oleksij Rempel (7):
net: dsa: add dsa_link_local_offload_fwd_mark()
net: dsa: tag_mxl862xx: use dsa_link_local_offload_fwd_mark()
net: dsa: tag_ksz: do not mark trapped link-local frames as forwarded
net: dsa: microchip: ksz9477: do not keep the learned port in FDB entries
net: dsa: microchip: ksz9477: do not learn addresses on the CPU port
net: dsa: microchip: ksz9477: refuse FDB/MDB entries for trapped groups
net: dsa: microchip: ksz9477: report the trapped link-local groups
drivers/net/dsa/microchip/ksz9477.c | 103 ++++++++++++++++++++++++++++---
drivers/net/dsa/microchip/ksz_common.c | 9 +++
drivers/net/dsa/microchip/ksz_common.h | 10 +++
drivers/net/dsa/microchip/lan937x_main.c | 10 +--
include/linux/dsa/ksz_common.h | 5 ++
net/dsa/tag.h | 25 ++++++++
net/dsa/tag_ksz.c | 25 +++++++-
net/dsa/tag_mxl862xx.c | 3 +-
8 files changed, 169 insertions(+), 21 deletions(-)
---
base-commit: d7f7fac1c3220a430559c6d43904e27917ae1eb0
change-id: 20261125-ksz-stp-link-local-5c53396cc960
Best regards,
--
Oleksij Rempel <o.re…@pengutronix.de>