summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/bpf_helpers.h
diff options
context:
space:
mode:
authorMartin KaFai Lau2019-04-27 01:39:54 +0200
committerAlexei Starovoitov2019-04-27 18:07:05 +0200
commit263d0b35334112dd999afb4246646a2ea9da800d (patch)
treee709bccec939c79f8e25d7902a5a89f26b24caae /tools/testing/selftests/bpf/bpf_helpers.h
parentbpf: Add BPF_MAP_TYPE_SK_STORAGE test to test_maps (diff)
downloadkernel-qcow2-linux-263d0b35334112dd999afb4246646a2ea9da800d.tar.gz
kernel-qcow2-linux-263d0b35334112dd999afb4246646a2ea9da800d.tar.xz
kernel-qcow2-linux-263d0b35334112dd999afb4246646a2ea9da800d.zip
bpf: Add ene-to-end test for bpf_sk_storage_* helpers
This patch rides on an existing BPF_PROG_TYPE_CGROUP_SKB test (test_sock_fields.c) to do a TCP end-to-end test on the new bpf_sk_storage_* helpers. 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.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index 59e221586cf7..6e80b66d7fb1 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -211,6 +211,11 @@ static int (*bpf_strtol)(const char *buf, unsigned long long buf_len,
static int (*bpf_strtoul)(const char *buf, unsigned long long buf_len,
unsigned long long flags, unsigned long *res) =
(void *) BPF_FUNC_strtoul;
+static void *(*bpf_sk_storage_get)(void *map, struct bpf_sock *sk,
+ void *value, __u64 flags) =
+ (void *) BPF_FUNC_sk_storage_get;
+static int (*bpf_sk_storage_delete)(void *map, struct bpf_sock *sk) =
+ (void *)BPF_FUNC_sk_storage_delete;
/* llvm builtin functions that eBPF C program may use to
* emit BPF_LD_ABS and BPF_LD_IND instructions