bpf: selftest: Add test_btf_skc_cls_ingress
authorMartin KaFai Lau <kafai@fb.com>
Fri, 25 Sep 2020 00:04:58 +0000 (17:04 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 25 Sep 2020 20:58:02 +0000 (13:58 -0700)
commit9a856cae2217ca1bc0726417d32f3f1daf035389
treeb37f9459a76aaaca81d41c0ce6ecd4bf9597a980
parent0c402c6c3031fd6ba23c6a2433b9f804da093b20
bpf: selftest: Add test_btf_skc_cls_ingress

This patch attaches a classifier prog to the ingress filter.
It exercises the following helpers with different socket pointer
types in different logical branches:
1. bpf_sk_release()
2. bpf_sk_assign()
3. bpf_skc_to_tcp_request_sock(), bpf_skc_to_tcp_sock()
4. bpf_tcp_gen_syncookie, bpf_tcp_check_syncookie

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200925000458.3859627-1-kafai@fb.com
tools/testing/selftests/bpf/bpf_tcp_helpers.h
tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_btf_skc_cls_ingress.c [new file with mode: 0644]