All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Quentin Monnet <qmo@kernel.org>,
	Larysa Zaremba <larysa.zaremba@intel.com>,
	Daniel Borkmann <daniel@iogearbox.net>
Cc: "Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Eduard Zingerman" <eddyz87@gmail.com>,
	"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>,
	"Ihor Solodrai" <ihor.solodrai@linux.dev>,
	bpf@vger.kernel.org
Subject: [PATCH bpf-next v2 3/4] bpftool: Set BPF_F_XDP_DEV_BOUND_ONLY flag non-destructively
Date: Mon, 31 Aug 2026 15:26:43 +0200	[thread overview]
Message-ID: <20260831132648.65843-3-toke@redhat.com> (raw)
In-Reply-To: <20260831132648.65843-1-toke@redhat.com>

When setting the XDP hints ifname, bpftool would set the
BPF_F_XDP_DEV_BOUND_ONLY without looking at the existing program flags,
overriding any other flag values. Change this to set the flag value
non-destructively by OR'ing it with the existing flags.

Fixes: f46392ee3dec ("bpftool: Specify XDP Hints ifname when loading program")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
---
 tools/bpf/bpftool/prog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index a9f730d407a9..8c2f9255b36d 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -1769,7 +1769,7 @@ static int load_with_options(int argc, char **argv, bool first_prog_only)
 		}
 
 		if (prog_type == BPF_PROG_TYPE_XDP && xdpmeta_ifindex) {
-			bpf_program__set_flags(pos, BPF_F_XDP_DEV_BOUND_ONLY);
+			bpf_program__set_flags(pos, bpf_program__flags(pos) | BPF_F_XDP_DEV_BOUND_ONLY);
 			bpf_program__set_ifindex(pos, xdpmeta_ifindex);
 		} else {
 			bpf_program__set_ifindex(pos, offload_ifindex);
-- 
2.55.0


  parent reply	other threads:[~2026-08-31 13:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 13:26 [PATCH bpf-next v2 1/4] libbpf: Move section-defined program flags to prog_flags Toke Høiland-Jørgensen
2026-08-31 13:26 ` [PATCH bpf-next v2 2/4] bpf: selftests: Check for flag presence in bpf_program__flags() Toke Høiland-Jørgensen
2026-08-31 13:44   ` sashiko-bot
2026-09-01  8:02     ` Toke Høiland-Jørgensen
2026-08-31 14:18   ` bot+bpf-ci
2026-09-01  8:03     ` Toke Høiland-Jørgensen
2026-08-31 13:26 ` Toke Høiland-Jørgensen [this message]
2026-08-31 13:39   ` [PATCH bpf-next v2 3/4] bpftool: Set BPF_F_XDP_DEV_BOUND_ONLY flag non-destructively Larysa Zaremba
2026-08-31 13:26 ` [PATCH bpf-next v2 4/4] selftests/bpf: Set BPF program flags non-destructively Toke Høiland-Jørgensen
2026-08-31 14:18   ` bot+bpf-ci
2026-09-01  8:11     ` Toke Høiland-Jørgensen
2026-08-31 14:32 ` [PATCH bpf-next v2 1/4] libbpf: Move section-defined program flags to prog_flags bot+bpf-ci
2026-09-01  8:30   ` Toke Høiland-Jørgensen

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=20260831132648.65843-3-toke@redhat.com \
    --to=toke@redhat.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=larysa.zaremba@intel.com \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=qmo@kernel.org \
    --cc=song@kernel.org \
    --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 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.