diff options
author | Martin KaFai Lau <kafai@fb.com> | 2019-02-09 23:22:28 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-02-10 19:46:17 -0800 |
commit | e0b27b3f97b8fce620331baad563833617c1f303 (patch) | |
tree | acbb0d1786bcccde256ee57a9be1fd731885c1cf /tools/testing/selftests/bpf/bpf_helpers.h | |
parent | fb47d1d931f8419645db15ef5fc0dc7a857c8f4e (diff) | |
download | linux-e0b27b3f97b8fce620331baad563833617c1f303.tar.gz linux-e0b27b3f97b8fce620331baad563833617c1f303.tar.bz2 linux-e0b27b3f97b8fce620331baad563833617c1f303.zip |
bpf: Add test_sock_fields for skb->sk and bpf_tcp_sock
This patch adds a C program to show the usage on
skb->sk and bpf_tcp_sock.
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_helpers.h')
-rw-r--r-- | tools/testing/selftests/bpf/bpf_helpers.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h index 6a0ce0f055c5..d9999f1ed1d2 100644 --- a/tools/testing/selftests/bpf/bpf_helpers.h +++ b/tools/testing/selftests/bpf/bpf_helpers.h @@ -176,6 +176,10 @@ static void (*bpf_spin_lock)(struct bpf_spin_lock *lock) = (void *) BPF_FUNC_spin_lock; static void (*bpf_spin_unlock)(struct bpf_spin_lock *lock) = (void *) BPF_FUNC_spin_unlock; +static struct bpf_sock *(*bpf_sk_fullsock)(struct bpf_sock *sk) = + (void *) BPF_FUNC_sk_fullsock; +static struct bpf_tcp_sock *(*bpf_tcp_sock)(struct bpf_sock *sk) = + (void *) BPF_FUNC_tcp_sock; /* llvm builtin functions that eBPF C program may use to * emit BPF_LD_ABS and BPF_LD_IND instructions |