Re: [PATCH net-next v11 07/13] net: dsa: realtek: rtl8365mb: set and get vlan 4k for family D
From: Gustavo Foletto Mora
Date: Wed Nov 18 2026 - 20:47:30 EST
Hi Mieczyslaw,
On Wed, Nov 18, 2026 at 08:59 Mieczyslaw Nalewaj wrote:
> 1. With IVL_EN=0 (VLAN-unaware bridge), if the FID field of the bridge
> VLAN's 4K entry is set to 1 [...] does the chip learn the bridge hosts
> with FID 1?
> 2. Which VLAN4K entry do the standalone ports classify into with PVID 0?
> 3. If 1 and 2 work out, do static entries written with key.fid = 1
> replace the learned ones?
I measured this with your v12-pre2 from the OpenWrt PR
(https://github.com/openwrt/openwrt/pull/19644, head 7690a1c6db), as
that is the version that writes FID 1 into the bridge VLANs' 4K
entries: EX511 (RTL8367S), 6.18.44, the thirteen patches as they are.
Same setup as before: two bridge ports, two hosts on standalone ports
of the same switch, loopback cables in between. I can't read the FID
out of the chip with this build, so I inferred it from how the address
table behaves.
1 and 3: yes. In a VLAN-unaware bridge whose two ports have a PVID
("bridge vlan add ... pvid untagged" with VID 2, vlan_filtering still 0,
so that 4K entry has IVL_EN=0 and FID 1), the hosts are learned without
a VID. A static entry for h2 without a VID on the other bridge port (the
driver's SVL key with FID 1) took the place of the learned row: the row
on h2's port went away, h1 -> h2 stopped (0/6), and after the delete h2
was learned on its own port again. So the chip learns with the FID of
the 4K entry, and static entries with FID 1 replace the learned ones.
One detail there: br_fdb_add() without a VID on a port that has VLANs
also adds the entry for each of them, so the driver gets a second call
with VID 2 and writes it as an IVL row. That row is not looked up while
IVL_EN is 0 and becomes the live one once vlan_filtering goes on, which
I take to be intended.
2: with the bridge on PVID 2, the standalone ports (PVID 0) are not in
FID 1: with learning on, h1 -> h2 gives 20/20 (0/20 on v11's plain
bridge), and with a static entry without a VID on the far bridge port
the host behind it receives the frames (100/100; 0 with v11). Frames
tagged with a VID the bridge does not have (VID 5, no 4K entry) do not
get there: with learning on, tagged h1 -> h2 gave 0/20. I can't tell
from here whether they land in FID 0 or are dropped.
The plain br-lan is where it breaks. OpenWrt's default br-lan has no
VLAN at all: its ports keep PVID 0 like the standalone ports, and the
driver writes no 4K entry for VID 0, so the bridge is looked up in FID 0
while its entries are now written with FID 1:
- a static entry without a VID no longer steers or drops: with the
entry on the egress port the frames still flood to the uplink (104
out of wan for 100 sent; 7 with v11), and with it on the ingress port
they still go out of the other port (100; 0 with v11);
- the bridge's own host entries (br-lan's address, and what is learned
behind the CPU) take the same key, so I expect frames to the router
in a plain br-lan to flood to every bridge port. I did not measure
this one;
- with fdb_isolation, which v12-pre2 sets, DSA installs the standalone
ports' addresses as static host entries in FID 0. In the lab the
hosts are standalone ports of the same switch, so the plain bridge's
frames to them hit those entries and go to the CPU with
offload_fwd_mark set, and the software bridge does not forward them
on: h1 -> h2 fails with learning off (0/50; 50/50 with v11), 0/5000
in the load test, and the hosts are not learned on the bridge ports
at all. In the field a standalone port's address is usually the
router's own, so this one matters less, but it is the same shared
FID.
A way out could be to give the ports of a VLAN-unaware bridge a private
PVID whose 4K entry has FID 1, as mv88e6xxx does with
MV88E6XXX_VID_BRIDGED / MV88E6XXX_FID_BRIDGED
(mv88e6xxx_port_commit_pvid()). That would put the plain bridge where
the test above put it by hand, where all of this works. The tagged
frames with an unknown VID would still need a look.
On the 5.4 s: with the bitmap in v12-pre2 each vlan_filtering toggle
took 20-30 ms, and the rest of the toggle tests behaved as with v11
apart from the group entries.
The other things I found in v12-pre2 (the multicast key, a few comments)
are about code that is not on the list yet, so I put them on the
OpenWrt PR. I'll run the next version when you have it.
Thanks,
Gustavo