diff options
author | Joanne Koong <joannelkoong@gmail.com> | 2022-08-22 21:10:22 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-08-25 05:30:09 +0300 |
commit | c35ecb95c448cde15cbde8fde93350d50bcc8be7 (patch) | |
tree | 88b05db4ea0bc9bfb62c08b954edd85c76d5e411 /tools/testing/selftests/net/.gitignore | |
parent | 28044fc1d4953b07acec0da4d2fc4784c57ea6fb (diff) | |
download | linux-c35ecb95c448cde15cbde8fde93350d50bcc8be7.tar.xz |
selftests/net: Add test for timing a bind request to a port with a populated bhash entry
This test populates the bhash table for a given port with
MAX_THREADS * MAX_CONNECTIONS sockets, and then times how long
a bind request on the port takes.
When populating the bhash table, we create the sockets and then bind
the sockets to the same address and port (SO_REUSEADDR and SO_REUSEPORT
are set). When timing how long a bind on the port takes, we bind on a
different address without SO_REUSEPORT set. We do not set SO_REUSEPORT
because we are interested in the case where the bind request does not
go through the tb->fastreuseport path, which is fragile (eg
tb->fastreuseport path does not work if binding with a different uid).
To run the script:
Usage: ./bind_bhash.sh [-6 | -4] [-p port] [-a address]
6: use ipv6
4: use ipv4
port: Port number
address: ip address
Without any arguments, ./bind_bhash.sh defaults to ipv6 using ip address
"2001:0db8:0:f101::1" on port 443.
On my local machine, I see:
ipv4:
before - 0.002317 seconds
with bhash2 - 0.000020 seconds
ipv6:
before - 0.002431 seconds
with bhash2 - 0.000021 seconds
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/.gitignore')
-rw-r--r-- | tools/testing/selftests/net/.gitignore | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/.gitignore b/tools/testing/selftests/net/.gitignore index 0e5751af6247..89e2d4aa812a 100644 --- a/tools/testing/selftests/net/.gitignore +++ b/tools/testing/selftests/net/.gitignore @@ -39,4 +39,5 @@ toeplitz tun cmsg_sender unix_connect -tap
\ No newline at end of file +tap +bind_bhash |