Merge branch 'net-inet-retire-port-only-listening_hash'
authorJakub Kicinski <kuba@kernel.org>
Thu, 12 May 2022 23:52:21 +0000 (16:52 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 May 2022 23:52:22 +0000 (16:52 -0700)
commitb67fd3d9d94223b424674f45eeadeff58b4b03ef
tree7d2bdd36a14880cafe9595bf3317696342ea33b9
parent0c1822d9072538cf8e10dc0ab08842700e717d8e
parentec8cb4f617a23700d37018d249e3b05149d44a38
Merge branch 'net-inet-retire-port-only-listening_hash'

Martin KaFai Lau says:

====================
net: inet: Retire port only listening_hash

This series is to retire the port only listening_hash.

The listen sk is currently stored in two hash tables,
listening_hash (hashed by port) and lhash2 (hashed by port and address).

After commit 0ee58dad5b06 ("net: tcp6: prefer listeners bound to an address")
and commit d9fbc7f6431f ("net: tcp: prefer listeners bound to an address"),
the TCP-SYN lookup fast path does not use listening_hash.

The commit 05c0b35709c5 ("tcp: seq_file: Replace listening_hash with lhash2")
also moved the seq_file (/proc/net/tcp) iteration usage from
listening_hash to lhash2.

There are still a few listening_hash usages left.
One of them is inet_reuseport_add_sock() which uses the listening_hash
to search a listen sk during the listen() system call.  This turns
out to be very slow on use cases that listen on many different
VIPs at a popular port (e.g. 443).  [ On top of the slowness in
adding to the tail in the IPv6 case ]. A latter patch has a
selftest to demonstrate this case.

This series takes this chance to move all remaining listening_hash
usages to lhash2 and then retire listening_hash.
====================

Link: https://lore.kernel.org/r/20220512000546.188616-1-kafai@fb.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>