Provide bpf_for() and bpf_for_each() by libbpf
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 All 6 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | libbpf: misc internal libbpf clean ups around log fixuptools/ | +14 | 0 replies | Applied |
| 2/6 | libbpf: report vmlinux vs module name when dealing with ksymstools/ | +5 | 0 replies | Applied |
| 3/6 | libbpf: improve handling of unresolved kfuncstools/ | +69 | 4 replies | Applied |
| 4/6 | selftests/bpf: add missing __weak kfunc log fixup testtools/ tools/ | +41 | 0 replies | Applied |
| 5/6 | libbpf: move bpf_for(), bpf_for_each(), and bpf_repeat() into bpf_helpers.htools/ tools/ | +103 | 0 replies | Applied |
| 6/6 | libbpf: mark bpf_iter_num_{new,next,destroy} as __weaktools/ | +3 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH bpf-next 0/6] Provide bpf_for() and bpf_for_each() by libbpf
This patch set moves bpf_for(), bpf_for_each(), and bpf_repeat() macros from selftests-internal bpf_misc.h header to libbpf-provided bpf_helpers.h header. To do this in a way to allow users to feature-detect and guard such bpf_for()/bpf_for_each() uses on old kernels we also extend libbpf to improve unresolved kfunc calls handling and reporting. This lets us mark bpf_iter_num_{new,next,destroy}() declarations as __weak, and thus not fail program loading outright if such kfuncs are missing on the host kernel.
Patches #1 and #2 do some simple clean ups and logging improvements. Patch #3 adds kfunc call poisoning and log fixup logic and is the hear of this patch set, effectively. Patch #4 adds selftest for this logic. Patches #4 and #5 move bpf_for()/bpf_for_each()/bpf_repeat() into bpf_helpers.h header and mark kfuncs as __weak to allow users to feature-detect and guard their uses.
Andrii Nakryiko (6):
libbpf: misc internal libbpf clean ups around log fixup
libbpf: report vmlinux vs module name when dealing with ksyms
libbpf: improve handling of unresolved kfuncs selftests/bpf: add missing __weak kfunc log fixup test
libbpf: move bpf_for(), bpf_for_each(), and bpf_repeat() into
bpf_helpers.h
libbpf: mark bpf_iter_num_{new,next,destroy} as __weak
tools/lib/bpf/bpf_helpers.h | 103 +++++++++++++++++ tools/lib/bpf/libbpf.c | 107 ++++++++++++++---- .../selftests/bpf/prog_tests/log_fixup.c | 31 +++++ tools/testing/selftests/bpf/progs/bpf_misc.h | 103 ----------------- .../selftests/bpf/progs/test_log_fixup.c | 10 ++ 5 files changed, 232 insertions(+), 122 deletions(-)
Signature · 1 line
2.34.1