On 04/10/2026 15:42, Julius Bairaktaris wrote:
br_fdb_update() lets an entry roam to a new port without holding hash_lock. It notifies switchdev that the entry left the old port, writes the new port, then notifies the addition. When two CPUs receive the same source address on different ports, these steps interleave: a driver sees two deletions for one addition, or an addition for the port the other CPU wrote.DSA counts references to a host address on the CPU port. The extra deletion fails and the extra addition is never released: qca-ppe 3a000000.ppe: port 5 failed to delete 02:5a:0b:a2:1a:46 vid 0 from fdb: -2 With one address roaming between a DSA user port and a Wi-Fi AP port of the same bridge, the error appears 3-6 times per address when the two ports receive on different CPUs, and not at all when they share one CPU (4 runs each). With this change it does not appear (6 runs, different CPUs). Take hash_lock when the entry roams or its flags change, and send both notifications under it. The common case, where the entry neither roams nor changes, stays lockless. Fixes: 90dc8fd36078 ("net: bridge: notify switchdev of disappearance of old FDB entry upon migration") Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Julius Bairaktaris <[email protected]> --- Notes: net-next 941056f91907 ("net: bridge: fdb: factor out existing entry updates") moves this code into __fdb_update(); the same change applies there. net/bridge/br_fdb.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
Absolutely not, this was made intentionally. Taking the hash_lock would further kill learning and roaming scaling. Surely switchdev drivers must have dealt with this for some time now, if you'd like to fix it do it so the software path isn't affected. Cheers, Nik

