🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23302

Re: [PATCH net-next v14 12/15] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D

#23302
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 03:00
117 lines
12620 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] On family D, rtl8365mb_setup() sets ds->max_num_bridges = 1
  (drivers/net/dsa/realtek/rtl8365mb_main.c:3859) and treats it as a…

--

net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D

This patch teaches the rtl8365mb table and L2 code about the family D
(RTL8367S-VB) LUT layout. It also uses port-based FID to isolate an
offloaded VLAN-unaware bridge in FID 1 from standalone ports in FID 0.
On family D, fdb_isolation is no longer advertised and max_num_bridges is
set to 1.

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index cf06bc94c6029..bf508edc1ad96 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c

[ ... ]

> @@ -3670,9 +3841,23 @@ static int rtl8365mb_setup(struct dsa_switch *ds)
>  		goto out_teardown_irq;
>  
>  	ds->assisted_learning_on_cpu_port = true;
> -	ds->fdb_isolation = true;
> -	/* The EFID is 3 bits, but EFID 0 is reserved for standalone ports */
> -	ds->max_num_bridges = FIELD_MAX(RTL8365MB_EFID_MASK);
> +	if (!rtl8365mb_is_d(priv)) {
> +		ds->fdb_isolation = true;
> +		/* The EFID is 3 bits, but EFID 0 is reserved for standalone */
> +		ds->max_num_bridges = FIELD_MAX(RTL8365MB_EFID_MASK);
> +	} else {
> +		/* No EFID; FID 0 is used by standalone ports and FID 1 by the
> +		 * offloaded VLAN-unaware bridge via port-based FID, so allow
> +		 * at most one offloaded bridge. The bridge number it gets is
> +		 * what rtl8365mb_port_set_efid() takes as "offloaded" to
> +		 * enable port-based FID, so max_num_bridges must not be 0.
> +		 * Bridge numbers are allocated system-wide by DSA, so this
> +		 * does not stop a bridge that already has a number from
> +		 * another switch from being offloaded here as well; such
> +		 * bridges share FID 1 (known limitation).
> +		 */
> +		ds->max_num_bridges = 1;

[Severity: Medium]
Does max_num_bridges = 1 actually mean "at most one offloaded bridge" on
this switch?

DSA treats max_num_bridges as an upper bound on bridge numbers, and those
numbers come from a single system-wide bitmap:

net/dsa/dsa.c:dsa_bridge_num_get() {
    ...
	if (!bridge_num) {
		bridge_num = find_next_zero_bit(&dsa_fwd_offloading_bridges,
						DSA_MAX_NUM_OFFLOADING_BRIDGES,
						1);
		if (bridge_num > max)
			return 0;
    ...
}

If it returns 0, dsa_port_bridge_create() fails with "Range of offloadable
bridges exceeded" and -EOPNOTSUPP, and dsa_user_changeupper() falls back
to software bridging.

Here is one case. Another DSA switch in a different tree already offloads
a bridge holding bridge number 1. A new bridge built only from
RTL8367S-VB ports then gets number 2. Since 2 > 1, it is refused, and this
switch cannot offload any bridge at all, so all bridged traffic goes
through the CPU.

Whether offload works then depends on the order in which unrelated
switches allocated numbers. It can also change as bridges are deleted and
their numbers freed.

The comment above, and this part of the commit message, describe only the
opposite outcome of the same mismatch:

  DSA allocates bridge numbers system-wide, so this does not stop a
  bridge that already has a number from another switch from being
  offloaded here as well; such bridges share FID 1, a known limitation.

rtl83xx_port_bridge_join() passes any non-zero bridge.num to
port_set_efid(), which maps it to FID 1 on family D. It does not enforce
the one-bridge-per-switch limit itself.

Would it work better to keep max_num_bridges at a larger value? On family
D, port_bridge_join could then return -EOPNOTSUPP when another port of
this switch already offloads a different bridge, which would avoid both
outcomes.

At minimum, could the comment and the commit message say that on
multi-switch systems this switch may be unable to offload any bridge?

This code is unchanged at the end of the series, in "net: dsa: realtek:
rtl8365mb: add support for RTL8367S-VB".

> +	}
>  
>  	ds->configure_vlan_while_not_filtering = true;
>

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/874b29a3-f47f-4bf2-a0f6-2f9fea712f4c%40yahoo.com
Technical Details
Message-ID: <179574842518.3135.934343295203099061@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372419-linux-kernel-netdev=dewy.ru
References: <f431815c-e496-49b4-9231-c82694b12032@yahoo.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372419-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v14 12/15] net: dsa: realtek: rtl8365mb: make
 L2/LUT access work on family D
