All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Steve Zabele <zabele@comcast.net>
Cc: Network Development <netdev@vger.kernel.org>,
	shum@canndrew.org, vladimir116@gmail.com,
	saifi.khan@datasynergy.org, saifi.khan@strikr.in,
	Daniel Borkmann <daniel@iogearbox.net>,
	on2k16nm@gmail.com,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: Is bug 200755 in anyone's queue??
Date: Fri, 30 Aug 2019 10:54:38 +0200	[thread overview]
Message-ID: <8f4bda24-5bd4-3f12-4c98-5e1097dde84a@gmail.com> (raw)
In-Reply-To: <CA+FuTSdu5inPWp_jkUcFnb-Fs-rdk0AMiieCYtjLE7Qs5oFWZQ@mail.gmail.com>



On 8/29/19 9:26 PM, Willem de Bruijn wrote:

> SO_REUSEPORT was not intended to be used in this way. Opening
> multiple connected sockets with the same local port.
> 
> But since the interface allowed connect after joining a group, and
> that is being used, I guess that point is moot. Still, I'm a bit
> surprised that it ever worked as described.
> 
> Also note that the default distribution algorithm is not round robin
> assignment, but hash based. So multiple consecutive datagrams arriving
> at the same socket is not unexpected.
> 
> I suspect that this quick hack might "work". It seemed to on the
> supplied .c file:
> 
>                   score = compute_score(sk, net, saddr, sport,
>                                         daddr, hnum, dif, sdif);
>                   if (score > badness) {
>   -                       if (sk->sk_reuseport) {
>   +                       if (sk->sk_reuseport && !sk->sk_state !=
> TCP_ESTABLISHED) {
> 
> But a more robust approach, that also works on existing kernels, is to
> swap the default distribution algorithm with a custom BPF based one (
> SO_ATTACH_REUSEPORT_EBPF).
> 

Yes, I suspect that reuseport could still be used by to load-balance incoming packets
targetting the same 4-tuple.

So all sockets would have the same score, and we would select the first socket in
the list (if not applying reuseport hashing)


  parent reply	other threads:[~2019-08-30  8:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <010601d53bdc$79c86dc0$6d594940$@net>
     [not found] ` <20190716070246.0745ee6f@hermes.lan>
2019-08-23 19:02   ` Is bug 200755 in anyone's queue?? Steve Zabele
2019-08-29 19:26     ` Willem de Bruijn
2019-08-30  8:48       ` Steve Zabele
2019-08-30  8:53       ` Steve Zabele
2019-08-30  8:54       ` Eric Dumazet [this message]
2019-08-30 20:30         ` Willem de Bruijn
2019-09-03 17:55           ` Willem de Bruijn
2019-09-04 10:28             ` Steve Zabele
2019-09-04 12:00               ` Mark KEATON
2019-09-04 12:23                 ` Eric Dumazet
2019-09-04 14:23                   ` Willem de Bruijn
2019-09-04 14:51                   ` Steve Zabele
2019-09-04 15:46                     ` Willem de Bruijn
2019-09-04 19:26                       ` Eric Dumazet
2019-09-10 15:52                       ` Willem de Bruijn
2019-09-10 16:56                         ` Paolo Abeni
2019-09-10 17:10                           ` Willem de Bruijn
2019-08-23 19:04   ` Steve Zabele

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=8f4bda24-5bd4-3f12-4c98-5e1097dde84a@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=on2k16nm@gmail.com \
    --cc=saifi.khan@datasynergy.org \
    --cc=saifi.khan@strikr.in \
    --cc=shum@canndrew.org \
    --cc=stephen@networkplumber.org \
    --cc=vladimir116@gmail.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=zabele@comcast.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.