๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23408

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

#23408
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 08:24
108 lines
11708 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] 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
Technical Details
Message-ID: <179576787826.3135.3667519531673258618@kernel.org>
Path: mbox-mo1.pugleaf.net!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-372538-linux-kernel-netdev=dewy.ru
References: <20261126-ksz-stp-link-local-v1-5-39aed15f6271@pengutronix.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!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-372538-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <179576787826.3135.3667519531673258618@kernel.org>
References: <20261126-ksz-stp-link-local-v1-5-39aed15f6271@pengutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="682540"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ImZm9Hvu4ndgLiLJsUJ0liPCx3k= sha256:wVGtT1Yblj34DwiZNxTs7I8IjY9cvqm/DAxkAX8nV/o=
	sha1:TFhnLw/vgUTTFjMNbpAlb57Rn3I= sha256:8yY593AuVvzOCGlEh3Q52bszKlNML0axBWopT8ALSTY=
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 31545125F23; Fri, 27 Nov 2026 11:25:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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] 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 CcSpGoyCq3Vp;
	Fri, 27 Nov 2026 11:24:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-372538-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 6EBA2125F26; Fri, 27 Nov 2026 11:24:50 +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 BC1D226CD0; Fri, 27 Nov 2026 08:24:45 +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=1795767880;
	b=LsC2dgDnBNOo5Ra20DB3u0XlJxg91QshxkNPsHYqCNRULsgXcRxowKodCKZ6CsI7/ifU
	 fwJxrAWpdBOuSWkvJQgy7DVj510IOQeOxynpf3NyP8JK+mmz+JOJbMmIrZyQ9u7T4p415
	 PtskUwlht/KJMWFZ0yc8NzOF7+6SWBhiTROYEyNdTHTCl2jHjuLXiQncuJkwS7NosM6Kp
	 WRwkOlNrA+CPOu+OxFPgOg5MPbdDWN15F9ltJQ/q/jlEl1O5MmQcbnjtcAK0Noi9b4dvE
	 ZFXm+J1tyVCT6Y3GbN3M5i1kQnUk7ZRkon40xiHLl3mnkBY3Z47aMchMQKor8Dqe7Ng==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795767880;
	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=lr72VQlYLYbse8xMFCEioYSpY2HCt7DiUlyT7B5FkDE=;
	b=moEgZdTngrbW9qoQxJFE/0UKy6+OUU32ZJzTWr8+vOLTaePMaY87jWocNOpW61bOGbd7
	 /zAqD2r9XWA7u3U/TVIhAwUzAEJ2aswzSeIqQfaqXNbgmZJycfbaCL1FwoVxVZIHgSQb6
	 i6bnhQZjGKEgD7Q+DKrFBUYXBkCFaM17uRf4s/KNu7sASa4HKALY1gv/nQMkHGFaOF+Vv
	 iDrnVpmou2ZJpp9Sw63T17vFPfPP5ebw4tlNbkDcRcRMsq57BwLHIU4MfxQHPRlcFRFHo
	 Kg2iefcA5Ryl6UjDAfpT0sen8koqmJe/hHdLXjr55qU4hvVskE+B07lpZJcXXgwg13Q==
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=EtV7nIJC;
	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 B7ADD606A333;
	Fri, 27 Nov 2026 08:24:40 +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=EtV7nIJC
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=1795767879;
	b=utMKijw7Qnv5OTQH/VKYlrMQPg4Vei4FVNx0ZL+fugosVn763WhTiCgO9Xoz4g17WCGP
	 kKKR++qhjC0p2Qj7TXQehEEtZ++87tSpHbXXJAQjNBXrne9/9XAube6hnbUTb1b/nj5uV
	 TurN6i0NsEwG+FZ62Zrj3MLmMLDtNWAy1WX0hcOsHxE4/Vy+DzmjCjXuhuFlkhxdHqKx2
	 nl8hhnBxxuWmrmoQG+3ZCI6bZfuvY57eOg6LF6gDqWKZljatmZYEULbRjEiWPHOiNTQ6e
	 VRVFOv6lJFsBwO4HCwjPmJA2so3wdUC/Nal7TH/fZtXypsH34nNIDptYMgPgXoc8msw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795767879;
	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=lr72VQlYLYbse8xMFCEioYSpY2HCt7DiUlyT7B5FkDE=;
	b=eKeGN7EenaoqIdgZEisDBpf+3D6V8tcysmBNM72dGuKNUAQ9OP2kNvoatwWE1PTnKeIn
	 eM+TftcDGJTsl8Zgod+eTaoaySOCPafRF2qZjxsWGvb8NvJhIa1usqKPapSe+bCPGwAIK
	 d2W/xMMbPoP4mT3tI9GE7ZUXnnDY1FEHFO7YF+Z6AxUaJfvtvqL15tHNRvQv2CYMds39Q
	 g8VYi0JBWlLe0qvTr5LJL39sOuNiDkBJRtaoijvItx+SuTWGh3AIVTHU2TfqBE6xuK6gT
	 ZP6un1Lte6uSqTyb9Ft9j/G9Pyv2EOVuOzDTv9qrX6wBzfCVw/VNZWfM7LN1lfKuB1Q==
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=EtV7nIJC;
	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 D8A2B606A339;
	Fri, 27 Nov 2026 08:24:39 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A72961F00897;
	Fri, 27 Nov 2026 08:24:38 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795767879;
	bh=lr72VQlYLYbse8xMFCEioYSpY2HCt7DiUlyT7B5FkDE=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=EtV7nIJCbAPmwBnhnOyspX486wPWX6+speOesWu5b6OJrUo1FpCtiDQVlnfK2lCqr
	 v1dHSpeD+pX+IsxO0MguAS8ipq9PAs8Wga/yCxUHB89Fpmeu2czKDSQpjxpoXnXOqn
	 Lo7MYUmMIgij3QgJNJMq6WkYem4f+sM/tvGPqPRqqy6BVRf6QgkjHi4lsRfrUuzZ0E
	 +IJ0mZVUQuhD19U8gw3UTHpIZpU7aPrlbw5PdsP9ZTACxLhtkfDjA1LBOZajs339Na
	 GzH4rp1kyvBqce/vLygFFXKbDynCBbzZgzIpdNzgAtF4m93WYjqqJUMxKgYWPMDzlH
	 sxB3RVM9Esq6w==
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, 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: <20261126-ksz-stp-link-local-v1-5-39aed15f6271@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