Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: o.rempel@pengutronix.de
Cc: woojung.huh@microchip.com, UNGLinuxDriver@microchip.com,
	andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	horms@kernel.org, f.fainelli@gmail.com, razor@blackwall.org,
	idosch@nvidia.com, netdev@vger.kernel.org,
	bridge@lists.linux.dev, kernel@pengutronix.de
Subject: Re: [PATCH net-next 5/5] net: dsa: microchip: ksz9477: report the trapped link-local groups
Date: Fri, 27 Nov 2026 08:24:38 +0000	[thread overview]
Message-ID: <179576787826.3135.3667519531673258618@kernel.org> (raw)
In-Reply-To: <20261126-ksz-stp-link-local-v1-5-39aed15f6271@pengutronix.de>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] On a bridge with STP disabled, which is the default for a new
  Linux bridge, this patch changes how STP BPDUs are handled.

--

net: dsa: microchip: ksz9477: report the trapped link-local groups

The KSZ9477 family and LAN937x drivers now copy dev->link_local_to_cpu
into the tagger data from their connect_tag_protocol callbacks. As a
result, the tagger stops setting offload_fwd_mark on link-local frames
that the switch traps to the CPU, and the bridge can forward those frames
in software.

> The tagger then no longer marks these frames as
> forwarded in hardware (offload_fwd_mark). The bridge applies
> group_fwd_mask and the STP state to them and can forward them to the
> other ports of the switch.
>
> Tested on a KSZ9893: with the group_fwd_mask bit for 01:80:C2:00:00:0E
> set, the bridge relayed 20 of 20 frames to that group from lan1 to lan2
> with this change, and 0 of 20 without it.

[ ... ]

> diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
> index 7b96d110b1f64..1f96b91016fcf 100644
> --- a/drivers/net/dsa/microchip/ksz_common.h
> +++ b/drivers/net/dsa/microchip/ksz_common.h

[ ... ]

> +static inline void ksz_tagger_set_link_local_to_cpu(struct dsa_switch *ds)
> +{
> +	struct ksz_device *dev = ds->priv;
> +
> +	ksz_tagger_data(ds)->link_local_to_cpu = dev->link_local_to_cpu;

[Severity: Low]
This isn't a bug, but should the commit message mention what this does to
STP BPDUs on a bridge with STP disabled? That is the default for a new
Linux bridge.

ksz9477_enable_stp_addr() programs group 0 (01:80:C2:00:00:00) as
CPU-only, so BIT(0) is always set in the bitmap copied here:

drivers/net/dsa/microchip/ksz9477.c:ksz9477_enable_stp_addr() {
    ...
		if (update == BIT(dev->cpu_port))
			link_local_to_cpu |= ksz9477_resv_mcast_link_local[i];
    ...
}

Once the bitmap reaches the tagger, ksz_common_rcv() skips
dsa_default_offload_fwd_mark() for BPDUs:

net/dsa/tag_ksz.c:ksz_common_rcv() {
    ...
	if (!ksz_link_local_trapped(skb->dev, eth_hdr(skb)->h_dest))
		dsa_default_offload_fwd_mark(skb);
    ...
}

br_handle_frame() then forwards group 0 frames when STP is off:

net/bridge/br_input.c:br_handle_frame() {
    ...
		case 0x00:	/* Bridge Group Address */
			/* If STP is turned off,
			   then must forward to keep loop detection */
			if (p->br->stp_enabled == BR_NO_STP ||
			    fwd_mask & (1u << dest[5]))
				goto forward;
    ...
}

Without offload_fwd_mark, nbp_switchdev_allowed_egress() no longer stops
these frames from egressing the other ports of the same switch.

So a KSZ9477/KSZ9893/LAN937x bridge with stp_state 0 now relays BPDUs
received on one switch port to every other switch port. Before this
change they were dropped between those ports.

External STP switches attached to different KSZ ports will now see each
other's BPDUs. That can change root election and cause ports to be
blocked.

The new behaviour matches the software bridge and the br_input.c comment,
so it looks intended. It is still a visible change in the default
configuration. The message only says "The bridge applies group_fwd_mask
and the STP state to them and can forward them to the other ports of the
switch", and the reported test covers only 01:80:C2:00:00:0E.

Could the message state that BPDUs are now forwarded on bridges with STP
disabled?

> +}

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126-ksz-stp-link-local-v1-0-39aed15f6271%40pengutronix.de

  reply	other threads:[~2026-11-27  8:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 14:47   ` Andrew Lunn
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-27  8:24   ` netdev-bot+sashiko
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-27  8:24   ` netdev-bot+sashiko
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-27  8:24   ` netdev-bot+sashiko
2026-11-26  8:07 ` [PATCH net-next 5/5] net: dsa: microchip: ksz9477: report the trapped link-local groups Oleksij Rempel
2026-11-27  8:24   ` netdev-bot+sashiko [this message]
2026-11-26 10:23 ` [PATCH net-next 0/5] net: dsa: microchip: let the bridge decide about link-local frames Vladimir Oltean
2026-11-27  5:53   ` Oleksij Rempel

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=179576787826.3135.3667519531673258618@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=bridge@lists.linux.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=woojung.huh@microchip.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