net: dsa: realtek: rtl8365mb: add FDB support
authorAlvin Šipraga <alsi@bang-olufsen.dk>
Sat, 6 Jun 2026 08:29:31 +0000 (05:29 -0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 10 Jun 2026 02:35:42 +0000 (19:35 -0700)
commit336e3e4a1ab37b6826fae27e53cd2ac43c9a96ca
treece021bebba4b520ea46f274fd3e3b6e552893073
parent9da2c8672f77108a1f09232320f22225ab53dde9
net: dsa: realtek: rtl8365mb: add FDB support

Implement support for FDB and MDB management for the RTL8365MB series
switches.

The hardware supports IVL by keying the unicast forwarding database with
the {MAC, VID, EFID} tuple.  The Extended Filtering ID (EFID) is 3 bits
wide, providing 8 unique filtering domains. This driver reserves EFID 0
for standalone ports, effectively limiting the hardware offload to a
maximum of 7 bridges. The multicast database uses a {MAC, VID} key, with
ports from different bridges sharing the same multicast group.

Introduce a mutex lock (l2_lock) to protect concurrent L2 table updates.

Add support for forwarding database operations, including unicast and
multicast entry handling as well as fast aging support.

Set DSA switch flags assisted_learning_on_cpu_port and fdb_isolation.

Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Co-developed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Link: https://patch.msgid.link/20260606-realtek_forward-v13-7-b9e409687cbe@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/realtek/Makefile
drivers/net/dsa/realtek/realtek.h
drivers/net/dsa/realtek/rtl8365mb_l2.c [new file with mode: 0644]
drivers/net/dsa/realtek/rtl8365mb_l2.h [new file with mode: 0644]
drivers/net/dsa/realtek/rtl8365mb_main.c
drivers/net/dsa/realtek/rtl83xx.c
drivers/net/dsa/realtek/rtl83xx.h