netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Cc: "David S . Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Craig Gallek <kraig@google.com>, Paolo Abeni <pabeni@redhat.com>,
	Network Development <netdev@vger.kernel.org>,
	Kuniyuki Iwashima <kuni1840@gmail.com>,
	Benjamin Herrenschmidt <benh@amazon.com>,
	osa-contribution-log@amazon.com
Subject: Re: [PATCH net 1/2] udp: Copy has_conns in reuseport_grow().
Date: Tue, 21 Jul 2020 08:25:04 -0400	[thread overview]
Message-ID: <CA+FuTSeWNarNvhPeg4Z-97Xsz_7H1WvW6NshC7VLnVwECxLqfw@mail.gmail.com> (raw)
In-Reply-To: <20200721061531.94236-2-kuniyu@amazon.co.jp>

On Tue, Jul 21, 2020 at 2:16 AM Kuniyuki Iwashima <kuniyu@amazon.co.jp> wrote:
>
> If an unconnected socket in a UDP reuseport group connect()s, has_conns is
> set to 1. Then, when a packet is received, udp[46]_lib_lookup2() scans all
> sockets in udp_hslot looking for the connected socket with the highest
> score.
>
> However, when the number of sockets bound to the port exceeds max_socks,
> reuseport_grow() resets has_conns to 0. It can cause udp[46]_lib_lookup2()
> to return without scanning all sockets, resulting in that packets sent to
> connected sockets may be distributed to unconnected sockets.
>
> Therefore, reuseport_grow() should copy has_conns.
>
> Fixes: acdcecc61285 ("udp: correct reuseport selection with connected sockets")
> CC: Willem de Bruijn <willemb@google.com>
> Reviewed-by: Benjamin Herrenschmidt <benh@amazon.com>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>

Acked-by: Willem de Bruijn <willemb@google.com>

Thanks. Yes, I missed this resize operation when adding the field.

  reply	other threads:[~2020-07-21 12:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21  6:15 [PATCH net 0/2] udp: Fix reuseport selection with connected sockets Kuniyuki Iwashima
2020-07-21  6:15 ` [PATCH net 1/2] udp: Copy has_conns in reuseport_grow() Kuniyuki Iwashima
2020-07-21 12:25   ` Willem de Bruijn [this message]
2020-07-21  6:15 ` [PATCH net 2/2] udp: Improve load balancing for SO_REUSEPORT Kuniyuki Iwashima
2020-07-21 12:33   ` Willem de Bruijn
2020-07-21 22:32 ` [PATCH net 0/2] udp: Fix reuseport selection with connected sockets David Miller
2020-07-22  4:28   ` Kuniyuki Iwashima

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=CA+FuTSeWNarNvhPeg4Z-97Xsz_7H1WvW6NshC7VLnVwECxLqfw@mail.gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=benh@amazon.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kraig@google.com \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@amazon.co.jp \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    --cc=osa-contribution-log@amazon.com \
    --cc=pabeni@redhat.com \
    --cc=yoshfuji@linux-ipv6.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).