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,
willemb@google.com, daniel@makrotopia.org, 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 v2 7/7] net: dsa: microchip: ksz9477: report the trapped link-local groups
Date: Fri, 04 Dec 2026 12:00:55 +0000 [thread overview]
Message-ID: <179638565555.3146.2302994373445562460@kernel.org> (raw)
In-Reply-To: <20261201-ksz-stp-link-local-v2-7-5dd1201d67c6@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] This patch makes the tagger trust dev->link_local_to_cpu when it
decides whether a link-local frame was trapped or flooded by the…
--
net: dsa: microchip: ksz9477: report the trapped link-local groups
This patch adds ksz_tagger_set_link_local_to_cpu(). It copies
dev->link_local_to_cpu into the KSZ tagger data from
ksz9477_connect_tag_protocol() and lan937x_connect_tag_protocol(). The
tagger then stops setting offload_fwd_mark on trapped link-local frames,
so the bridge can forward them to other switch ports.
> diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
> index 7b96d110b1f64..76f08e4dd9235 100644
> --- a/drivers/net/dsa/microchip/ksz_common.h
> +++ b/drivers/net/dsa/microchip/ksz_common.h
[ ... ]
> @@ -836,6 +837,13 @@ static inline bool is_lan937x_tx_phy(struct ksz_device *dev, int port)
> dev->chip_id == LAN9372_CHIP_ID) && port == KSZ_PORT_4;
> }
>
> +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]
Can dev->link_local_to_cpu say that groups are trapped to the CPU when
the switch is not trapping them?
ksz9477_enable_stp_addr() turns on the reserved multicast table through
ksz_cfg(). ksz_cfg() is a void wrapper that drops the return value of
regmap_update_bits():
drivers/net/dsa/microchip/ksz9477.c:ksz9477_enable_stp_addr() {
...
dev->link_local_to_cpu = 0;
/* Enable Reserved multicast table */
ksz_cfg(dev, REG_SW_LUE_CTRL_0, SW_RESV_MCAST_ENABLE, true);
...
}
The loop that follows sets bits each time the per-entry ALU table writes
succeed:
/* Record entry i only after it is written, so that the bitmap
* matches the switch if a later write fails.
*/
if (update == BIT(dev->cpu_port)) {
dev->link_local_to_cpu |=
ksz9477_resv_mcast_link_local[i];
}
Suppose the SW_RESV_MCAST_ENABLE read-modify-write fails at setup and
the later table writes succeed. The switch then ignores the reserved
multicast table and floods those frames as ordinary multicast. The
bitmap still reports groups 00 and 02-0F as trapped to the CPU only. The
comment above holds for the per-entry writes, but not for the global
enable.
ksz9477_setup() and lan937x_setup() also ignore the return value of
ksz9477_enable_stp_addr(), so nothing higher up catches the failure.
With this patch, ksz_tagger_set_link_local_to_cpu() copies that bitmap
into the tagger. ksz_common_rcv()->dsa_link_local_offload_fwd_mark()
then leaves those frames without offload_fwd_mark.
Would the bridge then forward a second copy of frames the hardware has
already flooded? That would affect groups set in group_fwd_mask, and STP
BPDUs when STP is off.
Could the result of the SW_RESV_MCAST_ENABLE update be checked, or the
bit read back, with link_local_to_cpu left at 0 on failure?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201-ksz-stp-link-local-v2-0-5dd1201d67c6%40pengutronix.de
prev parent reply other threads:[~2026-12-04 12:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=179638565555.3146.2302994373445562460@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=bridge@lists.linux.dev \
--cc=daniel@makrotopia.org \
--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=willemb@google.com \
--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