This patchsets improves the performance of neigh_flush_dev.
Currently, the only way to implement it requires traversing all neighbours known to the kernel, across all network-namespaces.
This means that some flows are slowed down as a function of neigh-scale, even if the specific link they're handling has little to no neighbours.
In order to solve this, this patchset adds a netdev->neighbours list, as well as making the original linked-list doubly-, so that it is possible to unlink neighbours without traversing the hash-bucket to obtain the previous neighbour.
The original use-case we encountered was mass-deletion of links (12K VLANs) while there are 50K ARPs and 50K NDPs in the system; though the slowdowns would also appear when the links are set down. ====================
Link: https://patch.msgid.link/20241107160444.2913124-1-gnaaman@drivenets.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>