Re: [PATCH net-next v20 12/15] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D

From: netdev-bot+sashiko

Date: Sat Dec 05 2026 - 17:19:58 EST


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] The comment above rtl8365mb_d_want_ivl() in
drivers/net/dsa/realtek/rtl8365mb_vlan.c (lines 371-379) is out of…

--

net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D

This commit gets the L2 lookup table code working on family D
(RTL8367S-VB) switches. It adds the family D unicast/multicast entry
(de)serializers and teaches the table access code the family D register
layout. It also isolates an offloaded VLAN-unaware bridge in FID 1 through
port-based FID, and limits family D to one offloaded bridge.

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 7b82cb13c06a0..87ecb0c52fffa 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c

[ ... ]

> @@ -3719,9 +3960,21 @@ static int rtl8365mb_setup(struct dsa_switch *ds)
> goto out_teardown_irq;
>
> ds->assisted_learning_on_cpu_port = true;
> - ds->fdb_isolation = true;
> - /* The EFID is 3 bits, but EFID 0 is reserved for standalone ports */
> - ds->max_num_bridges = FIELD_MAX(RTL8365MB_EFID_MASK);
> + if (!rtl8365mb_is_d(priv)) {
> + ds->fdb_isolation = true;
> + /* The EFID is 3 bits, but EFID 0 is reserved for standalone */
> + ds->max_num_bridges = FIELD_MAX(RTL8365MB_EFID_MASK);
> + } else {
> + /* No EFID; FID 0 is used by standalone ports and FID 1 by the
> + * offloaded VLAN-unaware bridge via port-based FID, so allow
> + * at most one offloaded bridge. The bridge number it gets is
> + * what rtl8365mb_port_set_efid() takes as "offloaded" to
> + * enable port-based FID, so max_num_bridges must not be 0.
> + * A bridge with another number is rejected in
> + * rtl8365mb_port_set_efid() and stays software-forwarded.
> + */
> + ds->max_num_bridges = 1;
> + }

[Severity: Low]
This isn't a bug, but should the comment above rtl8365mb_d_want_ivl() in
rtl8365mb_vlan.c be updated with this change? It still reads:

drivers/net/dsa/realtek/rtl8365mb_vlan.c:
/* Family D has no EFID. Use IVL while at least one user port is VLAN
* filtering and SVL otherwise. The family D L2 helpers added later in the
* series use the matching key for static FDB/MDB entries. ...
* switch-wide: a VLAN-unaware bridge that shares the switch with a
* VLAN-aware one also gets IVL (known limitation).
*/

This patch adds those helpers (rtl8365mb_d_l2_uc_to_data(),
rtl8365mb_d_l2_data_to_uc(), rtl8365mb_d_l2_mc_to_data() and
rtl8365mb_d_l2_data_to_mc()). Once they are in the tree, "added later in
the series" is out of date.

The "known limitation" also looks like it can no longer happen. With
max_num_bridges = 1, and rtl8365mb_port_set_efid() rejecting efid > 1, only
one bridge per switch is offloaded.

Ports of a bridge that is only forwarded in software never get
vlan_filtering. dsa_user_port_attr_set() rejects the attribute for them:

net/dsa/user.c:dsa_user_port_attr_set() {
...
case SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING:
if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev))
return -EOPNOTSUPP;
...
}

As a result, dsa_port_is_vlan_filtering() in rtl8365mb_d_want_ivl() only
reflects the one offloaded bridge.

Could the comment drop the reference to the series and the limitation
note?

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/9efcb80a-517c-4413-8261-4f9380e0eb83%40yahoo.com