aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/xt_socket.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-04-01 08:52:17 -0700
committerDavid S. Miller <davem@davemloft.net>2016-04-04 22:11:20 -0400
commit3b24d854cb35383c30642116e5992fd619bdc9bc (patch)
treea2a0c8c8ad3f7f974d6a9b11b17865edfb62d6d1 /net/netfilter/xt_socket.c
parentinet: reqsk_alloc() needs to take care of dead listeners (diff)
downloadlinux-dev-3b24d854cb35383c30642116e5992fd619bdc9bc.tar.xz
linux-dev-3b24d854cb35383c30642116e5992fd619bdc9bc.zip
tcp/dccp: do not touch listener sk_refcnt under synflood
When a SYNFLOOD targets a non SO_REUSEPORT listener, multiple cpus contend on sk->sk_refcnt and sk->sk_wmem_alloc changes. By letting listeners use SOCK_RCU_FREE infrastructure, we can relax TCP_LISTEN lookup rules and avoid touching sk_refcnt Note that we still use SLAB_DESTROY_BY_RCU rules for other sockets, only listeners are impacted by this change. Peak performance under SYNFLOOD is increased by ~33% : On my test machine, I could process 3.2 Mpps instead of 2.4 Mpps Most consuming functions are now skb_set_owner_w() and sock_wfree() contending on sk->sk_wmem_alloc when cooking SYNACK and freeing them. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/netfilter/xt_socket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c
index 49d14ecad444..b10ade272b50 100644
--- a/net/netfilter/xt_socket.c
+++ b/net/netfilter/xt_socket.c
@@ -120,9 +120,9 @@ xt_socket_get_sock_v4(struct net *net, struct sk_buff *skb, const int doff,
{
switch (protocol) {
case IPPROTO_TCP:
- return __inet_lookup(net, &tcp_hashinfo, skb, doff,
- saddr, sport, daddr, dport,
- in->ifindex);
+ return inet_lookup(net, &tcp_hashinfo, skb, doff,
+ saddr, sport, daddr, dport,
+ in->ifindex);
case IPPROTO_UDP:
return udp4_lib_lookup(net, saddr, sport, daddr, dport,
in->ifindex);