Article View: linux.kernel.netdev
Article #26038Re: [PATCH net-next v18 12/15] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D
From: netdev-bot+sashiko
Date: Wed, 02 Dec 2026 23:58
Date: Wed, 02 Dec 2026 23:58
188 lines
14883 bytes
14883 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 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
Technical Details
Message-ID:
<179625593670.3146.11868077435288266826@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376138-linux-kernel-netdev=dewy.ruReferences:
<1853c3a0-72e6-4780-b115-43952a504cc0@yahoo.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376138-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v18 12/15] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Date: Wed, 02 Dec 2026 23:58:56 +0000 Organization: Usenet Network Message-ID: <179625593670.3146.11868077435288266826@kernel.org> References: <1853c3a0-72e6-4780-b115-43952a504cc0@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2092013"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:QgMJZnAYfVlo2rOYW7kfDQD9YdU= sha256:gI2+VLeQc+zAImtUhDPECCOzm2cau6LhxDRPypwkdjI= sha1:ti2NlYT2d97bDevZNlYpaZf6ETk= sha256:qSd8HCcs3H0wRub3y644RBFzkAnb73QdjyS0L9QCa70= 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 08CCC1177A6; Thu, 3 Dec 2026 02:59:18 +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 uqpzEcW5i85l; Thu, 3 Dec 2026 02:59:14 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376138-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id C68EC11779E; Thu, 3 Dec 2026 02:59:05 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 79AE329293; Wed, 2 Dec 2026 23:59:01 +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=1796255939; b=hIdfhip0DMKPwqdTLPW3cO6syFuHyokFX9Dey7Gst3qfr3CUAzBkudT5gmir5O6WGzWb oSYrlDlj2LTiRNLQImDXCA7OHKgLD1o6O3+WUTqrgEpLFbnmZH5eIelHKt8v0sUZF+Ied Y7Cd5lCJAufJnTF4IAULbPO9+Z4op77561TaLrl8aGLpJ0LK4wZCJ1BR7NLamoESGUggH xVsXMqjd+w2MBS+uMjj6NV7/J3iHVxZKLCKUiE72vn3KkhglhkPkwrv/mC1hiAFbNVDbZ 7fyD2DEhkOeuDPIkbTvVJ/J0w+zRhecDzGJKsyT6cSFL4+QEz7gMSbAZX63TsfGlNhw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796255939; 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=I4jvYzkg+BCQ+KC91UH3bAFQVkF2xX9JjeEzdMhj9iM=; b=btrj0Rt/CtJ4RUNugPhuhHuhNyyoZlGzQ0byAPx3MBE1KhN3pum0APTOtfD24kmBwJ/M D5v2eF6aTgu2pD8Y8c7dZPbekiUqDjiBqzEx/kmQ3qFOtWyLYKEy24KLAhS6zFCgqNnQU FXqZNem9urcUPFGtOKuIBch9DyfHvIO74gM9svsWERHb+fkHraLs2z9fMG8PH7G8/7phT iSUQ5OZtQD1vZI0JPTmI5txEy4SFeolzZNjlJ/wOAXhUHft92s5lyBPLctmSEbNj5gPPN U+VvE9Ke3yAD1/XHyzpQ4WQIIO6Ci5pX8s6Lhz3n+dLsaqklbrqHBB7ilj6sQwHhTXw== 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=Pt7KhU1C; 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 7B6FE606A698; Wed, 2 Dec 2026 23:58:59 +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=Pt7KhU1C 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=1796255938; b=KW3+xnjahKFA5xnz/dfLMwj8RUg4uq4+GWdLwTBFDmgTAPcdgODKQDvMiNi29o80GZxq 2KkhaiyooCrTBQ5vaKY/ZT1rz6GE7xpCKNC0lR6+0oMWqpgbaaImFBK5JJibggCYK/qyu 1weUy389FzLFqx7hoAI2NuJ62Ke5QsVoSmXw7sjMI36fYQ97pVm7WvL2EzLoZkk69xcws kV4wt5zzS0U6u8GseyC6goU8DscW3L/HqcG/deVOliPvsI14FLyoMDmuaQP2Mhdd80SsF GmfMripnbloQS5SyE+qMrObRX0i/S5aYt7zecUFWwyskGFv81nRSln6+KlrfqezzXUw== X-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== 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=Pt7KhU1C; 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 9DB24606A685; Wed, 2 Dec 2026 23:58:58 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A7711F00919; Wed, 2 Dec 2026 23:58:57 +0000 (UTC) X-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== 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: <1853c3a0-72e6-4780-b115-43952a504cc0@yahoo.com> 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