]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
inet: reset tb->fastreuseport when adding a reuseport sk
authorJosef Bacik <jbacik@fb.com>
Tue, 17 Jan 2017 15:51:06 +0000 (07:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Jan 2017 18:04:29 +0000 (13:04 -0500)
commit637bc8bbe6c0a288a596edfdcdd5657c72a848db
tree32d780078fd8ec3257216e568cf06a0bac5ca581
parent289141b7688b71dc69b8d7a54bf67a4d7bc79f96
inet: reset tb->fastreuseport when adding a reuseport sk

If we have non reuseport sockets on a tb we will set tb->fastreuseport to 0 and
never set it again.  Which means that in the future if we end up adding a bunch
of reuseport sk's to that tb we'll have to do the expensive scan every time.
Instead add the ipv4/ipv6 saddr fields to the bind bucket, as well as the family
so we know what comparison to make, and the ipv6 only setting so we can make
sure to compare with new sockets appropriately.  Once one sk has made it onto
the list we know that there are no potential bind conflicts on the owners list
that match that sk's rcv_addr.  So copy the sk's information into our bind
bucket and set tb->fastruseport to FASTREUSESOCK_STRICT so we know we have to do
an extra check for subsequent reuseport sockets and skip the expensive bind
conflict check.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_hashtables.h
net/ipv4/inet_connection_sock.c