]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix map tests errno checks
authorArtem Savkov <asavkov@redhat.com>
Thu, 21 Apr 2022 09:43:20 +0000 (11:43 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 21 Apr 2022 16:51:57 +0000 (09:51 -0700)
commitc6843cfea3d2b6d81135148af479ab0b7ba49393
treef2305bc20d43093ecce4e36634a82cffa49e48cc
parent5db51f2f2ad9d9b62420dc01cc0eb16e941e59ad
selftests/bpf: Fix map tests errno checks

Switching to libbpf 1.0 API broke test_lpm_map and test_lru_map as error
reporting changed. Instead of setting errno and returning -1 bpf calls
now return -Exxx directly.
Drop errno checks and look at return code directly.

Fixes: 4736ae2a0a39 ("selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK")
Signed-off-by: Artem Savkov <asavkov@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Yafang Shao <laoar.shao@gmail.com>
Link: https://lore.kernel.org/bpf/20220421094320.1563570-1-asavkov@redhat.com
tools/testing/selftests/bpf/test_lpm_map.c
tools/testing/selftests/bpf/test_lru_map.c