From: Flavio Leitner <fbl@redhat.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
Marcelo Ricardo Leitner <mleitner@redhat.com>
Subject: Re: [PATCH net-next 2/2] tcp: improve REUSEADDR/NOREUSEADDR cohabitation
Date: Thu, 21 May 2015 17:37:36 -0300 [thread overview]
Message-ID: <20150521203736.GI2379@x240.home> (raw)
In-Reply-To: <1432144742-17786-3-git-send-email-edumazet@google.com>
On Wed, May 20, 2015 at 10:59:02AM -0700, Eric Dumazet wrote:
> inet_csk_get_port() randomization effort tends to spread
> sockets on all the available range (ip_local_port_range)
>
> This is unfortunate because SO_REUSEADDR sockets have
> less requirements than non SO_REUSEADDR ones.
>
> If an application uses SO_REUSEADDR hint, it is to try to
> allow source ports being shared.
>
> So instead of picking a random port number in ip_local_port_range,
> lets try first in first half of the range.
>
> This gives more chances to use upper half of the range for the
> sockets with strong requirements (not using SO_REUSEADDR)
>
> Note this patch does not add a new sysctl, and only changes
> the way we try to pick port number.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Marcelo Ricardo Leitner <mleitner@redhat.com>
> Cc: Flavio Leitner <fbl@redhat.com>
> ---
The only downside I can see is that after the patch the applications
using the SO_REUSEADDR will reuse ports more often and that could
potentially trigger some bug.
Looks like a good change to me.
Acked-by: Flavio Leitner <fbl@redhat.com>
next prev parent reply other threads:[~2015-05-21 20:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 17:59 [PATCH net-next 0/2] tcp: improve source port selection Eric Dumazet
2015-05-20 17:59 ` [PATCH net-next 1/2] inet_hashinfo: remove bsocket counter Eric Dumazet
2015-05-21 20:10 ` Flavio Leitner
2015-05-20 17:59 ` [PATCH net-next 2/2] tcp: improve REUSEADDR/NOREUSEADDR cohabitation Eric Dumazet
2015-05-21 20:37 ` Flavio Leitner [this message]
2015-05-21 22:55 ` [PATCH net-next 0/2] tcp: improve source port selection David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150521203736.GI2379@x240.home \
--to=fbl@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=mleitner@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).