Ethernet Bridge development
 help / color / mirror / Atom feed
* [PATCH net-next 0/5] net: dsa: microchip: let the bridge decide about link-local frames
@ 2026-11-26  8:07 Oleksij Rempel
  2026-11-26  8:07 ` [PATCH net-next 1/5] net: dsa: tag_ksz: do not mark trapped link-local frames as forwarded Oleksij Rempel
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Oleksij Rempel @ 2026-11-26  8:07 UTC (permalink / raw)
  To: Woojung Huh, UNGLinuxDriver, Andrew Lunn, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Florian Fainelli, Nikolay Aleksandrov, Ido Schimmel,
	netdev, bridge, kernel, Oleksij Rempel

Let the bridge decide about the link-local frames that the KSZ9477
family and LAN937x trap to the CPU. These switches trap most link-local
groups (01:80:C2:00:00:0X, for example STP BPDUs and LLDP), but the
tagger marks the frames as forwarded in hardware. So the bridge never
forwards them to the other ports of the switch, whatever group_fwd_mask
says. An FDB or MDB entry for such a group can also make the switch
forward these frames on its own.

The tagger now leaves these frames unmarked, and the driver keeps FDB
and MDB entries for them out of the hardware. As the bridge then sends
some link-local frames back out through the CPU port, the switch no
longer learns addresses there; DSA adds the addresses that the bridge
learns on its other ports, such as Wi-Fi, as static entries instead. An
old FDB bug hits these entries often, so one patch fixes it; without the
series it needs a static entry added over a learned one, so that patch
goes to net-next with the series. The series goes to net-next as it
changes how the bridge handles link-local frames.

To reproduce on a KSZ9893, with link partners on lan1 and lan2:

  ip link add br0 type bridge
  ip link set lan1 master br0 up; ip link set lan2 master br0 up
  ip link set br0 up
  # 0x4000: forward 01:80:C2:00:00:0E
  ip link set br0 type bridge group_fwd_mask 0x4000
  # Send frames to 01:80:C2:00:00:0E into lan1. Without the series
  # none reach lan2; with it, all do.

With STP off, the bridge now also forwards BPDUs between the ports of
the switch. IEEE 802.1Q says a bridge filters frames to the reserved
addresses, including the BPDU address 01:80:C2:00:00:00. The Linux
bridge forwards BPDUs when STP is off, so that other bridges can still
detect a loop through it; see commit a598f6aebea2 ("bridge: relay
bridge multicast pkgs if !STP"). DSA switches whose tagger leaves
trapped or link-local frames unmarked, such as mv88e6xxx and b53,
already behave this way.

The switches driven by ksz8.c (KSZ8463, KSZ87xx, KSZ88x3, KSZ8864,
KSZ8895, KSZ8995XA) keep their behaviour; KSZ8563 and KSZ8567 use the
KSZ9477 code and are covered. The ksz8.c switches have one static MAC
table. It holds the trap entries, the FDB and MDB entries and the local
addresses of the bridge, and on the KSZ88x3 it has only 8 entries, so a
change on the KSZ88x3 can run out of space. Of these switches I can test
only a KSZ8873, so I left them unchanged. Their taggers still mark all
frames as forwarded.

Tested on a KSZ9893.

---
Oleksij Rempel (5):
      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      | 81 +++++++++++++++++++++++++++++---
 drivers/net/dsa/microchip/ksz_common.h   | 14 ++++++
 drivers/net/dsa/microchip/lan937x_main.c | 16 ++++---
 include/linux/dsa/ksz_common.h           |  8 ++++
 net/dsa/tag_ksz.c                        | 42 ++++++++++++++++-
 5 files changed, 145 insertions(+), 16 deletions(-)
---
base-commit: c2621b518b38ed38e280e008aa33e6c2d302f8cc
change-id: 20261125-ksz-stp-link-local-5c53396cc960

Best regards,
-- 
Oleksij Rempel <o.rempel@pengutronix.de>


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

end of thread, other threads:[~2026-11-26 10:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26  8:07 [PATCH net-next 0/5] net: dsa: microchip: let the bridge decide about link-local frames Oleksij Rempel
2026-11-26  8:07 ` [PATCH net-next 1/5] net: dsa: tag_ksz: do not mark trapped link-local frames as forwarded Oleksij Rempel
2026-11-26  8:07 ` [PATCH net-next 2/5] net: dsa: microchip: ksz9477: do not keep the learned port in FDB entries Oleksij Rempel
2026-11-26  8:07 ` [PATCH net-next 3/5] net: dsa: microchip: ksz9477: do not learn addresses on the CPU port Oleksij Rempel
2026-11-26  8:07 ` [PATCH net-next 4/5] net: dsa: microchip: ksz9477: refuse FDB/MDB entries for trapped groups Oleksij Rempel
2026-11-26  8:07 ` [PATCH net-next 5/5] net: dsa: microchip: ksz9477: report the trapped link-local groups Oleksij Rempel
2026-11-26 10:23 ` [PATCH net-next 0/5] net: dsa: microchip: let the bridge decide about link-local frames Vladimir Oltean

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