Merge branch 'libbpf: error reporting changes for v1.0'
Andrii Nakryiko says: ==================== Implement error reporting changes discussed in "Libbpf: the road to v1.0" ([0]) document. Libbpf gets a new API, libbpf_set_strict_mode() which accepts a set of flags that turn on a set of libbpf 1.0 changes, that might be potentially breaking. It's possible to opt-in into all current and future 1.0 features by specifying LIBBPF_STRICT_ALL flag. When some of the 1.0 "features" are requested, libbpf APIs might behave differently. In this patch set a first set of changes are implemented, all related to the way libbpf returns errors. See individual patches for details. Patch #1 adds a no-op libbpf_set_strict_mode() functionality to enable updating selftests. Patch #2 gets rid of all the bad code patterns that will break in libbpf 1.0 (exact -1 comparison for low-level APIs, direct IS_ERR() macro usage to check pointer-returning APIs for error, etc). These changes make selftest work in both legacy and 1.0 libbpf modes. Selftests also opt-in into 100% libbpf 1.0 mode to automatically gain all the subsequent changes, which will come in follow up patches. Patch #3 streamlines error reporting for low-level APIs wrapping bpf() syscall. Patch #4 streamlines errors for all the rest APIs. Patch #5 ensures that BPF skeletons propagate errors properly as well, as currently on error some APIs will return NULL with no way of checking exact error code. [0] https://docs.google.com/document/d/1UyjTZuPFWiPFyKk1tV5an11_iaRuec6U-ZESZ54nNTY v1->v2: - move libbpf_set_strict_mode() implementation to patch #1, where it belongs (Alexei); - add acks, slight rewording of commit messages. ==================== Signed-off-by:Alexei Starovoitov <ast@kernel.org>
No related branches found
No related tags found
Showing
- tools/bpf/bpftool/gen.c 18 additions, 9 deletionstools/bpf/bpftool/gen.c
- tools/lib/bpf/Makefile 1 addition, 0 deletionstools/lib/bpf/Makefile
- tools/lib/bpf/bpf.c 118 additions, 50 deletionstools/lib/bpf/bpf.c
- tools/lib/bpf/bpf_prog_linfo.c 9 additions, 9 deletionstools/lib/bpf/bpf_prog_linfo.c
- tools/lib/bpf/btf.c 152 additions, 150 deletionstools/lib/bpf/btf.c
- tools/lib/bpf/btf_dump.c 7 additions, 7 deletionstools/lib/bpf/btf_dump.c
- tools/lib/bpf/libbpf.c 278 additions, 241 deletionstools/lib/bpf/libbpf.c
- tools/lib/bpf/libbpf.h 1 addition, 0 deletionstools/lib/bpf/libbpf.h
- tools/lib/bpf/libbpf.map 5 additions, 0 deletionstools/lib/bpf/libbpf.map
- tools/lib/bpf/libbpf_errno.c 4 additions, 3 deletionstools/lib/bpf/libbpf_errno.c
- tools/lib/bpf/libbpf_internal.h 53 additions, 0 deletionstools/lib/bpf/libbpf_internal.h
- tools/lib/bpf/libbpf_legacy.h 59 additions, 0 deletionstools/lib/bpf/libbpf_legacy.h
- tools/lib/bpf/linker.c 11 additions, 11 deletionstools/lib/bpf/linker.c
- tools/lib/bpf/netlink.c 47 additions, 34 deletionstools/lib/bpf/netlink.c
- tools/lib/bpf/ringbuf.c 13 additions, 13 deletionstools/lib/bpf/ringbuf.c
- tools/testing/selftests/bpf/bench.c 1 addition, 0 deletionstools/testing/selftests/bpf/bench.c
- tools/testing/selftests/bpf/benchs/bench_rename.c 1 addition, 1 deletiontools/testing/selftests/bpf/benchs/bench_rename.c
- tools/testing/selftests/bpf/benchs/bench_ringbufs.c 3 additions, 3 deletionstools/testing/selftests/bpf/benchs/bench_ringbufs.c
- tools/testing/selftests/bpf/benchs/bench_trigger.c 1 addition, 1 deletiontools/testing/selftests/bpf/benchs/bench_trigger.c
- tools/testing/selftests/bpf/prog_tests/attach_probe.c 4 additions, 8 deletionstools/testing/selftests/bpf/prog_tests/attach_probe.c
Loading
Please register or sign in to comment