diff options
author | Martin KaFai Lau <kafai@fb.com> | 2020-09-24 17:04:46 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-09-25 13:58:02 -0700 |
commit | edc2d66ad1851db6bd89a611b4e46470f1a40ba9 (patch) | |
tree | 1edab3b11e5cf6f9c7973016c7e1bf9f0b813967 /tools/testing/selftests/bpf/bpf_tcp_helpers.h | |
parent | c40a565a04afd0429ecc8a1a2c9aff897796118f (diff) | |
download | linux-edc2d66ad1851db6bd89a611b4e46470f1a40ba9.tar.gz linux-edc2d66ad1851db6bd89a611b4e46470f1a40ba9.tar.bz2 linux-edc2d66ad1851db6bd89a611b4e46470f1a40ba9.zip |
bpf: selftest: Use bpf_skc_to_tcp_sock() in the sock_fields test
This test uses bpf_skc_to_tcp_sock() to get a kernel tcp_sock ptr "ktp".
Access the ktp->lsndtime and also pass ktp to bpf_sk_storage_get().
It also exercises the bpf_sk_cgroup_id() and bpf_sk_ancestor_cgroup_id()
with the "ktp". To do that, a parent cgroup and a child cgroup are
created. The bpf prog is attached to the child cgroup.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200925000446.3858975-1-kafai@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_tcp_helpers.h')
0 files changed, 0 insertions, 0 deletions