From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Ihor Solodrai" <ihor.solodrai@linux.dev>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Jiri Olsa" <jolsa@kernel.org>,
"Emil Tsalapatis" <emil@etsalapatis.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>, bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 1/4] libbpf: Add bpf_program__add_flags() and bpf_program__clear_flags()
Date: Fri, 11 Sep 2026 11:07:16 +0800 [thread overview]
Message-ID: <3758e7fd-2a00-4cca-b507-3e634cf24497@linux.dev> (raw)
In-Reply-To: <20260910183222.307208-1-toke@redhat.com>
On 9/11/26 2:32 AM, Toke Høiland-Jørgensen wrote:
> When changing BPF program flags, applications often need to just add or
> remove a single flag, without touching the existing ones. When using the
> bpf_program__set_flags() function, this requires reading the existing
> flags and doing bitwise manipulations before resetting the result, which
> is slightly awkward to do, and easy to forget.
>
> Add two new convenience helpers, bpf_program__add_flags() and
> bpf_program__clear_flags(), which wraps bpf_program__set_flags() in the
> bitwise operations required to modify flags without clobbering the
> existing ones.
>
> Suggested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
> Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
next prev parent reply other threads:[~2026-09-11 3:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 18:32 [PATCH bpf-next v2 1/4] libbpf: Add bpf_program__add_flags() and bpf_program__clear_flags() Toke Høiland-Jørgensen
2026-09-10 18:32 ` [PATCH bpf-next v2 2/4] selftests/bpf: Add assertions for bpf_program__{add,clear}_flags() Toke Høiland-Jørgensen
2026-09-10 18:42 ` sashiko-bot
2026-09-10 18:32 ` [PATCH bpf-next v2 3/4] selftests/bpf: Adopt bpf_program__add_flags() helper Toke Høiland-Jørgensen
2026-09-10 18:45 ` sashiko-bot
2026-09-11 3:18 ` Jiayuan Chen
2026-09-11 9:53 ` Toke Høiland-Jørgensen
2026-09-11 19:27 ` Andrii Nakryiko
2026-09-12 8:24 ` Toke Høiland-Jørgensen
2026-09-10 18:32 ` [PATCH bpf-next v2 4/4] bpftool: " Toke Høiland-Jørgensen
2026-09-10 18:40 ` [PATCH bpf-next v2 1/4] libbpf: Add bpf_program__add_flags() and bpf_program__clear_flags() sashiko-bot
2026-09-10 22:43 ` Eduard Zingerman
2026-09-11 3:07 ` Jiayuan Chen [this message]
2026-09-11 19:27 ` Andrii Nakryiko
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=3758e7fd-2a00-4cca-b507-3e634cf24497@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=song@kernel.org \
--cc=toke@redhat.com \
--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