Re: [PATCH net-next v11 07/13] net: dsa: realtek: rtl8365mb: set and get vlan 4k for family D
From: Mieczyslaw Nalewaj
Date: Wed Nov 18 2026 - 02:59:55 EST
Subject: Re: [PATCH net-next v11 07/13] net: dsa: realtek: rtl8365mb: set and get vlan 4k for family D
Hi Gustavo,
Thanks for testing v11, and for the detailed report on the vlan_filtering toggle. I will add your Tested-by on 7, 8 and 9 in the next revision, noting for 8 and 9 that it is family D only.
On the 5.4 s per toggle: agreed, scanning all 4095 entries over MDIO is too slow. I plan to track the VIDs that are in use and scan only those in rtl8365mb_d_vlan_4k_refresh_ivl().
I also have a question where your hardware would help. The Sashiko review of v11 12/13 (https://sashiko.dev/#/patchset/cf3fd237-2290-4002-8de0-ea4100ef0f85%40yahoo.com, "Muted" so it did not go to the list) raises the same shared-FID problem you reported earlier. It says:
> Does sharing SVL FID 0 between standalone ports and an offloaded
> VLAN-unaware bridge break DSA standalone port isolation?
> [...]
> Once a MAC is learned or programmed on an offloaded bridge port in
> FID 0, any frame arriving on a standalone or software-bridged port for
> that destination MAC hits the bridge port entry instead of flooding to the
> CPU port, and is dropped by the ingress port's isolation mask.
and suggests a way out:
> Commit "net: dsa: realtek: rtl8365mb: set and get vlan 4k for family D"
> defines a 2-bit FID field (RTL8365MB_D_CVLAN_ENTRY_D1_FID_MASK) in the
> family D CVLAN entry and rtl8365mb_d_l2_uc_to_data() already serializes
> uc->key.fid when ivl is false, so could the offloaded bridge be assigned a
> non-zero SVL FID to keep it separate from FID 0 on standalone ports?
I cannot verify this from the vendor API alone. What I would like to know, if you have time to try it on the EX511:
1. With IVL_EN=0 (VLAN-unaware bridge), if the FID field of the bridge VLAN's 4K entry is set to 1 (for example by a temporary hack in rtl8365mb_vlan_4k_port_set()), does the chip learn the bridge hosts with FID 1? A debug print of key.fid in rtl8365mb_d_l2_data_to_uc() on the learned entries should show it.
2. Which VLAN4K entry do the standalone ports classify into with PVID 0? If it is not the same entry, they would stay in FID 0 and the bridge could use another FID. If it is the same entry, the FID cannot separate them.
3. If 1 and 2 work out, do static entries written with key.fid = 1 replace the learned ones?
If you see that the chip does not use the VLAN4K FID for learning, I will keep this as a documented limitation in the commit message, as it is now. If it does, I will look at giving the offloaded bridge its own FID in a follow-up, with FDB/MDB entries for the bridge keyed with that FID and standalone ports left on FID 0.
Thanks,
Mieczyslaw