tcp: do not mess with listener sk_wmem_alloc
authorEric Dumazet <edumazet@google.com>
Thu, 14 Apr 2016 05:05:39 +0000 (22:05 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Apr 2016 20:45:44 +0000 (16:45 -0400)
commitb3d051477cf94e9d71d6acadb8a90de15237b9c1
tree59009bc698f472b31b15059972e6904cd9272d32
parentac18dd9e842294377dbaf1e8d169493567a81fa1
tcp: do not mess with listener sk_wmem_alloc

When removing sk_refcnt manipulation on synflood, I missed that
using skb_set_owner_w() was racy, if sk->sk_wmem_alloc had already
transitioned to 0.

We should hold sk_refcnt instead, but this is a big deal under attack.
(Doing so increase performance from 3.2 Mpps to 3.8 Mpps only)

In this patch, I chose to not attach a socket to syncookies skb.

Performance is now 5 Mpps instead of 3.2 Mpps.

Following patch will remove last known false sharing in
tcp_rcv_state_process()

Fixes: 3b24d854cb35 ("tcp/dccp: do not touch listener sk_refcnt under synflood")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tcp.h
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_output.c
net/ipv6/tcp_ipv6.c