netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] inetpeer: reduce false sharing and atomic operations
@ 2024-12-13 13:02 Eric Dumazet
  2024-12-13 13:02 ` [PATCH net-next 1/4] inetpeer: remove create argument of inet_getpeer_v[46]() Eric Dumazet
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Eric Dumazet @ 2024-12-13 13:02 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: netdev, Simon Horman, David Ahern, Kuniyuki Iwashima,
	eric.dumazet, Eric Dumazet

After commit 8c2bd38b95f7 ("icmp: change the order of rate limits"),
there is a risk that a host receiving packets from an unique
source targeting closed ports is using a common inet_peer structure
from many cpus.

All these cpus have to acquire/release a refcount and update
the inet_peer timestamp (p->dtime)

Switch to pure RCU to avoid changing the refcount, and update
p->dtime only once per jiffy.

Tested:
  DUT : 128 cores, 32 hw rx queues.
  receiving 8,400,000 UDP packets per second, targeting closed ports.

Before the series:
- napi poll can not keep up, NIC drops 1,200,000 packets
  per second. 
- We use 20 % of cpu cycles

After this series:
- All packets are received (no more hw drops)
- We use 12 % of cpu cycles.

Eric Dumazet (4):
  inetpeer: remove create argument of inet_getpeer_v[46]()
  inetpeer: remove create argument of inet_getpeer()
  inetpeer: update inetpeer timestamp in inet_getpeer()
  inetpeer: do not get a refcount in inet_getpeer()

 include/net/inetpeer.h | 12 +++++-------
 net/ipv4/icmp.c        |  6 +++---
 net/ipv4/inetpeer.c    | 29 ++++++++---------------------
 net/ipv4/ip_fragment.c | 15 ++++++++++-----
 net/ipv4/route.c       | 17 +++++++++--------
 net/ipv6/icmp.c        |  6 +++---
 net/ipv6/ip6_output.c  |  6 +++---
 net/ipv6/ndisc.c       |  8 +++++---
 8 files changed, 46 insertions(+), 53 deletions(-)

-- 
2.47.1.613.gc27f4b7a9f-goog


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

end of thread, other threads:[~2024-12-15 17:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-13 13:02 [PATCH net-next 0/4] inetpeer: reduce false sharing and atomic operations Eric Dumazet
2024-12-13 13:02 ` [PATCH net-next 1/4] inetpeer: remove create argument of inet_getpeer_v[46]() Eric Dumazet
2024-12-13 13:02 ` [PATCH net-next 2/4] inetpeer: remove create argument of inet_getpeer() Eric Dumazet
2024-12-13 20:16   ` Simon Horman
2024-12-13 20:47     ` Eric Dumazet
2024-12-14 14:34   ` kernel test robot
2024-12-13 13:02 ` [PATCH net-next 3/4] inetpeer: update inetpeer timestamp in inet_getpeer() Eric Dumazet
2024-12-15 15:34   ` Ido Schimmel
2024-12-13 13:02 ` [PATCH net-next 4/4] inetpeer: do not get a refcount " Eric Dumazet
2024-12-15 15:48   ` Ido Schimmel
2024-12-15 17:42     ` Eric Dumazet

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