bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/4] libbpf: allow to opt-out from BPF map creation
@ 2022-04-28  4:15 Andrii Nakryiko
  2022-04-28  4:15 ` [PATCH bpf-next 1/4] libbpf: append "..." in fixed up log if CO-RE spec is truncated Andrii Nakryiko
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Andrii Nakryiko @ 2022-04-28  4:15 UTC (permalink / raw)
  To: bpf, ast, daniel; +Cc: andrii, kernel-team

Add bpf_map__set_autocreate() API which is a BPF map counterpart of
bpf_program__set_autoload() and serves similar goal of allowing to build more
flexible CO-RE applications. See patch #3 for example scenarios in which the
need for such API came up previously.

Patch #1 is a follow-up patch to previous patch set adding verifier log fixup
logic, making sure bpf_core_format_spec()'s return result is used for
something useful.

Patch #2 is a small refactoring to avoid unnecessary verbose memory management
around obj->maps array.

Patch #3 adds and API and corresponding BPF verifier log fix up logic to
provide human-comprehensible error message with useful details.

Patch #4 adds a simple selftest validating both the API itself and libbpf's
log fixup logic for it.

Andrii Nakryiko (4):
  libbpf: append "..." in fixed up log if CO-RE spec is truncated
  libbpf: use libbpf_mem_ensure() when allocating new map
  libbpf: allow to opt-out from creating BPF maps
  selftests/bpf: test bpf_map__set_autocreate() and related log fixup
    logic

 tools/lib/bpf/libbpf.c                        | 169 +++++++++++++-----
 tools/lib/bpf/libbpf.h                        |  22 +++
 tools/lib/bpf/libbpf.map                      |   4 +-
 .../selftests/bpf/prog_tests/log_fixup.c      |  37 +++-
 .../selftests/bpf/progs/test_log_fixup.c      |  26 +++
 5 files changed, 209 insertions(+), 49 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-29  3:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28  4:15 [PATCH bpf-next 0/4] libbpf: allow to opt-out from BPF map creation Andrii Nakryiko
2022-04-28  4:15 ` [PATCH bpf-next 1/4] libbpf: append "..." in fixed up log if CO-RE spec is truncated Andrii Nakryiko
2022-04-28  4:15 ` [PATCH bpf-next 2/4] libbpf: use libbpf_mem_ensure() when allocating new map Andrii Nakryiko
2022-04-28  4:15 ` [PATCH bpf-next 3/4] libbpf: allow to opt-out from creating BPF maps Andrii Nakryiko
2022-04-28  4:15 ` [PATCH bpf-next 4/4] selftests/bpf: test bpf_map__set_autocreate() and related log fixup logic Andrii Nakryiko
2022-04-29  3:20 ` [PATCH bpf-next 0/4] libbpf: allow to opt-out from BPF map creation patchwork-bot+netdevbpf

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).