selftests/bpf: test for BPF_F_LOCK
Add C based test that runs 4 bpf programs in parallel that update the same hash and array maps. And another 2 threads that read from these two maps via lookup(key, value, BPF_F_LOCK) api to make sure the user space sees consistent value in both hash and array elements while user space races with kernel bpf progs. Signed-off-by:Alexei Starovoitov <ast@kernel.org> Signed-off-by:
Daniel Borkmann <daniel@iogearbox.net>
Showing
- tools/testing/selftests/bpf/Makefile 1 addition, 1 deletiontools/testing/selftests/bpf/Makefile
- tools/testing/selftests/bpf/test_map_lock.c 66 additions, 0 deletionstools/testing/selftests/bpf/test_map_lock.c
- tools/testing/selftests/bpf/test_progs.c 74 additions, 0 deletionstools/testing/selftests/bpf/test_progs.c
Loading
Please register or sign in to comment