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
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 [thread overview]
Message-ID: <179625593670.3146.11868077435288266826@kernel.org> (raw)
In-Reply-To: <1853c3a0-72e6-4780-b115-43952a504cc0@yahoo.com>
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
next prev parent reply other threads:[~2026-12-02 23:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1383a67b-15e4-4c76-8bbf-65d3cbfa1fc1.ref@yahoo.com>
2026-12-01 23:48 ` [PATCH net-next v18 00/15] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-12-01 23:50 ` [PATCH net-next v18 01/15] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-12-01 23:51 ` [PATCH net-next v18 02/15] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-12-01 23:51 ` [PATCH net-next v18 03/15] net: dsa: realtek: rtl8365mb: refactor forcemode handling Mieczyslaw Nalewaj
2026-12-01 23:51 ` [PATCH net-next v18 04/15] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-12-01 23:51 ` [PATCH net-next v18 05/15] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-12-02 23:58 ` netdev-bot+sashiko
2026-12-01 23:51 ` [PATCH net-next v18 06/15] net: dsa: realtek: rtl8365mb: refactor VLAN 4k handling Mieczyslaw Nalewaj
2026-12-01 23:51 ` [PATCH net-next v18 07/15] net: dsa: realtek: rtl8365mb: add VLAN 4k/IVL for family D Mieczyslaw Nalewaj
2026-12-02 23:58 ` netdev-bot+sashiko
2026-12-01 23:51 ` [PATCH net-next v18 08/15] net: dsa: realtek: rtl8365mb: refactor PVID handling Mieczyslaw Nalewaj
2026-12-01 23:55 ` [PATCH net-next v18 09/15] net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D Mieczyslaw Nalewaj
2026-12-01 23:55 ` [PATCH net-next v18 10/15] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-12-02 23:58 ` netdev-bot+sashiko
2026-12-01 23:56 ` [PATCH net-next v18 11/15] net: dsa: realtek: rtl8365mb: refactor L2 MAC handling Mieczyslaw Nalewaj
2026-12-01 23:56 ` [PATCH net-next v18 12/15] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-12-02 23:58 ` netdev-bot+sashiko [this message]
2026-12-01 23:56 ` [PATCH net-next v18 13/15] net: dsa: realtek: rtl8365mb: refactor QoS priority handling Mieczyslaw Nalewaj
2026-12-01 23:56 ` [PATCH net-next v18 14/15] net: dsa: realtek: rtl8365mb: use PCP numbering on family D Mieczyslaw Nalewaj
2026-12-01 23:56 ` [PATCH net-next v18 15/15] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-12-02 23:58 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179625593670.3146.11868077435288266826@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=alvin.sipraga@analog.com \
--cc=andrew@lunn.ch \
--cc=contact@c127.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fabianotassotti@gmail.com \
--cc=gabonpivovich@gmail.com \
--cc=gusfmora@gmail.com \
--cc=kuba@kernel.org \
--cc=kuncy7@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=luizluca@gmail.com \
--cc=maxime.chevallier@bootlin.com \
--cc=namiltd@yahoo.com \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.