[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+FuTSf9K5EH8Q3nvUE1=dBO2x1TNGPbapZLONmB3dqruuHA7g@mail.gmail.com>
Date: Tue, 21 Jul 2020 08:33:41 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Kuniyuki Iwashima <kuniyu@...zon.co.jp>
Cc: "David S . Miller" <davem@...emloft.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Craig Gallek <kraig@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Network Development <netdev@...r.kernel.org>,
Kuniyuki Iwashima <kuni1840@...il.com>,
Benjamin Herrenschmidt <benh@...zon.com>,
osa-contribution-log@...zon.com
Subject: Re: [PATCH net 2/2] udp: Improve load balancing for SO_REUSEPORT.
On Tue, Jul 21, 2020 at 2:17 AM Kuniyuki Iwashima <kuniyu@...zon.co.jp> wrote:
>
> Currently, SO_REUSEPORT does not work well if connected sockets are in a
> UDP reuseport group.
>
> Then reuseport_has_conns() returns true and the result of
> reuseport_select_sock() is discarded. Also, unconnected sockets have the
> same score, hence only does the first unconnected socket in udp_hslot
> always receive all packets sent to unconnected sockets.
>
> So, the result of reuseport_select_sock() should be used for load
> balancing.
>
> The noteworthy point is that the unconnected sockets placed after
> connected sockets in sock_reuseport.socks will receive more packets than
> others because of the algorithm in reuseport_select_sock().
>
> index | connected | reciprocal_scale | result
> ---------------------------------------------
> 0 | no | 20% | 40%
> 1 | no | 20% | 20%
> 2 | yes | 20% | 0%
> 3 | no | 20% | 40%
> 4 | yes | 20% | 0%
>
> If most of the sockets are connected, this can be a problem, but it still
> works better than now.
>
> Fixes: acdcecc61285 ("udp: correct reuseport selection with connected sockets")
> CC: Willem de Bruijn <willemb@...gle.com>
> Reviewed-by: Benjamin Herrenschmidt <benh@...zon.com>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.co.jp>
Acked-by: Willem de Bruijn <willemb@...gle.com>
Powered by blists - more mailing lists