]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: dsa: provide generic fast_age for RTL93xx
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sun, 22 Feb 2026 13:09:07 +0000 (14:09 +0100)
committerRobert Marko <robimarko@gmail.com>
Fri, 27 Feb 2026 17:25:19 +0000 (18:25 +0100)
commitb37c4dbb2a6b3ff60804cdfc43f101ae43c7155a
treee2d130f36bd0bedefba4103491d3792ab6adcbe8
parent0f878ab9dc87ed05d180ae983382371807f493da
realtek: dsa: provide generic fast_age for RTL93xx

Fast ageing of L2 entries is supported by DSA with two callbacks.

- port_fast_age(): age out for one port
- port_vlan_fast_age(): age out for one vlan on one port

Independent from the SoC it always boils down to issue a command
to the L2_TBL_FLUSH_CTRL register. Nevertheless the current
implemententation is repeated multiple times and makes use of
the family_id.

As a first refactoring step provide generic fast_age() functions
for RTL930x and RTL931x by rearranging the existing definitions
of vlan_port_fast_age().

The logic is as follows:

- provide a SoC dependent function that works with or without VLAN.
  When VLAN/VID = -1 only flush the specific port otherwise only
  flush given VLAN on port.
- provide a port_fast_age() helper that calls the SoC specific
  functions with VLAN = -1.
- provide a port_vlan_fast_age() helper that calls the SOC specific
  functions and handing over the given VLAN.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22145
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c