Christy Lee
8d6fabf165
selftests/bpf: Stop using bpf_map__def() API
...
libbpf bpf_map__def() API is being deprecated, replace selftests/bpf's
usage with the appropriate getters and setters.
Signed-off-by: Christy Lee <[email protected] >
Signed-off-by: Andrii Nakryiko <[email protected] >
Link: https://lore.kernel.org/bpf/[email protected]
2022-01-12 17:01:38 -08:00
Andrii Nakryiko
4f2511e199
selftests/bpf: Switch to ".bss"/".rodata"/".data" lookups for internal maps
...
Utilize libbpf's feature of allowing to lookup internal maps by their
ELF section names. No need to guess or calculate the exact truncated
prefix taken from the object name.
Signed-off-by: Andrii Nakryiko <[email protected] >
Signed-off-by: Alexei Starovoitov <[email protected] >
Acked-by: Song Liu <[email protected] >
Link: https://lore.kernel.org/bpf/[email protected]
2021-10-21 17:10:11 -07:00
Hao Luo
95cec14b03
selftests/bpf: Fix check in global_data_init.
...
The returned value of bpf_object__open_file() should be checked with
libbpf_get_error() rather than NULL. This fix prevents test_progs from
crash when test_global_data.o is not present.
Signed-off-by: Hao Luo <[email protected] >
Signed-off-by: Alexei Starovoitov <[email protected] >
Acked-by: Andrii Nakryiko <[email protected] >
Link: https://lore.kernel.org/bpf/[email protected]
2020-09-03 17:33:31 -07:00
Toke Høiland-Jørgensen
e5fb60ee4c
selftests: Add test for overriding global data value before load
...
This adds a test to exercise the new bpf_map__set_initial_value() function.
The test simply overrides the global data section with all zeroes, and
checks that the new value makes it into the kernel map on load.
Signed-off-by: Toke Høiland-Jørgensen <[email protected] >
Signed-off-by: Daniel Borkmann <[email protected] >
Acked-by: Andrii Nakryiko <[email protected] >
Link: https://lore.kernel.org/bpf/[email protected]
2020-03-30 01:17:35 +02:00