aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_tag.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-11-24 11:32:33 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2021-11-25 23:37:38 +0100
commit2fe256a429cb6c0b0064563af4158470143a363c (patch)
tree59fc62a6e425abbf850165d17b62b5e4d84b6414 /tools/testing/selftests/bpf/test_tag.c
parentlibbpf: Prevent deprecation warnings in xsk.c (diff)
downloadlinux-dev-2fe256a429cb6c0b0064563af4158470143a363c.tar.xz
linux-dev-2fe256a429cb6c0b0064563af4158470143a363c.zip
selftests/bpf: Migrate selftests to bpf_map_create()
Conversion is straightforward for most cases. In few cases tests are using mutable map_flags and attribute structs, but bpf_map_create_opts can be used in the similar fashion, so there were no problems. Just lots of repetitive conversions. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20211124193233.3115996-5-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/test_tag.c')
-rw-r--r--tools/testing/selftests/bpf/test_tag.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/test_tag.c b/tools/testing/selftests/bpf/test_tag.c
index 5c7bea525626..0851c42ee31c 100644
--- a/tools/testing/selftests/bpf/test_tag.c
+++ b/tools/testing/selftests/bpf/test_tag.c
@@ -185,11 +185,12 @@ static void do_test(uint32_t *tests, int start_insns, int fd_map,
int main(void)
{
+ LIBBPF_OPTS(bpf_map_create_opts, opts, .map_flags = BPF_F_NO_PREALLOC);
uint32_t tests = 0;
int i, fd_map;
- fd_map = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(int),
- sizeof(int), 1, BPF_F_NO_PREALLOC);
+ fd_map = bpf_map_create(BPF_MAP_TYPE_HASH, NULL, sizeof(int),
+ sizeof(int), 1, &opts);
assert(fd_map > 0);
for (i = 0; i < 5; i++) {