Skip to content

net: dsa: realtek: rtl8365mb: fix FDB lookups in VLAN-unaware bridges

Stijn Cleynhens lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesIn review
  2. v12 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- Patch 1: add Alvin's Reviewed-by.
- Patch 2: replace rtl8365mb_vlan_pvid_port_set() and rtl8365mb_vlan_pvid_port_clear() with rtl8365mb_vlan_pvid_port_commit(), which is now the only place that sets the frame filter; rtl8365mb_port_vlan_filtering() no longer does (Alvin).
- Patch 2: one variable per declaration and an explicit else (Alvin).
- Patch 2: commit message: say what "the VID of the bridge entries" is and that the per-bridge EFID keeps lookups local (Alvin).
- v1: https://lore.kernel.org/netdev/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net: dsa: realtek: rtl8365mb: use IVL in VLAN 0drivers/net/dsa/realtek/rtl8365mb_main.c drivers/net/dsa/realtek/rtl8365mb_vlan.c drivers/net/dsa/realtek/rtl8365mb_vlan.h+40 -00 replies
2/2net: dsa: realtek: rtl8365mb: keep the neutral PVID in VLAN-unaware bridgesdrivers/net/dsa/realtek/rtl8365mb_main.c drivers/net/dsa/realtek/rtl8365mb_vlan.c drivers/net/dsa/realtek/rtl8365mb_vlan.h+151 -2063 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAlvin Šipraga
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net v2 0/2] net: dsa: realtek: rtl8365mb: fix FDB lookups in VLAN-unaware bridges

In a VLAN-unaware bridge, DSA installs FDB and MDB entries with VID 0, but the switch classifies untagged frames to the bridge PVID and looks up VID 0 by FID, while the driver installs IVL entries. Nothing matches, so a station that roams from behind a user port to behind the CPU port (a Wi-Fi client moving between access points) stays unreachable until the learned entry ages out.

Patch 1 makes VID 0 use IVL; patch 2 depends on it. Patch 2 keeps the neutral PVID (VID 0) on ports of a VLAN-unaware bridge and only programs the bridge PVID while the port filters VLANs. Tagged frames in a VLAN-unaware bridge are not covered, see patch 2.

Tested on OpenWrt's 6.18 kernel, which carries the rtl8365mb backports up to v7.4; the code these patches touch is the same as in net. A station learned behind the uplink that moves behind the CPU port answers 10/10 pings, its learned entry replaced by the CPU one, with VLAN filtering switched off at runtime: on an RTL8367S (TP-Link Deco X50-Outdoor), and on an RTL8367S-VB (Deco X50-PoE, with the family D series applied and a family D branch in rtl8365mb_vlan_pvid_port_commit()), where it also passes with VLAN filtering on. Before these patches the RTL8367S answered 0/10. Both patches build without warnings with W=1 C=1.

Note for Mieczyslaw's RTL8367S-VB series in net-next (v8): patch 2 replaces rtl8365mb_vlan_pvid_port_set() and rtl8365mb_vlan_pvid_port_clear() with rtl8365mb_vlan_pvid_port_commit(), which gets the target VID (0 for the neutral PVID) and the filtering state. The family D paths that series adds to set and clear become one branch there that writes the PVID register and the frame filter from those two inputs. Happy to send that as a follow-up once both are in.

Changes in v2:
- Patch 1: add Alvin's Reviewed-by.
- Patch 2: replace rtl8365mb_vlan_pvid_port_set() and rtl8365mb_vlan_pvid_port_clear() with rtl8365mb_vlan_pvid_port_commit(), which is now the only place that sets the frame filter; rtl8365mb_port_vlan_filtering() no longer does (Alvin).
- Patch 2: one variable per declaration and an explicit else (Alvin).
- Patch 2: commit message: say what "the VID of the bridge entries" is and that the per-bridge EFID keeps lookups local (Alvin).
- v1: https://lore.kernel.org/netdev/[email protected]/

Stijn Cleynhens (2):
net: dsa: realtek: rtl8365mb: use IVL in VLAN 0
net: dsa: realtek: rtl8365mb: keep the neutral PVID in VLAN-unaware
bridges

 drivers/net/dsa/realtek/rtl8365mb_main.c | 157 ++++++++-------
 drivers/net/dsa/realtek/rtl8365mb_vlan.c | 233 ++++++++++-------------
 drivers/net/dsa/realtek/rtl8365mb_vlan.h |   7 +-
 3 files changed, 191 insertions(+), 206 deletions(-)

base-commit: 787268686c64be60023743b527645a907e38ccca

Signature · 1 line
2.56.0