All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v5 0/6] Improve neigh_flush_dev performance
@ 2024-10-17  7:04 Gilad Naaman
  2024-10-17  7:04 ` [PATCH net-next v5 1/6] Add hlist_node to struct neighbour Gilad Naaman
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Gilad Naaman @ 2024-10-17  7:04 UTC (permalink / raw)
  To: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Gilad Naaman, Kuniyuki Iwashima, Ido Schimmel, Petr Machata

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 v5:

 - Fix leak in neigh_hash_alloc
 - Refactor seq_file functions for readability
 - Reverse xmasify

Gilad Naaman (6):
  Add hlist_node to struct neighbour
  Define neigh_for_each
  Convert neigh_* seq_file functions to use hlist
  Convert neighbour iteration to use hlist+macro
  Remove bare neighbour::next pointer
  Create netdev->neighbour association

 .../networking/net_cachelines/net_device.rst  |   1 +
 .../ethernet/mellanox/mlxsw/spectrum_router.c |  24 +-
 include/linux/netdevice.h                     |   7 +
 include/net/neighbour.h                       |  26 +-
 include/net/neighbour_tables.h                |  12 +
 net/core/neighbour.c                          | 365 +++++++-----------
 6 files changed, 203 insertions(+), 232 deletions(-)
 create mode 100644 include/net/neighbour_tables.h

-- 
2.46.0


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

end of thread, other threads:[~2024-10-21  9:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-17  7:04 [PATCH net-next v5 0/6] Improve neigh_flush_dev performance Gilad Naaman
2024-10-17  7:04 ` [PATCH net-next v5 1/6] Add hlist_node to struct neighbour Gilad Naaman
2024-10-17  7:04 ` [PATCH net-next v5 2/6] Define neigh_for_each Gilad Naaman
2024-10-17 16:26   ` Petr Machata
2024-10-20  7:16     ` Gilad Naaman
2024-10-21  9:07       ` Petr Machata
2024-10-17  7:04 ` [PATCH net-next v5 3/6] Convert neigh_* seq_file functions to use hlist Gilad Naaman
2024-10-17  7:04 ` [PATCH net-next v5 4/6] Convert neighbour iteration to use hlist+macro Gilad Naaman
2024-10-18 11:42   ` Simon Horman
2024-10-17  7:04 ` [PATCH net-next v5 5/6] Remove bare neighbour::next pointer Gilad Naaman
2024-10-18  4:56   ` kernel test robot
2024-10-17  7:04 ` [PATCH net-next v5 6/6] Create netdev->neighbour association Gilad Naaman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.