net: dsa: mv88e6xxx: Add FID map cache
authorAryan Srivastava <aryan.srivastava@alliedtelesis.co.nz>
Sun, 6 Oct 2024 21:29:05 +0000 (10:29 +1300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 8 Oct 2024 22:30:55 +0000 (15:30 -0700)
commitada5c3229b32e48f4c8e09b6937e5ad98cc3675f
tree896e1020207167ebef4cac58f49bde91e26bac77
parent42b2331081178785d50d116c85ca40d728b48291
net: dsa: mv88e6xxx: Add FID map cache

Add a cached FID bitmap. This mitigates the need to walk all VTU entries
to find the next free FID.

When flushing the VTU (during init), zero the FID bitmap. Use and
manipulate this bitmap from now on, instead of reading HW for the FID
map.

The repeated VTU walks are costly and can take ~40 mins if ~4000 vlans
are added. Caching the FID map reduces this time to <2 mins.

Signed-off-by: Aryan Srivastava <aryan.srivastava@alliedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241006212905.3142976-1-aryan.srivastava@alliedtelesis.co.nz
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/mv88e6xxx/chip.h
drivers/net/dsa/mv88e6xxx/devlink.c
drivers/net/dsa/mv88e6xxx/global1_vtu.c