From: Andrii Nakryiko <andrii@kernel.org>
To: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
martin.lau@kernel.org
Cc: andrii@kernel.org, kernel-team@meta.com
Subject: [PATCH bpf-next 0/3] Fix libbpf's bpf_object and BPF subskel interoperability
Date: Tue, 22 Oct 2024 21:39:05 -0700 [thread overview]
Message-ID: <20241023043908.3834423-1-andrii@kernel.org> (raw)
Fix libbpf's global data map mmap()'ing logic to make BPF objects loaded
through generic bpf_object__load() API interoperable with BPF subskeleton
instantiated from such BPF object. The issue is in re-mmap()'ing of global
data maps after BPF object is loaded into kernel, which is currently done in
BPF skeleton-specific code, and should instead be done in generic and common
bpf_object_load() logic.
See patch #2 for the fix, patch #3 for the selftests. Patch #1 is preliminary
fix for existing spin_lock selftests which currently works by accident.
Andrii Nakryiko (3):
selftests/bpf: fix test_spin_lock_fail.c's global vars usage
libbpf: move global data mmap()'ing into bpf_object__load()
selftests/bpf: validate generic bpf_object and subskel APIs work
together
tools/lib/bpf/libbpf.c | 83 +++++++++----------
.../selftests/bpf/prog_tests/subskeleton.c | 76 ++++++++++++++++-
.../selftests/bpf/progs/test_spin_lock_fail.c | 4 +-
3 files changed, 117 insertions(+), 46 deletions(-)
--
2.43.5
next reply other threads:[~2024-10-23 4:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 4:39 Andrii Nakryiko [this message]
2024-10-23 4:39 ` [PATCH bpf-next 1/3] selftests/bpf: fix test_spin_lock_fail.c's global vars usage Andrii Nakryiko
2024-10-23 4:39 ` [PATCH bpf-next 2/3] libbpf: move global data mmap()'ing into bpf_object__load() Andrii Nakryiko
2024-10-23 12:54 ` Jiri Olsa
2024-10-23 15:59 ` Andrii Nakryiko
2024-10-23 4:39 ` [PATCH bpf-next 3/3] selftests/bpf: validate generic bpf_object and subskel APIs work together Andrii Nakryiko
2024-10-24 5:20 ` [PATCH bpf-next 0/3] Fix libbpf's bpf_object and BPF subskel interoperability 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=20241023043908.3834423-1-andrii@kernel.org \
--to=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
/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