netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/10] udp: increase RX performance under stress
@ 2025-09-16 16:09 Eric Dumazet
  2025-09-16 16:09 ` [PATCH net-next 01/10] ipv6: make ipv6_pinfo.saddr_cache a boolean Eric Dumazet
                   ` (11 more replies)
  0 siblings, 12 replies; 55+ messages in thread
From: Eric Dumazet @ 2025-09-16 16:09 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Willem de Bruijn, Kuniyuki Iwashima, David Ahern,
	netdev, eric.dumazet, Eric Dumazet

This series is the result of careful analysis of UDP stack,
to optimize the receive side, especially when under one or several
UDP sockets are receiving a DDOS attack.

I have measured a 47 % increase of throughput when using
IPv6 UDP packets with 120 bytes of payload, under DDOS.

16 cpus are receiving traffic targeting a single socket.

Even after adding NUMA aware drop counters, we were suffering
from false sharing between packet producers and the consumer.

1) First four patches are shrinking struct ipv6_pinfo size
   and reorganize fields to get more efficient TX path.
   They should also benefit TCP, by removing one cache line miss.

2) patches 5 & 6 changes how sk->sk_rmem_alloc is read and updated.
   They reduce reduce spinlock contention on the busylock.

3) Patches 7 & 8 change the ordering of sk_backlog (including
   sk_rmem_alloc) sk_receive_queue and sk_drop_counters for
   better data locality.

4) Patch 9 removes the hashed array of spinlocks in favor of
   a per-udp-socket one.

5) Final patch adopts skb_attempt_defer_free(), after TCP got
   good results with it.


Eric Dumazet (10):
  ipv6: make ipv6_pinfo.saddr_cache a boolean
  ipv6: make ipv6_pinfo.daddr_cache a boolean
  ipv6: np->rxpmtu race annotation
  ipv6: reorganise struct ipv6_pinfo
  udp: refine __udp_enqueue_schedule_skb() test
  udp: update sk_rmem_alloc before busylock acquisition
  net: group sk_backlog and sk_receive_queue
  udp: add udp_drops_inc() helper
  udp: make busylock per socket
  udp: use skb_attempt_defer_free()

 include/linux/ipv6.h             | 37 ++++++++++++-----------
 include/linux/udp.h              |  1 +
 include/net/ip6_route.h          |  8 ++---
 include/net/sock.h               |  4 +--
 include/net/udp.h                |  6 ++++
 net/core/sock.c                  |  1 -
 net/ipv4/udp.c                   | 50 ++++++++++++++------------------
 net/ipv6/af_inet6.c              |  2 +-
 net/ipv6/inet6_connection_sock.c |  2 +-
 net/ipv6/ip6_output.c            |  6 ++--
 net/ipv6/raw.c                   |  2 +-
 net/ipv6/route.c                 |  7 ++---
 net/ipv6/tcp_ipv6.c              |  4 +--
 net/ipv6/udp.c                   |  8 ++---
 14 files changed, 69 insertions(+), 69 deletions(-)

-- 
2.51.0.384.g4c02a37b29-goog


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

end of thread, other threads:[~2025-10-13 22:13 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 16:09 [PATCH net-next 00/10] udp: increase RX performance under stress Eric Dumazet
2025-09-16 16:09 ` [PATCH net-next 01/10] ipv6: make ipv6_pinfo.saddr_cache a boolean Eric Dumazet
2025-09-17 14:59   ` Willem de Bruijn
2025-09-17 15:30   ` David Ahern
2025-09-17 17:56   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 02/10] ipv6: make ipv6_pinfo.daddr_cache " Eric Dumazet
2025-09-17 14:59   ` Willem de Bruijn
2025-09-17 15:33   ` David Ahern
2025-09-17 17:57   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 03/10] ipv6: np->rxpmtu race annotation Eric Dumazet
2025-09-17 14:59   ` Willem de Bruijn
2025-09-17 15:34   ` David Ahern
2025-09-17 17:59   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 04/10] ipv6: reorganise struct ipv6_pinfo Eric Dumazet
2025-09-17 15:00   ` Willem de Bruijn
2025-09-17 15:36   ` David Ahern
2025-09-17 18:01   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 05/10] udp: refine __udp_enqueue_schedule_skb() test Eric Dumazet
2025-09-17 15:00   ` Willem de Bruijn
2025-09-17 15:57     ` Eric Dumazet
2025-09-17 17:53       ` Kuniyuki Iwashima
2025-09-17 19:07         ` Willem de Bruijn
2025-09-17 15:39   ` David Ahern
2025-09-16 16:09 ` [PATCH net-next 06/10] udp: update sk_rmem_alloc before busylock acquisition Eric Dumazet
2025-09-17 15:01   ` Willem de Bruijn
2025-09-17 16:07     ` Eric Dumazet
2025-09-17 19:14       ` Willem de Bruijn
2025-09-17 15:44   ` David Ahern
2025-09-17 18:02   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 07/10] net: group sk_backlog and sk_receive_queue Eric Dumazet
2025-09-17 15:01   ` Willem de Bruijn
2025-09-17 15:45   ` David Ahern
2025-09-17 18:11   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 08/10] udp: add udp_drops_inc() helper Eric Dumazet
2025-09-17 15:02   ` Willem de Bruijn
2025-09-17 15:47   ` David Ahern
2025-09-17 18:13   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 09/10] udp: make busylock per socket Eric Dumazet
2025-09-16 16:31   ` Willem de Bruijn
2025-09-16 17:10     ` Eric Dumazet
2025-09-16 19:15       ` Willem de Bruijn
2025-09-17 15:03   ` Willem de Bruijn
2025-09-17 15:52   ` David Ahern
2025-09-17 18:15   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 10/10] udp: use skb_attempt_defer_free() Eric Dumazet
2025-09-17 15:03   ` Willem de Bruijn
2025-09-17 15:55   ` David Ahern
2025-09-17 16:15   ` Paolo Abeni
2025-09-17 16:32     ` Eric Dumazet
2025-09-18  6:38       ` Paolo Abeni
2025-09-17 18:20   ` Kuniyuki Iwashima
2025-10-13 21:44   ` [REGRESSION] xfrm issue bisected to 6471658dc66c ("udp: use skb_attempt_defer_free()") Michal Kubecek
2025-10-13 22:12     ` Eric Dumazet
2025-09-18  1:03 ` [PATCH net-next 00/10] udp: increase RX performance under stress Jakub Kicinski
2025-09-18  8:40 ` patchwork-bot+netdevbpf

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