[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKRkHyg4nZFwiSWPXsVEyVTSouDcfvULbge4BvOGPEPog@mail.gmail.com>
Date: Thu, 31 Jul 2025 06:01:46 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Menglong Dong <menglong8.dong@...il.com>
Cc: ncardwell@...gle.com, kuniyu@...gle.com, davem@...emloft.net,
dsahern@...nel.org, kuba@...nel.org, pabeni@...hat.com, horms@...nel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Martin KaFai Lau <kafai@...com>
Subject: Re: [PATCH net-next] net: ip: lookup the best matched listen socket
On Thu, Jul 31, 2025 at 5:33 AM Menglong Dong <menglong8.dong@...il.com> wrote:
>
> For now, the socket lookup will terminate if the socket is reuse port in
> inet_lhash2_lookup(), which makes the socket is not the best match.
>
> For example, we have socket1 and socket2 both listen on "0.0.0.0:1234",
> but socket1 bind on "eth0". We create socket1 first, and then socket2.
> Then, all connections will goto socket2, which is not expected, as socket1
> has higher priority.
>
> This can cause unexpected behavior if TCP MD5 keys is used, as described
> in Documentation/networking/vrf.rst -> Applications.
>
> Therefor, we lookup the best matched socket first, and then do the reuse
> port logic. This can increase some overhead if there are many reuse port
> socket :/
>
> Signed-off-by: Menglong Dong <dongml2@...natelecom.cn>
I do not think net-next is open yet ?
It seems this would be net material.
Any way you could provide a test ?
Please CC Martin KaFai Lau <kafai@...com>, as this was added in :
commit 61b7c691c7317529375f90f0a81a331990b1ec1b
Author: Martin KaFai Lau <kafai@...com>
Date: Fri Dec 1 12:52:31 2017 -0800
inet: Add a 2nd listener hashtable (port+addr)
Powered by blists - more mailing lists