net: rfs: add sock_rps_delete_flow() helper
authorEric Dumazet <edumazet@google.com>
Thu, 15 May 2025 10:03:54 +0000 (10:03 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 16 May 2025 23:03:48 +0000 (16:03 -0700)
commit9cd5ef0b8c04c46a15c8f5d002f02ea0d0477790
tree8fe626057698681774a6e9affe03a7d020530e99
parentf24f7b2f3af9e008ded20f804d7829ee2efd43f2
net: rfs: add sock_rps_delete_flow() helper

RFS can exhibit lower performance for workloads using short-lived
flows and a small set of 4-tuple.

This is often the case for load-testers, using a pair of hosts,
if the server has a single listener port.

Typical use case :

Server : tcp_crr -T128 -F1000 -6 -U -l30 -R 14250
Client : tcp_crr -T128 -F1000 -6 -U -l30 -c -H server | grep local_throughput

This is because RFS global hash table contains stale information,
when the same RSS key is recycled for another socket and another cpu.

Make sure to undo the changes and go back to initial state when
a flow is disconnected.

Performance of the above test is increased by 22 %,
going from 372604 transactions per second to 457773.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Octavian Purdila <tavip@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20250515100354.3339920-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/rps.h
net/ipv4/inet_hashtables.c
net/ipv4/udp.c
net/sctp/socket.c