All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v9 0/6] Improve neigh_flush_dev performance
@ 2024-11-07 16:04 Gilad Naaman
  2024-11-07 16:04 ` [PATCH net-next v9 1/6] neighbour: Add hlist_node to struct neighbour Gilad Naaman
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Gilad Naaman @ 2024-11-07 16:04 UTC (permalink / raw)
  To: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Kuniyuki Iwashima
  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 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.

Changes in v9:
 - Use RCU iteration in ___neigh_lookup_noref and neigh_dump_table

I kept the reviewed-by tags, as instructed, but note that there are
minor changes in commits 2/6 and 4/6 (just adding the `_rcu`).

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

 .../networking/net_cachelines/net_device.rst  |   1 +
 include/linux/netdevice.h                     |   7 +
 include/net/neighbour.h                       |  26 +-
 include/net/neighbour_tables.h                |  12 +
 net/core/neighbour.c                          | 325 ++++++++----------
 net/ipv4/arp.c                                |   2 +-
 6 files changed, 170 insertions(+), 203 deletions(-)
 create mode 100644 include/net/neighbour_tables.h

-- 
2.34.1


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

end of thread, other threads:[~2024-11-09 21:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 16:04 [PATCH net-next v9 0/6] Improve neigh_flush_dev performance Gilad Naaman
2024-11-07 16:04 ` [PATCH net-next v9 1/6] neighbour: Add hlist_node to struct neighbour Gilad Naaman
2024-11-07 16:07   ` Eric Dumazet
2024-11-07 16:04 ` [PATCH net-next v9 2/6] neighbour: Define neigh_for_each_in_bucket Gilad Naaman
2024-11-07 16:08   ` Eric Dumazet
2024-11-07 16:04 ` [PATCH net-next v9 3/6] neighbour: Convert seq_file functions to use hlist Gilad Naaman
2024-11-07 16:10   ` Eric Dumazet
2024-11-07 16:04 ` [PATCH net-next v9 4/6] neighbour: Convert iteration to use hlist+macro Gilad Naaman
2024-11-07 16:19   ` Eric Dumazet
2024-11-07 16:04 ` [PATCH net-next v9 5/6] neighbour: Remove bare neighbour::next pointer Gilad Naaman
2024-11-07 16:20   ` Eric Dumazet
2024-11-07 16:04 ` [PATCH net-next v9 6/6] neighbour: Create netdev->neighbour association Gilad Naaman
2024-11-07 16:53   ` Eric Dumazet
2024-11-07 22:13   ` Kuniyuki Iwashima
2024-11-09 21:50 ` [PATCH net-next v9 0/6] Improve neigh_flush_dev performance patchwork-bot+netdevbpf

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.