]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add BPF_TYPE_MAP_ARRAY mmap() tests
authorAndrii Nakryiko <andriin@fb.com>
Sun, 17 Nov 2019 17:28:06 +0000 (09:28 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 18 Nov 2019 10:42:00 +0000 (11:42 +0100)
commit70f7d415fc0a9cb3925ffc3b08eadd9b6b24867d
tree50748951dae082f17a9919dce69ccd78962487bb
parentf5021cf5e6524446c422602186dc88e4c3f22ee8
selftests/bpf: Add BPF_TYPE_MAP_ARRAY mmap() tests

Add selftests validating mmap()-ing BPF array maps: both single-element and
multi-element ones. Check that plain bpf_map_update_elem() and
bpf_map_lookup_elem() work correctly with memory-mapped array. Also convert
CO-RE relocation tests to use memory-mapped views of global data.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20191117172806.2195367-6-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/core_reloc.c
tools/testing/selftests/bpf/prog_tests/mmap.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_mmap.c [new file with mode: 0644]