Commit 21703cf
Alexei Starovoitov
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 <[email protected]>File tree
71 files changed
+1123
-952
lines changed- tools
- bpf/bpftool
- lib/bpf
- testing/selftests/bpf
- benchs
- prog_tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
71 files changed
+1123
-952
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
| 716 | + | |
716 | 717 | | |
717 | 718 | | |
718 | 719 | | |
| |||
793 | 794 | | |
794 | 795 | | |
795 | 796 | | |
| 797 | + | |
796 | 798 | | |
797 | 799 | | |
798 | | - | |
| 800 | + | |
| 801 | + | |
799 | 802 | | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
804 | 809 | | |
805 | 810 | | |
806 | | - | |
| 811 | + | |
807 | 812 | | |
| 813 | + | |
808 | 814 | | |
809 | 815 | | |
810 | 816 | | |
| |||
824 | 830 | | |
825 | 831 | | |
826 | 832 | | |
| 833 | + | |
827 | 834 | | |
828 | 835 | | |
829 | 836 | | |
830 | 837 | | |
831 | | - | |
| 838 | + | |
| 839 | + | |
832 | 840 | | |
| 841 | + | |
833 | 842 | | |
834 | 843 | | |
835 | 844 | | |
| |||
860 | 869 | | |
861 | 870 | | |
862 | 871 | | |
863 | | - | |
| 872 | + | |
864 | 873 | | |
865 | 874 | | |
866 | 875 | | |
| |||
949 | 958 | | |
950 | 959 | | |
951 | 960 | | |
952 | | - | |
| 961 | + | |
953 | 962 | | |
954 | 963 | | |
955 | 964 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
| |||
0 commit comments