]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Merge branch 'net-better-drop-accounting'
authorPaolo Abeni <pabeni@redhat.com>
Thu, 28 Aug 2025 11:14:52 +0000 (13:14 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 28 Aug 2025 11:14:52 +0000 (13:14 +0200)
Eric Dumazet says:

====================
net: better drop accounting

Incrementing sk->sk_drops for every dropped packet can
cause serious cache line contention under DOS.

Add optional sk->sk_drop_counters pointer so that
protocols can opt-in to use two dedicated cache lines
to hold drop counters.

Convert UDP and RAW to use this infrastructure.

Tested on UDP (see patch 4/5 for details)

Before:

nstat -n ; sleep 1 ; nstat | grep Udp
Udp6InDatagrams                 615091             0.0
Udp6InErrors                    3904277            0.0
Udp6RcvbufErrors                3904277            0.0

After:

nstat -n ; sleep 1 ; nstat | grep Udp
Udp6InDatagrams                 816281             0.0
Udp6InErrors                    7497093            0.0
Udp6RcvbufErrors                7497093            0.0
====================

Link: https://patch.msgid.link/20250826125031.1578842-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Trivial merge