Date: Fri, 27 Nov 2026 03:00:25 +0000
Organization: Usenet Network
Message-ID: <179574842518.3135.934343295203099061@kernel.org>
References: <f431815c-e496-49b4-9231-c82694b12032@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="623981"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:FOPfMMxteRMsyMUbHTaHTfzO/vA= sha256:WNqFsVOI6Bqd6bUschzJe6VHldlRbr2Zt9wTPVXbLZw=
	sha1:gFBRnNHrwv6NiQDuFBWTAKxFH40= sha256:PTCefm2/DKivweVtlc6aTmLfG6VW+amBSxmiKrh2kPE=
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 323BB125F04; Fri, 27 Nov 2026 06:01:09 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[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 G95b6MqssWwf;
	Fri, 27 Nov 2026 06:01:05 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-372419-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id B7B57125F0D; Fri, 27 Nov 2026 06:00:57 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 2F013607D42; Fri, 27 Nov 2026 03:00:57 +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=1795748438;
	b=eMhmTieb3BXmfjbFosAh5bTU9WW3RC8OyU/JG3MRUHuM4E/R5NDvqYvUbi7CXTMnQvb6
	 d8sprazXDlQVMo/6cy5F4ffxguJ566BaevYmw2+uV2blPoeibd7fwhK9qk5Z9ot6DHrpJ
	 wq1dTST2jLl1bz5JIAaw2rlqvgqcfeAikGuHxM62Tvo6/Qkk0i271W80x38/TNkJ5xdMG
	 ewcr9/vlvrZtBMlebId/z9kTwGQs5J5mHKZrnCqygHnoVN8EZS5RkFs2rE1L5WX9fauzF
	 DcKmtq3ZGos6eJWZVY7/f6/Xmum9XBwUoDUbEe3dwIzAvIwyIU+a1SiuGnbEOsmUU6w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795748438;
	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=aRMLz3ppAQKSOD+SaAUhWG6aoetplzaPJg8cpk5PQPY=;
	b=dkIdIZJ/MRz8TlS3t4vNtq3F+vXsofrsmgL3DE5qwPiTlqKG6llZBugEsvV6M1I5h83j
	 mZqdcXnhRzDVp9x7ml0Z/n5wg4icv5CnXQth8TUZf6eFl6r+szcuL57RF7+Kz41+HpMRj
	 OE/K7sPswx1AMvnuUob0bNdR5iCzefU8nrlg53aNrQ0i2BomTqjif1ZXhGTlQQock0K0L
	 Pe3Ut4uyynlHBs7xYh5P2LPjO2f7ZER1d+Uf8mxQx8FyFOESXKD9K4wCt1WeZ7RDCIZqV
	 pIuAptHP8glmimKH9vDM7pvL69Je+zKbP8FLPx55c70brgWHWOYNplPALGy2hixm9sA==
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=LGqUIq2H;
	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 3CFC3606A32C;
	Fri, 27 Nov 2026 03:00:38 +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=LGqUIq2H
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=1795748427;
	b=zikaDwVfJFQ2N5L+eTezLGlDoIpSKrHiBzSz+G7hHyQMgkbOzINtcWp01tsxj6FbW+Ap
	 dY2T4rpHHiKQjBK4hq/hDrvU50njDC+RJG9O8p0QalYLB/jj35xTRLJyE3czfHviBnaAu
	 6WP968OvmjgQABOsd4phSIIefMG6lnx24kMtiQGlaXtThtifydhdFKjIv9F9S4zrYtNsk
	 JMsckm6qyqyGp13KDhoo2ntRWOiYQkf8PZbkPBfng+Vc6gLCmj29XyFMRlM6ogR4ikF4B
	 LR7jgh5swrb80NacjatO+xN96nDLZq3J+FYwx2IzWltWO+T0cxfjrXNuiTs5JFzrHkw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795748427;
	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=aRMLz3ppAQKSOD+SaAUhWG6aoetplzaPJg8cpk5PQPY=;
	b=AfgSCxNIzAOuz6KGG7tvV58aXWCqPVkyd9/dHWUxeQNsNmmauY9ORBuPKPb6/+0dBjr4
	 EQgQNbWqErL2w7jaVHq6jb02I1TC4QqnVXf+z3W/NZLJdcYrmNbGmQDLMLoc8orO835VR
	 FAe8VgGpxqOfihGzKiKMHocrxrci8MbfAlUt1TrnKCeBV7H1bAf2GReG67y3O81h7G005
	 8CQUP2S7TCerqK2zV+U0JiEsXPCybcVVLMnYdn8nVBfO8EMjA53BCZZInpSzStF49NDbq
	 gB+6AlR2Xck+wBZQzrD/0NlrPC7mPdj9cxFNnbOLjBFAZfFqi2hfUJ7kSI3wZRxQDJA==
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=LGqUIq2H;
	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 5B615606A681;
	Fri, 27 Nov 2026 03:00:27 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A01A1F0093B;
	Fri, 27 Nov 2026 03:00:25 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795748426;
	bh=aRMLz3ppAQKSOD+SaAUhWG6aoetplzaPJg8cpk5PQPY=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=LGqUIq2HGhs/nkoP3CocEzjTyhsYaHODC25JZ7WVjojOnlgt/sZQvUc377uUWnJRH
	 Nribv+Hcul53Pl0Vtk5dgR/QR6SnM4grdSTHcWu05WQ+B3U0mRVcLhh0fvsxWf1N7u
	 CaI41ZCiNlgrPA4zfYtUxBaF9cxpSV3Jt5kYWrpWA3Wab6+L5MOEt1c/ORnXJMYDA8
	 RWshg/xlC/o4iecjT/k/eXKGrQ7Ae3bn7HU82KeC/vzaUuIoRqfH0N+Npftv2HXJC3
	 M/vJO1R5hgQT0UkpBeiBdzFB9nBUokgOSPP/O2JHdTn13m+5ZEV8ByhshD2skLfsLR
	 7IqWHzftXHdxQ==
X-Cc: linusw@kernel.org, andrew@lunn.ch, olteanv@gmail.com, kuba@kernel.org,
 davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
 linux@armlinux.org.uk, luizluca@gmail.com, maxime.chevallier@bootlin.com,
 netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
 alvin.sipraga@analog.com, gusfmora@gmail.com, kuncy7@gmail.com,
 fabianotassotti@gmail.com, gabonpivovich@gmail.com, contact@c127.dev,
 o.rempel@pengutronix.de
X-In-Reply-To: <f431815c-e496-49b4-9231-c82694b12032@yahoo.com>
X-sashiko-severity: Medium
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