Skip to content

tcp/dccp: better use of ephemeral ports

Eric Dumazet netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyIn review
  2. v12 patches 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tcp/dccp: better use of ephemeral ports in connect()net/ipv4/inet_hashtables.c+85 -850 replies
2/2tcp/dccp: better use of ephemeral ports in bind()net/ipv4/inet_connection_sock.c+114 -1260 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 net-next 0/2] tcp/dccp: better use of ephemeral ports

Big servers have bloated bind table, making very hard to succeed ephemeral port allocations, without special containers/namespace tricks.

This patch series extends the strategy added in commit 07f4c90062f8 ("tcp/dccp: try to not exhaust ip_local_port_range in connect()").

Since ports used by connect() are much likely to be shared among them, we give a hint to both bind() and connect() to keep the crowds separated if possible.

Of course, if on a specific host an application needs to allocate ~30000 ports using bind(), it will still be able to do so. Same for ~30000 connect() to a unique 2-tuple (dst addr, dst port)

New implemetation is also more friendly to softirqs and reschedules.

v2: rebase after TCP SO_REUSEPORT changes

Eric Dumazet (2):
tcp/dccp: better use of ephemeral ports in connect() tcp/dccp: better use of ephemeral ports in bind()

 net/ipv4/inet_connection_sock.c | 240 +++++++++++++++++++---------------------
 net/ipv4/inet_hashtables.c      | 170 ++++++++++++++--------------
 2 files changed, 199 insertions(+), 211 deletions(-)
Signature · 1 line
2.7.0.rc3.207.g0ac5344