inet: kill smallest_size and smallest_port
authorJosef Bacik <jbacik@fb.com>
Tue, 17 Jan 2017 15:51:03 +0000 (07:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Jan 2017 18:04:29 +0000 (13:04 -0500)
commitb9470c27607bed1ad3450de789c154f225530112
tree11150f05be244287d081d257889138f6cfce2a9d
parentaa078842b702b4a45111f028a604a6c8f69cb27d
inet: kill smallest_size and smallest_port

In inet_csk_get_port we seem to be using smallest_port to figure out where the
best place to look for a SO_REUSEPORT sk that matches with an existing set of
SO_REUSEPORT's.  However if we get to the logic

if (smallest_size != -1) {
port = smallest_port;
goto have_port;
}

we will do a useless search, because we would have already done the
inet_csk_bind_conflict for that port and it would have returned 1, otherwise we
would have gone to found_tb and succeeded.  Since this logic makes us do yet
another trip through inet_csk_bind_conflict for a port we know won't work just
delete this code and save us the time.

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
net/ipv4/inet_hashtables.c