πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26916

Re: [PATCH net-next v2 7/7] net: dsa: microchip: ksz9477: report the trapped link-local groups

#26916
From: netdev-bot+sashiko
Date: Fri, 04 Dec 2026 12:00
89 lines
11395 bytes
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
Technical Details
Message-ID: <179638565555.3146.2302994373445562460@kernel.org>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377319-linux-kernel-netdev=dewy.ru
References: <20261201-ksz-stp-link-local-v2-7-5dd1201d67c6@pengutronix.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377319-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <179638565555.3146.2302994373445562460@kernel.org>
References: <20261201-ksz-stp-link-local-v2-7-5dd1201d67c6@pengutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2756946"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:PrD1xh9wSAp1qrAqYJK7OEJ5ZZs= sha256:4hqiGy+7AWKQlKT+ti6oBpqWWcicDoeMjAYcmSy6kSs=
	sha1:/MQX/HQRe8QuwUrGiMVXDB2CEG4= sha256:aXvr+Fsj8ZhIZJnqR8lVhOifkkZiMsTOw0IBUWA8nwE=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 5E4E9117BD9; Fri,  4 Dec 2026 15:01:12 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.541
X-Spam-Status: No, score=-3.541 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id G67HKIwWsXrz;
	Fri,  4 Dec 2026 15:01:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-377319-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id AB641117B70; Fri,  4 Dec 2026 15:01:00 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 7F53C2E2DF; Fri,  4 Dec 2026 12:00:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796385658;
	b=g39NCskeSHLa0N0rv/tldp0JzNpp6vfeOCJUrF3wunGkuzuZsbRgdYjRQkwmIcPfbod4
	 nBkzJ1l/6Cdy01g5up1pVPHzRwE916VjUdz8lPBMDAmQv8nqLeGvvp5j8/s6lrZOcZpgV
	 +nzozcrUjWQKzO0O47hNh2zyViovjkAbDh79wd3rXgDyUcSrh3a6ejSXEzJnE5QzSXOGO
	 zzvqEvhnr5wMGXMuV7Mip6QbvCHnG6nzDgYZQIKOMU1lnczj6rc4Cpzqptss3/HMXcjw3
	 JB11Kl2MFhNGXk7jNL2WwN6pAsSvc6EBlUHXdSuIJGJ9AMc4WaLfKGGVsQliJBNYGKg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796385658;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=rBVVw7HBvGOAtaRSQHuA95w5EWttErtcuqT+hRON3ps=;
	b=tBkP/Oeg8pLUbqvFkQiwuvTyEgdvmbkpUh750XnKRrmVUXjZKTKtXj0W5AE/C5gd+/kd
	 UPT0cA9Loru65qZhfpARMcOE/PVKkLTFHXSAM3P8+G8noNfBFH/pS/EIvgvFVZxi3ubZr
	 EvJJZQM5gmLZySiDLwOsWq8ufzfZvQWjFvQDr1iK+x6FRgf5YPu8XubvlgNKMYzNssEN5
	 X//ztwiTiuo5Bh5AQwoNh1tE+jnFzwYY4WSMmafn6kj7PmlC+QOkCBxAzBhg/0Wxlhb0U
	 Onx50S7PR2+BC+roCN8+THMAuyAKIpuaZy8X1ofsp5NFqi1CHM8h7B0sF/FNyams7rQ==
X-ARC-Authentication-Results: i=2; 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=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D58D606A336;
	Fri,  4 Dec 2026 12:00:58 +0000 (UTC)
X-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
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-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==
X-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==
X-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
X-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)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03F541F00937;
	Fri,  4 Dec 2026 12:00:55 +0000 (UTC)
X-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==
X-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
X-In-Reply-To: <20261201-ksz-stp-link-local-v2-7-5dd1201d67c6@pengutronix.de>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list