]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add selftests for raw syncookie helpers
authorMaxim Mikityanskiy <maximmi@nvidia.com>
Wed, 15 Jun 2022 13:48:45 +0000 (16:48 +0300)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 17 Jun 2022 04:20:30 +0000 (21:20 -0700)
commitb5eb6fb52e7dc55d7988e16d4c8763a83f57d50a
treed625fba7d134458c1f6aeb459a84ce8ab2584eb9
parentd0217e55faa1e89c98d637d0f5247dfc9832082c
selftests/bpf: Add selftests for raw syncookie helpers

This commit adds selftests for the new BPF helpers:
bpf_tcp_raw_{gen,check}_syncookie_ipv{4,6}.

xdp_synproxy_kern.c is a BPF program that generates SYN cookies on
allowed TCP ports and sends SYNACKs to clients, accelerating synproxy
iptables module.

xdp_synproxy.c is a userspace control application that allows to
configure the following options in runtime: list of allowed ports, MSS,
window scale, TTL.

A selftest is added to prog_tests that leverages the above programs to
test the functionality of the new helpers.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20220615134847.3753567-5-maximmi@nvidia.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/xdp_synproxy.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c [new file with mode: 0644]
tools/testing/selftests/bpf/xdp_synproxy.c [new file with mode: 0644]