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>