Article View: linux.kernel.netdev
Article #26275Re: [PATCH net-next V4] net: dsa: b53: prefer CPU port 8 for Northstar devices
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 10:35
Date: Thu, 03 Dec 2026 10:35
157 lines
13991 bytes
13991 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2
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] This finding is speculative: it depends on how the hardware
decodes GLOBAL_CONFIG bits [7:6] on BCM5301x.
- [Low] On existing Northstar boards, the new
b53_preferred_default_local_cpu_port()…
- [Low] The comment added in b53_preferred_default_local_cpu_port()
(drivers/net/dsa/b53/b53_common.c:771-773) describes a functional…
--
net: dsa: b53: prefer CPU port 8 for Northstar devices
This adds a preferred_default_local_cpu_port callback to the b53 driver.
On BCM5301x (Northstar) switches it returns port 8 when that port is
configured as a CPU port. DSA then assigns all user ports to port 8
instead of the first CPU port listed in the device tree.
> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
> index ee2d27732c0c8..53625090131e9 100644
> --- a/drivers/net/dsa/b53/b53_common.c
> +++ b/drivers/net/dsa/b53/b53_common.c
> @@ -758,6 +758,32 @@ void b53_disable_port(struct dsa_switch *ds, int port)
> }
> EXPORT_SYMBOL(b53_disable_port);
>
> +static struct dsa_port *b53_preferred_default_local_cpu_port(struct dsa_switch *ds)
> +{
> + struct b53_device *dev = ds->priv;
> + struct dsa_port *cpu_dp;
> +
> + /*
> + * Northstar SoCs devices have 3 Ethernet controllers and 3 CPU ports:
> + * 5 (IMP1), 7, 8 (IMP0). This design was meant for dual IMP setups when
> + * WAN traffic goes to port 5 and LAN traffic goes to port 8.
> + *
> + * While all 3 ports support Broadcom header, ports 5 and 7 have their
> + * limitations. Features that relay on trapping to CPU (e.g. EAP, STP)
> + * won't work when using those as CPU ones.
[Severity: Low]
This comment says STP and EAP trapping don't work when port 5 or 7 is the
CPU port. bcm-ns.dtsi lists port@5 first. That means boards such as
rt-ac3100, rt-ac3200, rt-ac5300 and wxr-1750dhp currently get port 5 as
the default CPU port, and rt-ac88u gets port 7.
If the comment is accurate, isn't this patch a fix for a functional
regression rather than a preference change? The commit message only says
"prefer" and has no Fixes: tag. That makes it hard to tell whether the
patch belongs in net with a Fixes: tag or in net-next.
Could the commit message say what is broken and which change made port
5/7 the default? If there is no functional bug, does the comment overstate
the problem?
This patch also doesn't help boards that enable only port 5 as a CPU port
(most Luxul boards, Netgear R6250, Buffalo WZR-1166DHP, Meraki MR26/MR32,
bcm953012er). Going by the comment, trapping would stay broken on them.
Should the commit message mention that?
> + *
> + * Prefer CPU port 8 if available.
> + */
> + if (is5301x(dev)) {
> + cpu_dp = dsa_to_port(ds, B53_CPU_PORT);
> +
> + if (cpu_dp && dsa_port_is_cpu(cpu_dp))
> + return cpu_dp;
> + }
[Severity: Low]
Does this change the conduit for user ports on existing boards?
dsa_tree_setup_cpu_ports() walks the ports in DT order and gives all user
ports to the first local CPU port. In bcm-ns.dtsi that is port@5 (gmac0).
With this callback in place, ports 5 and 7 are skipped:
net/dsa/dsa.c:dsa_tree_setup_cpu_ports() {
...
if (preferred_cpu_dp && preferred_cpu_dp != cpu_dp)
continue;
...
}
As a result, every user port gets port 8 (gmac2) as its conduit.
These in-tree boards keep more than one CPU port enabled:
bcm47094-asus-rt-ac3100.dtsi (ports 5, 7 and 8; gmac0 -> gmac2)
bcm4709-asus-rt-ac3200.dts
bcm47094-asus-rt-ac5300.dts
bcm4708-buffalo-wxr-1750dhp.dts
bcm47094-asus-rt-ac88u.dts (port 7/gmac1 -> port 8/gmac2)
On these boards, user ports would appear as lan1@eth2 instead of
lan1@eth0. Conduit-specific configuration (MTU, ethtool/tc on the
conduit, distro network scripts) would then apply to a different
interface.
b53 doesn't implement .port_change_conduit, so dsa_user_change_conduit()
returns -EOPNOTSUPP. Users can't restore the previous conduit at runtime
through IFLA_DSA_CONDUIT; the only way back is to edit the DT.
Could the commit message document this user-visible change?
[Severity: Medium]
This one is speculative and depends on how BCM5301x decodes bits [7:6] of
B53_GLOBAL_CONFIG. Does the frame management port setting match the new
default CPU port?
b53_setup() calls b53_enable_cpu_port()->b53_brcm_hdr_setup() for each
CPU port in ascending order. b53_brcm_hdr_setup() only ORs bits in:
drivers/net/dsa/b53/b53_common.c:b53_brcm_hdr_setup() {
...
b53_read8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, &hdr_ctl);
if (port == 8)
hdr_ctl |= GC_FRM_MGMT_PORT_MII;
else if (port == 5)
hdr_ctl |= GC_FRM_MGMT_PORT_M;
b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, hdr_ctl);
...
}
GC_FRM_MGMT_PORT_M is 0xC0 and GC_FRM_MGMT_PORT_MII is 0x80. A switch
with both port 5 and port 8 as CPU ports therefore ends up with 0xC0,
which is the value the driver uses for port 5. No later code clears these
bits.
If 0b11 selects port 5 as the frame management port on BCM5301x, wouldn't
trapped BPDUs and EAP frames still go to port 5/gmac0, while DSA has bound
all user ports to port 8? In that case, should b53_brcm_hdr_setup() clear
GC_FRM_MGMT_PORT_M and then set the IMP0 value for the preferred CPU port?
There is evidence the other way. b53_srab.c names port 5 IMP1 and port 8
IMP0, and the comment above describes a dual IMP design. So 0b11 may mean
dual IMP mode with port 8 still IMP0. Could someone with the BCM5301x
datasheet confirm which encoding applies?
> +
> + return NULL;
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202103450.24657-1-zajec5%40gmail.com
Technical Details
Message-ID:
<179629415059.3146.12960693580750692833@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376479-linux-kernel-netdev=dewy.ruReferences:
<20261202103450.24657-1-zajec5@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376479-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next V4] net: dsa: b53: prefer CPU port 8 for Northstar devices Date: Thu, 03 Dec 2026 10:35:50 +0000 Organization: Usenet Network Message-ID: <179629415059.3146.12960693580750692833@kernel.org> References: <20261202103450.24657-1-zajec5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2460389"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:0iS5xLHMT95zZ67XML59XpoEKC8= sha256:cBrTthMeVoyDEm10l4WiGUoEIrqWPoe/Y/HwmMmOFTo= sha1:p4L2rxNly7AGWfybRZRqdvHGSxk= sha256:vNM830ezeCF2kT70Ewuq8Lp4L0i3sDuoCE8um0gL6SY= 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 976BF1178CB; Thu, 3 Dec 2026 13:36:12 +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 GL9nt5PWnvls; Thu, 3 Dec 2026 13:36:04 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376479-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 69BC21177E7; Thu, 3 Dec 2026 13:35:55 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 7A47128470; Thu, 3 Dec 2026 10:35:53 +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=1796294153; b=sIxqN0hDrSzZZ4II5g3exvKTjn/sw+XfnAudiFERxJVEkfOnD+/gjKdQmTLRuhg/rZor m2BSUCy7l/7y0uUT+i7hYrtDS+8YbfOMbGgXo5A1GgHIfXBVyos+13t+tHdt7UvwwrZQB sFc5TrA+wppPa/H0N4pFJ9NnVD3u+n7/we2Rg/BeGvJyj8QwFLDOziMlHlXcwyt4YP9sX V2jpXudG36sC8Q9Fdek1TRuIEuJLJtWplZBw7H9FApS7h0QWvCihEtOxHNkVncU+6tyVF wbnXuK05mOEn8AsakQLyXinWo+uV091kK5qRBs/qbdlvllGHhEQHIQfyxm+0P3Ae/OA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796294153; 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=fzLJNST0Tp1rAXxcY1wHXHS7xHCl/+8Oz7SMdrZjsKc=; b=hgPaHjFFW52jCaFEjaMrOxz47qvKqcNzaCvRdfCI6aDvwqL033RSEflqpIPakraXBmju hAwYZztL9QDGILW1ibCTm3M4xavrYHnX0D+jTvychAv7Ms6Hqo6jyIUU2cFyVJBPBbqeq AmeokIi5TmVawM8KzlPwbRC4TsnJVAxVHAYXSQKQmMB2iIWqMMGT4cP6hT33FZO70RPcT a2j7XHIEvYe8DRlG2rOf80vMvuRINX5f5e1vl6Vi0aamdsf165tR/zD0LR3CfRl+dBXtd Rc5RB81o29DXwEeJctq8wgwphNRelyv6L1ogWq06zCVqe8qN8bPwA49KbILoBTYwK1Q== 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=e0kCKoRU; 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 0B28A606A334; Thu, 3 Dec 2026 10:35:53 +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=e0kCKoRU 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=1796294152; b=GSiL+JGruV+P5qAKDNhHU8//PhVrxjuDtx0iwHd+IGbDbV94Su7vTLM2Ym1/uKDk5HJE LtCTLx/4JBgDLHd9E/IIAMdsJlnT6vAXtSOUkz0mXigDA/qZsNnwbuSB+zrOXBYLwxAVs andAu30C920heoZqjmI2rb+XiXwpJ19bCapEOAIxjFgCHQsa3bTrGf9kPELgcbWQyxM4Z 2DxE2SgQjBY30j8oo0V1BPgGYV1gdnP7UHX8xziFeDVin12WXWZoxQmQ0xLagpho/vdN2 I6tfDyY6g7tkwbiTotX/2tnNBV1535Xbd6PFumZ5BY//OKZPwr806IpWEygusMKggZA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796294152; 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=fzLJNST0Tp1rAXxcY1wHXHS7xHCl/+8Oz7SMdrZjsKc=; b=LuQvL/Upoj9+ZpdqJeF9sO2mmL1IxZL7pcsEzr8AvD8i6JMQkZdqsa8fzy4Zact9Dd0f HtBm9jMwZ6ojZyIL+y4gFFbgDZLLoj7PEL2SclW/dh/wZE68aRoRxzs7s8cl1wymsdO5J +eW6n8SdnwhfODsmvJv0b+5kKsVRsWk0We2Rf99YbfNeKryFMIdnZbixnOpcSFBaiHoeH q6TUaz/jiZah5VTuV2bPgdlFG9mXH+J2DxeDuoeitg82dZFXR3Fkog9KOy9OqSnqd5y0A sDA0jTKi45yPkKIeZPiUyzxDRcWj7j4+XJJmYoZEhmnc4RShXuUdG/SV+hB7npadQWw== 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=e0kCKoRU; 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 2606F606A322 for <netdev@vger.kernel.org>; Thu, 3 Dec 2026 10:35:51 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18B101F00893; Thu, 3 Dec 2026 10:35:51 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796294151; bh=fzLJNST0Tp1rAXxcY1wHXHS7xHCl/+8Oz7SMdrZjsKc=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=e0kCKoRU1lEQiLert+7UrgczlXbcSK5QnysKHRLREDg8GXSQHf6BBi9m63/N8xh6I NWu7DKHCGwPc9d+tO3wSyvr9qL65MFv8FctXjoJ/HPAzMwBHSMjksIpQcA63Wt91qu BIevuv9/77zAJtlxb1Eal4dzG5yZjGlqGM2mXyEDY07QGBVL5f7W2Av8joYoKklmJP ViMLgiC2RWDZkApsJAsdzLBfsgCW5PWskSjwVEzY34pOkpd8D0vGT5lNzAhGLI9O8K kwgoYpPmhGZxYBP8KiYCOo3ud+FmTNso0NuTVB79iblMXy50IqyrY54K9kDXI4ocKr amkCmoB2mbAng== X-Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, andrew@lunn.ch, olteanv@gmail.com, florian.fainelli@broadcom.com, jonas.gorski@gmail.com, netdev@vger.kernel.org, rosenp@gmail.com, rafal@milecki.pl X-In-Reply-To: <20261202103450.24657-1-zajec5@gmail.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