From: Martin KaFai Lau <martin.lau@linux•dev>
To: Kuniyuki Iwashima <kuniyu@amazon•com>
Cc: andrii@kernel•org, ast@kernel•org, bpf@vger•kernel.org,
daniel@iogearbox•net, davem@davemloft•net, dsahern@kernel•org,
edumazet@google•com, haoluo@google•com, joe@cilium•io,
joe@wand•net.nz, john.fastabend@gmail•com, jolsa@kernel•org,
kafai@fb•com, kpsingh@kernel•org, kuba@kernel•org,
linux-kernel@vger•kernel.org, lmb@isovalent•com,
netdev@vger•kernel.org, pabeni@redhat•com, sdf@google•com,
song@kernel•org, willemdebruijn.kernel@gmail•com, yhs@fb•com
Subject: Re: [PATCH bpf-next 1/2] bpf, net: Support SO_REUSEPORT sockets with bpf_sk_assign
Date: Fri, 26 May 2023 14:08:48 -0700 [thread overview]
Message-ID: <2ccea8e0-e36e-a53a-2d30-9ce1bcdb873f@linux.dev> (raw)
In-Reply-To: <20230526024931.88117-1-kuniyu@amazon.com>
On 5/25/23 7:49 PM, Kuniyuki Iwashima wrote:
>> We may want to use rcu_access_pointer(sk->sk_reuseport_cb) in
>> each lookup_reuseport() instead of adding sk_state check ?
> And if someone has a weird program that creates multiple listeners and
> disable SO_REUSEPORT for a listener that hits first in lhash2, checking
> sk_reuseport_cb might not work ?
I am also not sure what the correct expectation is if the application disable
SO_REUSEPORT in a sk after bind(). This is not something new or specific from
the current patch though.
> I hope no one does such though, checking sk_reuseport
> and sk_state could be better.
My previous comment on checking sk_state is to avoid the unnecessary
inet_ehashfn() for the TCP_ESTABLISHED sk. Checking sk_reuseport_cb could also
work since it should be NULL for established sk. However, not sure if it could
be another cacheline access. The udp one is checking the sk_state also:
"sk->sk_reuseport && sk->sk_state != TCP_ESTABLISHED".
next prev parent reply other threads:[~2023-05-26 21:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-25 8:19 [PATCH bpf-next 1/2] bpf, net: Support SO_REUSEPORT sockets with bpf_sk_assign Lorenz Bauer
2023-05-25 13:24 ` Eric Dumazet
2023-05-25 19:51 ` Daniel Borkmann
2023-05-25 17:41 ` Kuniyuki Iwashima
2023-05-25 20:01 ` Daniel Borkmann
2023-05-25 23:42 ` Martin KaFai Lau
2023-05-26 1:43 ` Kuniyuki Iwashima
2023-05-26 2:49 ` Kuniyuki Iwashima
2023-05-26 21:08 ` Martin KaFai Lau [this message]
2023-05-26 5:56 ` Joe Stringer
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=2ccea8e0-e36e-a53a-2d30-9ce1bcdb873f@linux.dev \
--to=martin.lau@linux$(echo .)dev \
--cc=andrii@kernel$(echo .)org \
--cc=ast@kernel$(echo .)org \
--cc=bpf@vger$(echo .)kernel.org \
--cc=daniel@iogearbox$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=dsahern@kernel$(echo .)org \
--cc=edumazet@google$(echo .)com \
--cc=haoluo@google$(echo .)com \
--cc=joe@cilium$(echo .)io \
--cc=joe@wand$(echo .)net.nz \
--cc=john.fastabend@gmail$(echo .)com \
--cc=jolsa@kernel$(echo .)org \
--cc=kafai@fb$(echo .)com \
--cc=kpsingh@kernel$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=kuniyu@amazon$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=lmb@isovalent$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=sdf@google$(echo .)com \
--cc=song@kernel$(echo .)org \
--cc=willemdebruijn.kernel@gmail$(echo .)com \
--cc=yhs@fb$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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