From: Eduard Zingerman <eddyz87@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@linux.dev>,
Kernel Team <kernel-team@fb.com>,
Yonghong Song <yonghong.song@linux.dev>
Subject: Re: [PATCH bpf-next v1 2/4] bpf: add bpf_features enum
Date: Tue, 24 Jun 2025 15:07:11 -0700 [thread overview]
Message-ID: <9eb94c7757593de354faec9f0d228023f4428307.camel@gmail.com> (raw)
In-Reply-To: <CAADnVQK=ML6A7OwQ4aQSgiRku83tgkKiNdAnKMYq=iDNe-7dRA@mail.gmail.com>
On Tue, 2025-06-24 at 14:59 -0700, Alexei Starovoitov wrote:
[...]
> > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> > index 8fd65eb74051..01050d1f7389 100644
> > --- a/kernel/bpf/verifier.c
> > +++ b/kernel/bpf/verifier.c
> > @@ -44,6 +44,11 @@ static const struct bpf_verifier_ops * const bpf_verifier_ops[] = {
> > #undef BPF_LINK_TYPE
> > };
> >
> > +enum bpf_features {
> > + BPF_FEAT_RDONLY_CAST_TO_VOID = 0,
> > + BPF_FEAT_TOTAL,
>
> I don't see the value of 'total', but not strongly against it.
> But pls be consistent with __MAX_BPF_CMD, __MAX_BPF_MAP_TYPE, ...
> Say, __MAX_BPF_FEAT ?
>
>
> Also it's better to introduce this enum in some earlier patch,
> and then always add BTF_FEAT_... to this enum
> in the same patch that adds the feature to make
> sure backports won't screw it up.
> Another rule should be to always assign a number to it.
>
> At the end with random backports the __MAX_BPF_FEAT
> won't be accurate, but whatever.
Ack. Andrii asked to add MAX for people willing to do broken kind of
feature detection and just in case.
next prev parent reply other threads:[~2025-06-24 22:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 19:10 [PATCH bpf-next v1 0/4] bpf: allow void* cast using bpf_rdonly_cast() Eduard Zingerman
2025-06-24 19:10 ` [PATCH bpf-next v1 1/4] " Eduard Zingerman
2025-06-24 19:10 ` [PATCH bpf-next v1 2/4] bpf: add bpf_features enum Eduard Zingerman
2025-06-24 21:59 ` Alexei Starovoitov
2025-06-24 22:07 ` Eduard Zingerman [this message]
2025-06-24 19:10 ` [PATCH bpf-next v1 3/4] selftests/bpf: allow tests from verifier.c not to drop CAP_SYS_ADMIN Eduard Zingerman
2025-06-24 21:55 ` Alexei Starovoitov
2025-06-24 22:05 ` Eduard Zingerman
2025-06-24 23:31 ` Eduard Zingerman
2025-06-25 0:04 ` Alexei Starovoitov
2025-06-24 19:10 ` [PATCH bpf-next v1 4/4] selftests/bpf: check operations on untrusted ro pointers to mem Eduard Zingerman
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=9eb94c7757593de354faec9f0d228023f4428307.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=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@linux.dev \
--cc=yonghong.song@linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).