summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/test_mmap.c
diff options
context:
space:
mode:
authorYauheni Kaliuta <yauheni.kaliuta@redhat.com>2021-04-08 09:13:06 +0300
committerAndrii Nakryiko <andrii@kernel.org>2021-04-08 23:54:48 -0700
commit34090aaf256e469a39401cc04d5cd43275ccd97d (patch)
treef2683791eb274bb31683eba1ce1c7e520375f39b /tools/testing/selftests/bpf/progs/test_mmap.c
parent7a85e4dfa7f5d052ae5016e96f1ee426a8870e78 (diff)
selftests/bpf: mmap: Use runtime page size
Replace hardcoded 4096 with runtime value in the userspace part of the test and set bpf table sizes dynamically according to the value. Do not switch to ASSERT macros, keep CHECK, for consistency with the rest of the test. Can be a separate cleanup patch. 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-5-yauheni.kaliuta@redhat.com
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_mmap.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_mmap.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_mmap.c b/tools/testing/selftests/bpf/progs/test_mmap.c
index 4eb42cff5fe9..5a5cc19a15bf 100644
--- a/tools/testing/selftests/bpf/progs/test_mmap.c
+++ b/tools/testing/selftests/bpf/progs/test_mmap.c
@@ -9,7 +9,6 @@ char _license[] SEC("license") = "GPL";
struct {
__uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 4096);
__uint(map_flags, BPF_F_MMAPABLE | BPF_F_RDONLY_PROG);
__type(key, __u32);
__type(value, char);
@@ -17,7 +16,6 @@ struct {
struct {
__uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 512 * 4); /* at least 4 pages of data */
__uint(map_flags, BPF_F_MMAPABLE);
__type(key, __u32);
__type(value, __u64);