]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: prepare fastopen code for upcoming listener changes
authorEric Dumazet <edumazet@google.com>
Tue, 29 Sep 2015 14:42:52 +0000 (07:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Sep 2015 23:53:10 +0000 (16:53 -0700)
commitf63a620c0301503d04f62113e7486df28fa11be2
tree335da15ef581d750ada2ba11e6ca6900ba82ae86
parent6a771c4ccfe6a77acfe522c6bc7f9b9d9baf803e
tcp: prepare fastopen code for upcoming listener changes

While auditing TCP stack for upcoming 'lockless' listener changes,
I found I had to change fastopen_init_queue() to properly init the object
before publishing it.

Otherwise an other cpu could try to lock the spinlock before it gets
properly initialized.

Instead of adding appropriate barriers, just remove dynamic memory
allocations :
- Structure is 28 bytes on 64bit arches. Using additional 8 bytes
  for holding a pointer seems overkill.
- Two listeners can share same cache line and performance would suffer.

If we really want to save few bytes, we would instead dynamically allocate
whole struct request_sock_queue in the future.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/tcp.h
include/net/request_sock.h
net/core/request_sock.c
net/ipv4/af_inet.c
net/ipv4/inet_connection_sock.c
net/ipv4/tcp.c
net/ipv4/tcp_fastopen.c
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c