]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: test for BPF_F_LOCK
authorAlexei Starovoitov <ast@kernel.org>
Thu, 31 Jan 2019 23:40:12 +0000 (15:40 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 1 Feb 2019 19:55:39 +0000 (20:55 +0100)
commit544b028ffe74c2f5b1be8e042927279fe333ee5a
treed3aad6752b52bfe5dd7bbf1d11c40d0bbdfc44ab
parent4812711e6fe3a142138bd53a25bc87623ad02f6d
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>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/test_map_lock.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_progs.c