Skip to content

Commit

Permalink
bpf: Add selftests for raw syncookie helpers
Browse files Browse the repository at this point in the history
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.

test_xdp_synproxy.sh is a script that demonstrates the setup of synproxy
with XDP acceleration and serves as a selftest for the new feature.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
  • Loading branch information
nvmmax authored and Nobody committed Feb 24, 2022
1 parent 3837f1a commit 2d7338a
Show file tree
Hide file tree
Showing 5 changed files with 1,243 additions and 2 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/bpf/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ test_cpp
*.tmp
xdpxceiver
xdp_redirect_multi
xdp_synproxy
5 changes: 3 additions & 2 deletions tools/testing/selftests/bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ TEST_PROGS := test_kmod.sh \
test_bpftool.sh \
test_bpftool_metadata.sh \
test_doc_build.sh \
test_xsk.sh
test_xsk.sh \
test_xdp_synproxy.sh

TEST_PROGS_EXTENDED := with_addr.sh \
with_tunnels.sh \
Expand All @@ -82,7 +83,7 @@ TEST_PROGS_EXTENDED := with_addr.sh \
TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
flow_dissector_load test_flow_dissector test_tcp_check_syncookie_user \
test_lirc_mode2_user xdping test_cpp runqslower bench bpf_testmod.ko \
xdpxceiver xdp_redirect_multi
xdpxceiver xdp_redirect_multi xdp_synproxy

TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read

Expand Down
Loading

0 comments on commit 2d7338a

Please sign in to comment.