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=1796255938; b=KW3+xnjahKFA5xnz/dfLMwj8RUg4uq4+GWdLwTBFDmgTAPcdgODKQDvMiNi29o80GZxq 2KkhaiyooCrTBQ5vaKY/ZT1rz6GE7xpCKNC0lR6+0oMWqpgbaaImFBK5JJibggCYK/qyu 1weUy389FzLFqx7hoAI2NuJ62Ke5QsVoSmXw7sjMI36fYQ97pVm7WvL2EzLoZkk69xcws kV4wt5zzS0U6u8GseyC6goU8DscW3L/HqcG/deVOliPvsI14FLyoMDmuaQP2Mhdd80SsF GmfMripnbloQS5SyE+qMrObRX0i/S5aYt7zecUFWwyskGFv81nRSln6+KlrfqezzXUw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796255938; 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=I4jvYzkg+BCQ+KC91UH3bAFQVkF2xX9JjeEzdMhj9iM=; b=NMPwSDD5KS7V7P4H4pNI29tKEAu22pMhYGDFRn2rS4P1v8rrZ63rcBgIHlDGoBwCabZa 9c9jZKkeNoU1N45C+zifKERSdmJoOhkhTbPFz4oF9vjYVpU7A+mACoJqFmKeEzh8+A3ny 9Wdlyia+F3OtGyHm5gvj0xImc4p4hKZNFPyPqeMywX0sUPTJ+zgjEM1d9JWc7+IqYdC0I bO55VyvVx+fPWED1lbx0k2RQjctSpZBfDJVqKObEyAyYcus/tNVbJkwPsQWRxIW9CFCSn vZiSx/6ltPq1Vf0oQRlyfEcqbw8sM0zEU5RFslrfNPRIZbtfw5DKiyQOCf1b2PnxFzA== 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=Pt7KhU1C; 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 9DB24606A685; Wed, 2 Dec 2026 23:58:58 +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=Pt7KhU1C Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A7711F00919; Wed, 2 Dec 2026 23:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796255938; bh=I4jvYzkg+BCQ+KC91UH3bAFQVkF2xX9JjeEzdMhj9iM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Pt7KhU1CHDoPFDoO7grGLamZa1Aecj1AYCzYvxPj6FJwk9cxNqum/g0HOM2grVnUk 7W+IXWbn2ra8vSvsWCA0cHiCKyHyzRWURNfePtyDpLxVH/qI+JG6PkIJKK9TIILu7n WV6MBeBoHo3RSXNIcw0CjPDgLHoVrU4GxSkJ+fnYGxwq0ADtx9rnaEA8o4/I7/nZJf Xu0djkMgJEMf9jkd0lrEaXNNm32G5utcyyC8/hvCUBy5qkB3eWriSZ19bZuF0xjlx1 U6S5KbKQmJcNtgBNfRjTfV6qFgTBRCmqW8iXLGDSd+gxwgfxAG6P4ZOose1FVgp/1U /xON2Wbb6/RKw== Subject: Re: [PATCH net-next v18 12/15] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D From: netdev-bot+sashiko@kernel.org To: namiltd@yahoo.com 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 Date: Wed, 02 Dec 2026 23:58:56 +0000 Message-ID: <179625593670.3146.11868077435288266826@kernel.org> In-Reply-To: <1853c3a0-72e6-4780-b115-43952a504cc0@yahoo.com> References: <1853c3a0-72e6-4780-b115-43952a504cc0@yahoo.com> X-sashiko-severity: Low 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 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 family D, the undo_pbfid error path in rtl8365mb_port_vlan_filtering()… - [Low] On family D, rtl8365mb_setup() now adds each port's own bit to its port isolation (forwarding) mask, for both user ports and CPU… - [Low] The kernel-doc of rtl83xx_port_bridge_join() and rtl83xx_port_bridge_leave() in drivers/net/dsa/realtek/rtl83xx.c still… -- net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D This patch updates the rtl8365mb table and L2 code for family D (RTL8367S-VB): its LUT entry layout, its table access field widths, and its lack of an EFID. It uses the family D port-based FID registers to put ports of an offloaded VLAN-unaware bridge in FID 1, and it enables the lookup-hit isolation fallback with self bits in the isolation masks. It also limits max_num_bridges to 1 without advertising fdb_isolation. Closes: https://github.com/openwrt/openwrt/pull/19644#issuecomment-6708118180 > diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c > index 5b07cb850d8cb..663c9640b776b 100644 > --- a/drivers/net/dsa/realtek/rtl8365mb_main.c > +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c [ ... ] > @@ -2512,15 +2539,84 @@ static int rtl8365mb_port_vlan_filtering(struct dsa_switch *ds, int port, > goto undo_set_framefilter; > > if (rtl8365mb_is_d(priv)) { > + bool bridged = !!dsa_port_bridge_dev_get(dsa_to_port(ds, port)); > + [ ... ] > mutex_lock(&priv->vlan_lock); > ret = rtl8365mb_d_vlan_4k_refresh_ivl(ds, port, vlan_filtering); > mutex_unlock(&priv->vlan_lock); > if (ret) > - goto undo_egress_mode; > + goto undo_pbfid; [ ... ] > +undo_pbfid: > + if (rtl8365mb_is_d(priv) && > + dsa_port_bridge_dev_get(dsa_to_port(ds, port))) { > + /* Restore the opposite PBFIDEN/PBFID state */ > + if (vlan_filtering) { > + (void)regmap_update_bits(priv->map, > + RTL8365MB_D_PORT_PBFID_REG(port), > + RTL8365MB_D_PORT_PBFID_MASK, > + RTL8365MB_D_UNAWARE_BRIDGE_FID); > + (void)regmap_update_bits(priv->map, > + RTL8365MB_D_PORT_PBFIDEN_REG, > + BIT(port), BIT(port)); [Severity: Low] Did the hardware always hold the "opposite" state before this call? When a port joins a bridge that already has vlan_filtering=1, rtl8365mb_port_set_efid() has already applied the final state: rtl83xx_port_bridge_join() rtl8365mb_port_set_efid(priv, port, 1) br_filtering = br_vlan_enabled(br); /* true */ enable = efid && !br_filtering; /* false, PBFIDEN stays clear */ dsa_port_bridge_join() then syncs the attributes while dp->vlan_filtering is still false: dsa_port_bridge_join() dsa_port_switchdev_sync_attrs() dsa_port_vlan_filtering(dp, true) rtl8365mb_port_vlan_filtering(ds, port, true) rtl8365mb_d_vlan_4k_refresh_ivl() can fail here, for example with an I/O error in rtl8365mb_d_vlan_4k_set_ivl() when this port flips the switch-wide IVL state. In that case undo_pbfid sets PBFID=1 and PBFIDEN on a port in a VLAN-aware bridge. The port never had that state, before or after the call. The DSA join rollback clears it again: DSA_NOTIFIER_BRIDGE_LEAVE rtl83xx_port_bridge_leave() rtl8365mb_port_set_efid(priv, port, 0) Learning is already enabled by then, though. Frames arriving in that window could create dynamic entries in SVL FID 1. Could the undo restore the PBFID state the port actually had before the call, instead of assuming the opposite of vlan_filtering? > + } else { > + (void)regmap_update_bits(priv->map, > + RTL8365MB_D_PORT_PBFIDEN_REG, > + BIT(port), 0); [ ... ] > @@ -3665,12 +3868,16 @@ static int rtl8365mb_setup(struct dsa_switch *ds) > > /* Configure user ports */ > dsa_switch_for_each_port(dp, ds) { > + u32 iso_mask = upports_mask; > + > if (!dsa_port_is_user(dp)) > continue; > > + if (rtl8365mb_is_d(priv)) > + iso_mask |= BIT(dp->index); > + > /* Forward only to the CPU */ > - ret = rtl8365mb_port_set_isolation(priv, dp->index, > - upports_mask); > + ret = rtl8365mb_port_set_isolation(priv, dp->index, iso_mask); [Severity: Low] This isn't a bug, but on family D the user port mask now also contains the port itself. The "Forward only to the CPU" comment above no longer describes the mask. The same goes for "Forward to all user ports" on the CPU port mask further down, which now also contains the CPU port. Only the commit message explains the self bit. With it, a same-port LUT hit counts as inside the mask and is still dropped. Without it, the lookup-hit isolation fallback enabled in rtl8365mb_d_lut_init() would flood the frame. Could a short comment here, or above rtl8365mb_port_set_isolation(), explain why family D needs the self bit and why it does not hairpin frames? > if (ret) > goto out_teardown_irq; [ ... ] > diff --git a/drivers/net/dsa/realtek/rtl83xx.c b/drivers/net/dsa/realtek/rtl83xx.c > index ad42c05d0a88d..cfe7d42ae9602 100644 > --- a/drivers/net/dsa/realtek/rtl83xx.c > +++ b/drivers/net/dsa/realtek/rtl83xx.c > @@ -602,7 +602,8 @@ int rtl83xx_port_fdb_add(struct dsa_switch *ds, int port, > > /* Bridge ports use bridge.num as EFID, while standalone ports use > * EFID 0. FDB entries for the CPU port follow the bridge EFID due > - * to assisted learning. > + * to assisted learning. Chips without an EFID in their L2 table > + * (RTL8367S-VB) ignore it in l2_add_uc(). > */ > efid = db.type == DSA_DB_BRIDGE ? db.bridge.num : 0; [Severity: Low] This isn't a bug, but the FDB comments now mention RTL8367S-VB, while rtl83xx_port_bridge_join() and rtl83xx_port_bridge_leave() in the same file still describe EFID behaviour: * This function handles joining a port to a bridge. It updates the port * isolation masks and EFID. ... /* Use the bridge number as the EFID for this port */ if (priv->ops->port_set_efid) { ret = priv->ops->port_set_efid(priv, port, bridge.num); and on the leave path: /* Revert to the default EFID 0 for standalone mode */ ... "failed to clear EFID on port %d: %pe\n", On family D, rtl8365mb_port_set_efid() does not write an EFID. It sets or clears port-based FID 1 (PBFIDEN/PBFID) depending on the bridge's VLAN filtering state. It returns -EOPNOTSUPP for bridge numbers above 1. Should the bridge_join/leave kernel-doc and comments be updated too? [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/1383a67b-15e4-4c76-8bbf-65d3cbfa1fc1%40yahoo.com