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=1796294152; b=GSiL+JGruV+P5qAKDNhHU8//PhVrxjuDtx0iwHd+IGbDbV94Su7vTLM2Ym1/uKDk5HJE LtCTLx/4JBgDLHd9E/IIAMdsJlnT6vAXtSOUkz0mXigDA/qZsNnwbuSB+zrOXBYLwxAVs andAu30C920heoZqjmI2rb+XiXwpJ19bCapEOAIxjFgCHQsa3bTrGf9kPELgcbWQyxM4Z 2DxE2SgQjBY30j8oo0V1BPgGYV1gdnP7UHX8xziFeDVin12WXWZoxQmQ0xLagpho/vdN2 I6tfDyY6g7tkwbiTotX/2tnNBV1535Xbd6PFumZ5BY//OKZPwr806IpWEygusMKggZA== 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== 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 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 ; Thu, 3 Dec 2026 10:35:51 +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=e0kCKoRU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18B101F00893; Thu, 3 Dec 2026 10:35:51 +0000 (UTC) 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== Subject: Re: [PATCH net-next V4] net: dsa: b53: prefer CPU port 8 for Northstar devices From: netdev-bot+sashiko@kernel.org To: zajec5@gmail.com 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 Date: Thu, 03 Dec 2026 10:35:50 +0000 Message-ID: <179629415059.3146.12960693580750692833@kernel.org> In-Reply-To: <20261202103450.24657-1-zajec5@gmail.com> References: <20261202103450.24657-1-zajec5@gmail.com> X-sashiko-severity: Medium 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 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