diff options
author | Eric Dumazet <[email protected]> | 2023-12-14 19:29:39 +0000 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2023-12-15 17:56:27 -0800 |
commit | 207184853dbdb62d8b02c7a141d3297e94e33451 (patch) | |
tree | dcf0343765740f75ebd2b1af6a36fca7c85d491f /tools/testing/selftests/bpf/progs/test_autoload.c | |
parent | 41db7626b73210cb99eea9cf672dcfce58c68ab2 (diff) |
tcp/dccp: change source port selection at connect() time
In commit 1580ab63fc9a ("tcp/dccp: better use of ephemeral ports in connect()")
we added an heuristic to select even ports for connect() and odd ports for bind().
This was nice because no applications changes were needed.
But it added more costs when all even ports are in use,
when there are few listeners and many active connections.
Since then, IP_LOCAL_PORT_RANGE has been added to permit an application
to partition ephemeral port range at will.
This patch extends the idea so that if IP_LOCAL_PORT_RANGE is set on
a socket before accept(), port selection no longer favors even ports.
This means that connect() can find a suitable source port faster,
and applications can use a different split between connect() and bind()
users.
This should give more entropy to Toeplitz hash used in RSS: Using even
ports was wasting one bit from the 16bit sport.
A similar change can be done in inet_csk_find_open_port() if needed.
Signed-off-by: Eric Dumazet <[email protected]>
Cc: Jakub Sitnicki <[email protected]>
Reviewed-by: Kuniyuki Iwashima <[email protected]>
Reviewed-by: Jason Xing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_autoload.c')
0 files changed, 0 insertions, 0 deletions