bpf: Add tests for bpf_sk_storage to bpf_tcp_ca
authorMartin KaFai Lau <kafai@fb.com>
Fri, 20 Mar 2020 15:21:07 +0000 (08:21 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 23 Mar 2020 19:51:55 +0000 (20:51 +0100)
commitc9b24312040edaa89acb6fb91a9a53fb4775309e
tree24b2e33e4c91a8e5ca60ad7464adaafcad108e37
parentab14fd4ee82ead4b058034509971b8bd749862ff
bpf: Add tests for bpf_sk_storage to bpf_tcp_ca

This patch adds test to exercise the bpf_sk_storage_get()
and bpf_sk_storage_delete() helper from the bpf_dctcp.c.

The setup and check on the sk_storage is done immediately
before and after the connect().

This patch also takes this chance to move the pthread_create()
after the connect() has been done.  That will remove the need of
the "wait_thread" label.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200320152107.2169904-1-kafai@fb.com
tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
tools/testing/selftests/bpf/progs/bpf_dctcp.c