]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4/tcp: do not use per netns ctl sockets
authorEric Dumazet <edumazet@google.com>
Mon, 24 Jan 2022 20:24:57 +0000 (12:24 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Jan 2022 11:25:21 +0000 (11:25 +0000)
commit230251a2bc3f19e66f3bc77e4a2aa495366b5eb5
treef989ea5f702b3dadd7d38739768d443129534913
parentcb70e14fb38d687f693b70dd467618c55cf142e9
ipv4/tcp: do not use per netns ctl sockets

TCP ipv4 uses per-cpu/per-netns ctl sockets in order to send
RST and some ACK packets (on behalf of TIMEWAIT sockets).

This adds memory and cpu costs, which do not seem needed.
Now typical servers have 256 or more cores, this adds considerable
tax to netns users.

tcp sockets are used from BH context, are not receiving packets,
and do not store any persistent state but the 'struct net' pointer
in order to be able to use IPv4 output functions.

Note that I attempted a related change in the past, that had
to be hot-fixed in commit 8bcad8c7e6ec ("ipv4: tcp: get rid of ugly unicast_sock")

This patch could very well surface old bugs, on layers not
taking care of sk->sk_kern_sock properly.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/netns/ipv4.h
net/ipv4/tcp_ipv4.c