]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Pass page size from userspace in map_ptr
authorYauheni Kaliuta <yauheni.kaliuta@redhat.com>
Thu, 8 Apr 2021 06:13:05 +0000 (09:13 +0300)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 9 Apr 2021 06:54:47 +0000 (23:54 -0700)
commite06b790acb19ebc77a41bddb665b26f59551b7f8
tree22cc3b3b4ff4dc5ab95e6e6392e586bf76593c29
parentf517096351111b2256797196dd137d7c067ab4e3
selftests/bpf: Pass page size from userspace in map_ptr

Use ASSERT to check result but keep CHECK where format was used to
report error.

Use bpf_map__set_max_entries() to set map size dynamically from
userspace according to page size.

Zero-initialize the variable in bpf prog, otherwise it will cause
problems on some versions of Clang.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210408061310.95877-4-yauheni.kaliuta@redhat.com
tools/testing/selftests/bpf/prog_tests/map_ptr.c
tools/testing/selftests/bpf/progs/map_ptr_kern.c