]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add a selftest for the tracing bpf_get_socket_cookie
authorFlorent Revest <revest@chromium.org>
Wed, 10 Feb 2021 11:14:06 +0000 (12:14 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 12 Feb 2021 01:44:41 +0000 (17:44 -0800)
commitefa9fb94883bce35328f64a6617e13ff67ee4d9c
tree904356219a31ab6feeed959b03fd47be8d28349f
parent1a7efc7728b91453326257e0c567f3016a0fdc57
selftests/bpf: Add a selftest for the tracing bpf_get_socket_cookie

This builds up on the existing socket cookie test which checks whether
the bpf_get_socket_cookie helpers provide the same value in
cgroup/connect6 and sockops programs for a socket created by the
userspace part of the test.

Instead of having an update_cookie sockops program tag a socket local
storage with 0xFF, this uses both an update_cookie_sockops program and
an update_cookie_tracing program which succesively tag the socket with
0x0F and then 0xF0.

Signed-off-by: Florent Revest <revest@chromium.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: KP Singh <kpsingh@kernel.org>
Link: https://lore.kernel.org/bpf/20210210111406.785541-5-revest@chromium.org
tools/testing/selftests/bpf/prog_tests/socket_cookie.c
tools/testing/selftests/bpf/progs/socket_cookie_prog.c