From: Yonghong Song <yhs@fb.com>
To: Lorenz Bauer <lmb@cloudflare.com>, <ast@kernel.org>,
<daniel@iogearbox.net>, <jakub@cloudflare.com>,
<john.fastabend@gmail.com>, <kafai@fb.com>
Cc: <bpf@vger.kernel.org>, <kernel-team@cloudflare.com>
Subject: Re: [PATCH bpf-next v5 2/3] net: Allow iterating sockmap and sockhash
Date: Thu, 10 Sep 2020 10:40:40 -0700 [thread overview]
Message-ID: <edab476c-9a21-f0c9-156c-4f12e40dae32@fb.com> (raw)
In-Reply-To: <20200909162712.221874-3-lmb@cloudflare.com>
On 9/9/20 9:27 AM, Lorenz Bauer wrote:
> Add bpf_iter support for sockmap / sockhash, based on the bpf_sk_storage and
> hashtable implementation. sockmap and sockhash share the same iteration
> context: a pointer to an arbitrary key and a pointer to a socket. Both
> pointers may be NULL, and so BPF has to perform a NULL check before accessing
> them. Technically it's not possible for sockhash iteration to yield a NULL
> socket, but we ignore this to be able to use a single iteration point.
>
> Iteration will visit all keys that remain unmodified during the lifetime of
> the iterator. It may or may not visit newly added ones.
>
> Switch from using rcu_dereference_raw to plain rcu_dereference, so we gain
> another guard rail if CONFIG_PROVE_RCU is enabled.
>
> Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Acked-by: Yonghong Song <yhs@fb.com>
next prev parent reply other threads:[~2020-09-10 17:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 16:27 [PATCH bpf-next v5 0/3] Sockmap iterator Lorenz Bauer
2020-09-09 16:27 ` [PATCH bpf-next v5 1/3] net: sockmap: Remove unnecessary sk_fullsock checks Lorenz Bauer
2020-09-09 16:27 ` [PATCH bpf-next v5 2/3] net: Allow iterating sockmap and sockhash Lorenz Bauer
2020-09-10 17:40 ` Yonghong Song [this message]
2020-09-09 16:27 ` [PATCH bpf-next v5 3/3] selftests: bpf: Test iterating a sockmap Lorenz Bauer
2020-09-10 18:11 ` Yonghong Song
2020-09-10 19:36 ` Alexei Starovoitov
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=edab476c-9a21-f0c9-156c-4f12e40dae32@fb.com \
--to=yhs@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=jakub@cloudflare.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kernel-team@cloudflare.com \
--cc=lmb@cloudflare.com \
/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