netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/3] tcp: Consider every port when connecting with IP_LOCAL_PORT_RANGE
@ 2025-07-14 16:03 Jakub Sitnicki
  2025-07-14 16:03 ` [PATCH net-next v3 1/3] tcp: Add RCU management to inet_bind2_bucket Jakub Sitnicki
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jakub Sitnicki @ 2025-07-14 16:03 UTC (permalink / raw)
  To: Eric Dumazet, Paolo Abeni, David S. Miller, Jakub Kicinski,
	Neal Cardwell, Kuniyuki Iwashima
  Cc: netdev, kernel-team, Lee Valentine

Please see patch 2 for details.

I stress tested it following the recipe from commit 86c2bc293b81 ("tcp: use
RCU lookup in __inet_hash_connect()"). Didn't notice any regression in
latency_mean or throughput.

Test command:

  $ vng -r ~/src/linux 'ulimit -n 40000; \
  ./tcp_crr --nolog -6 -T 80 -F 12000 >/dev/null & \
  ./tcp_crr --nolog -6 -T 80 -F 12000 -c -H ::1 -l 120 --ip-local-port-range'

neper was patched to setsockopt(IP_LOCAL_PORT_RANGE, 1 | 65535 << 16) when
--ip-local-port-range flag is set.

---
Changes in v3:
- Make (struct inet_bind_bucket *)->bhash2 RCU safe (patch 1)
- Always skip inet_bind2_bucket's with v6 wildcard sockets
- Link to v2: https://lore.kernel.org/r/20250703-connect-port-search-harder-v2-1-d51bce6bd0a6@cloudflare.com

Changes in v2:
- Fix unused var warning when CONFIG_IPV6=n
- Convert INADDR_ANY to network byte order before comparison
- Link to v1: https://lore.kernel.org/r/20250626120247.1255223-1-jakub@cloudflare.com

---
To: Eric Dumazet <edumazet@google.com>
To: Paolo Abeni <pabeni@redhat.com>
To: David S. Miller <davem@davemloft.net>
To: Jakub Kicinski <kuba@kernel.org>
To: Neal Cardwell <ncardwell@google.com>
To: Kuniyuki Iwashima <kuniyu@google.com>
Cc: netdev@vger.kernel.org
Cc: kernel-team@cloudflare.com

---
Jakub Sitnicki (3):
      tcp: Add RCU management to inet_bind2_bucket
      tcp: Consider every port when connecting with IP_LOCAL_PORT_RANGE
      selftests/net: Cover port sharing scenarios with IP_LOCAL_PORT_RANGE

 include/net/inet_hashtables.h                      |   4 +-
 include/net/inet_timewait_sock.h                   |   3 +-
 net/ipv4/inet_connection_sock.c                    |   2 +-
 net/ipv4/inet_hashtables.c                         |  72 ++-
 net/ipv4/inet_timewait_sock.c                      |   8 +-
 tools/testing/selftests/net/ip_local_port_range.c  | 524 +++++++++++++++++++++
 tools/testing/selftests/net/ip_local_port_range.sh |  14 +-
 7 files changed, 602 insertions(+), 25 deletions(-)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-07-17 11:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14 16:03 [PATCH net-next v3 0/3] tcp: Consider every port when connecting with IP_LOCAL_PORT_RANGE Jakub Sitnicki
2025-07-14 16:03 ` [PATCH net-next v3 1/3] tcp: Add RCU management to inet_bind2_bucket Jakub Sitnicki
2025-07-14 16:03 ` [PATCH net-next v3 2/3] tcp: Consider every port when connecting with IP_LOCAL_PORT_RANGE Jakub Sitnicki
2025-07-17  9:23   ` Paolo Abeni
2025-07-17  9:44     ` Jakub Sitnicki
2025-07-17 11:21       ` Jakub Sitnicki
2025-07-14 16:03 ` [PATCH net-next v3 3/3] selftests/net: Cover port sharing scenarios " Jakub Sitnicki
2025-07-17  9:27   ` Paolo Abeni
2025-07-17  9:44     ` Jakub Sitnicki
2025-07-17  9:34   ` Paolo Abeni
2025-07-17  9:50     ` Jakub Sitnicki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).