From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385657; b=k9sggWWvmeutENZgdbkG3A9maslf0RdqyeingU0xB//bTqTgkwE0OvQon0S4Ur/Xmcyv tZNqALBFXAz2Mfv2R0kqq5kkIqDtisfe3OitWXjlsG15z503tHHEi/5sYFA7jaGt5x2Mm Sz2W6+0YT9Hx1wX2px53HUVeRNZ1yZ5nPyOPLTokuLBzwNHjFdT+mJz+GSxXF+qcxbU4M 90uZL6QSgC/CkQlZfbae63XfIrxRt5WUHW3mOwH8qP+EF3wWQlZ2vNxzO/x9lYuKUWFz0 zosakSos4Tr+IPhuuaIEFz8geP/V5T+hOobpa8rRK8j8lPa2zfgl9hIY8ln08lMnqXA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385657; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=rBVVw7HBvGOAtaRSQHuA95w5EWttErtcuqT+hRON3ps=; b=A5rbFFG9zKWDtTEWzrFuMpUKYwwRocIEt48yuY4wvxzYB1nOaN1QEjjowvw0dd9p1zBa 3I5d/5bB/yWdc7k/CrwBHyKpuaYCiLZE6fHms3a/FaG+884vWfa6hZK+yF/WAUfe9Wxv+ wJqUPT4CI+x6WPnBwEzj6ugr2p+SOcjAGc0qn0eb6E68xT7T+u/n88OttcJcefofOvaG7 H7hbWiSAkgqX+0cIkhqekSkKn7BNyrzwRupzvYl+t4AHNPi+m1eLc2uNWrCahO3JEoRhE PmncZAcsZmN/ERmxowCpijmnj8dKIYewmz39XNHaJHfec3Jki4YOXSrl02lts0gEYyg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jCEFIjxF; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40100606A330; Fri, 4 Dec 2026 12:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jCEFIjxF Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03F541F00937; Fri, 4 Dec 2026 12:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796385657; bh=rBVVw7HBvGOAtaRSQHuA95w5EWttErtcuqT+hRON3ps=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=jCEFIjxFO/73mXA9o7vJmimpFAtv/etorVQdQ4DNldO26cBYANs2FlLLnCcLjRvAf 7AvCaaVy8/QD8ld/EGpp8vFV79LojuFTpylhzug+H6/A1lMakMh/179+KddrDH64zk lkKL7+ibLn9HjYhmzGYu2esktkNYorNu7UaKvDI6qUxZwOYmu43mQ33xwGDAqV64oD pYo9aPBQgxciACBkClBR3MkuqZkCatp4x4S35r5A0/ErihPfpiTunDOdFcPBbIkciu LWQqDQdZE2WjkVrXJDX48fdVyA/d6y62SI41ECtu9xCRsVx/d4zCKDfi1wEUdJ2rry UbsUwZQErIJFg== Subject: Re: [PATCH net-next v2 7/7] net: dsa: microchip: ksz9477: report the trapped link-local groups 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 Date: Fri, 04 Dec 2026 12:00:55 +0000 Message-ID: <179638565555.3146.2302994373445562460@kernel.org> In-Reply-To: <20261201-ksz-stp-link-local-v2-7-5dd1201d67c6@pengutronix.de> References: <20261201-ksz-stp-link-local-v2-7-5dd1201d67c6@pengutronix.de> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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