Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/7] net: dsa: microchip: let the bridge decide about link-local frames
@ 2026-12-01 11:59 Oleksij Rempel
  2026-12-01 11:59 ` [PATCH net-next v2 1/7] net: dsa: add dsa_link_local_offload_fwd_mark() Oleksij Rempel
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Oleksij Rempel @ 2026-12-01 11:59 UTC (permalink / raw)
  To: Woojung Huh, UNGLinuxDriver, Andrew Lunn, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Willem de Bruijn, Daniel Golle
  Cc: Simon Horman, Florian Fainelli, Nikolay Aleksandrov, Ido Schimmel,
	netdev, bridge, kernel, Oleksij Rempel

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/20261126-ksz-stp-link-local-v1-0-39aed15f6271@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.rempel@pengutronix.de>


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

end of thread, other threads:[~2026-12-04 12:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 11:59 [PATCH net-next v2 0/7] net: dsa: microchip: let the bridge decide about link-local frames Oleksij Rempel
2026-12-01 11:59 ` [PATCH net-next v2 1/7] net: dsa: add dsa_link_local_offload_fwd_mark() Oleksij Rempel
2026-12-01 11:59 ` [PATCH net-next v2 2/7] net: dsa: tag_mxl862xx: use dsa_link_local_offload_fwd_mark() Oleksij Rempel
2026-12-01 11:59 ` [PATCH net-next v2 3/7] net: dsa: tag_ksz: do not mark trapped link-local frames as forwarded Oleksij Rempel
2026-12-01 11:59 ` [PATCH net-next v2 4/7] net: dsa: microchip: ksz9477: do not keep the learned port in FDB entries Oleksij Rempel
2026-12-01 11:59 ` [PATCH net-next v2 5/7] net: dsa: microchip: ksz9477: do not learn addresses on the CPU port Oleksij Rempel
2026-12-04 12:00   ` netdev-bot+sashiko
2026-12-01 11:59 ` [PATCH net-next v2 6/7] net: dsa: microchip: ksz9477: refuse FDB/MDB entries for trapped groups Oleksij Rempel
2026-12-01 11:59 ` [PATCH net-next v2 7/7] net: dsa: microchip: ksz9477: report the trapped link-local groups Oleksij Rempel
2026-12-04 12:00   ` netdev-bot+sashiko

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