]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: bpf: Test iterating a sockmap
authorLorenz Bauer <lmb@cloudflare.com>
Wed, 9 Sep 2020 16:27:12 +0000 (17:27 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 10 Sep 2020 19:35:26 +0000 (12:35 -0700)
commit57caa7dac29e127bd7944004d773443480228d71
tree3960be828aa4e194fbc497e85e27d2049009ece2
parentc5e36290880238d28717b5dd73df77255e16296f
selftests: bpf: Test iterating a sockmap

Add a test that exercises a basic sockmap / sockhash iteration. For
now we simply count the number of elements seen. Once sockmap update
from iterators works we can extend this to perform a full copy.

Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200909162712.221874-4-lmb@cloudflare.com
tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
tools/testing/selftests/bpf/progs/bpf_iter.h
tools/testing/selftests/bpf/progs/bpf_iter_sockmap.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/bpf_iter_sockmap.h [new file with mode: 0644]