All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Yonghong Song <yhs@meta.com>
Cc: Yonghong Song <yhs@fb.com>, bpf <bpf@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Kernel Team <kernel-team@fb.com>,
	Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH bpf-next v10 3/4] bpf: Add kfunc bpf_rcu_read_lock/unlock()
Date: Fri, 25 Nov 2022 09:53:46 -0800	[thread overview]
Message-ID: <CAADnVQ+H3fm7ffLnJnG5DpKVaHDjPg2vEjRN0bPJOxqgMpKAFg@mail.gmail.com> (raw)
In-Reply-To: <540e410d-0a31-ac74-d258-a636530fd77b@meta.com>

On Thu, Nov 24, 2022 at 3:44 PM Yonghong Song <yhs@meta.com> wrote:
>
>
>
> On 11/24/22 12:34 PM, Alexei Starovoitov wrote:
> > On Wed, Nov 23, 2022 at 9:32 PM Yonghong Song <yhs@fb.com> wrote:
> >>
> >> @@ -16580,6 +16682,8 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, bpfptr_t uattr)
> >>          env->bypass_spec_v1 = bpf_bypass_spec_v1();
> >>          env->bypass_spec_v4 = bpf_bypass_spec_v4();
> >>          env->bpf_capable = bpf_capable();
> >> +       env->rcu_tag_supported =
> >> +               btf_find_by_name_kind(btf_vmlinux, "rcu", BTF_KIND_TYPE_TAG) > 0;
> >
> > It needs btf_vmlinux != NULL check as well,
> > since we error earlier only on IS_ERR(btf_vmlinux).
> > btf_vmlinux can be NULL at this point when CONFIG_DEBUG_INFO_BTF is not set.
>
> I checked the code and it looks like btf_find_by_name_kind can handle
> btf_vmlinux = NULL properly. Consider this is a unlikely case so
> I did not add btf_vmlinux checking here.

Good point. You're right.
I got confused by the similar !btf check in bpf_find_btf_id().
There it looks to be necessary. Here it's indeed redundant.
Sorry about that.

  reply	other threads:[~2022-11-25 17:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24  5:32 [PATCH bpf-next v10 0/4] bpf: Add bpf_rcu_read_lock() support Yonghong Song
2022-11-24  5:32 ` [PATCH bpf-next v10 1/4] compiler_types: Define __rcu as __attribute__((btf_type_tag("rcu"))) Yonghong Song
2022-11-24  5:32 ` [PATCH bpf-next v10 2/4] bpf: Introduce might_sleep field in bpf_func_proto Yonghong Song
2022-11-24  5:32 ` [PATCH bpf-next v10 3/4] bpf: Add kfunc bpf_rcu_read_lock/unlock() Yonghong Song
2022-11-24 20:34   ` Alexei Starovoitov
2022-11-24 20:56     ` Alexei Starovoitov
2022-11-24 23:44     ` Yonghong Song
2022-11-25 17:53       ` Alexei Starovoitov [this message]
2022-11-24  5:32 ` [PATCH bpf-next v10 4/4] selftests/bpf: Add tests for bpf_rcu_read_lock() Yonghong Song
2022-11-24 21:10 ` [PATCH bpf-next v10 0/4] bpf: Add bpf_rcu_read_lock() support patchwork-bot+netdevbpf

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=CAADnVQ+H3fm7ffLnJnG5DpKVaHDjPg2vEjRN0bPJOxqgMpKAFg@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@kernel.org \
    --cc=yhs@fb.com \
    --cc=yhs@meta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.