netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] Improve neigh_flush_dev performance
@ 2024-10-06  6:47 Gilad Naaman
  2024-10-06  6:47 ` [PATCH net-next v2 1/2] Convert neighbour-table to use hlist Gilad Naaman
  2024-10-06  6:47 ` [PATCH net-next v2 2/2] Create netdev->neighbour association Gilad Naaman
  0 siblings, 2 replies; 9+ messages in thread
From: Gilad Naaman @ 2024-10-06  6:47 UTC (permalink / raw)
  To: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Gilad Naaman

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 neighbour-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.

Changes in v2:

 - Fix RCU usage
 - Document new net_device->neighbours field

Gilad Naaman (2):
  Convert neighbour-table to use hlist
  Create netdev->neighbour association

 .../networking/net_cachelines/net_device.rst  |   1 +
 include/linux/netdevice.h                     |   6 +
 include/net/neighbour.h                       |  18 +-
 include/net/neighbour_tables.h                |  13 +
 net/core/neighbour.c                          | 224 +++++++++---------
 5 files changed, 144 insertions(+), 118 deletions(-)
 create mode 100644 include/net/neighbour_tables.h

-- 
2.46.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-10-09 13:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-06  6:47 [PATCH net-next v2 0/2] Improve neigh_flush_dev performance Gilad Naaman
2024-10-06  6:47 ` [PATCH net-next v2 1/2] Convert neighbour-table to use hlist Gilad Naaman
2024-10-06 15:52   ` Kuniyuki Iwashima
2024-10-08  7:38     ` Gilad Naaman
2024-10-08 14:53       ` Kuniyuki Iwashima
2024-10-06 15:56   ` Kuniyuki Iwashima
2024-10-09 13:52   ` kernel test robot
2024-10-06  6:47 ` [PATCH net-next v2 2/2] Create netdev->neighbour association Gilad Naaman
2024-10-09  6:03   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).