diff options
author | Andrey Ignatov <rdna@fb.com> | 2018-08-12 13:49:29 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-08-12 19:02:39 -0400 |
commit | 02f6ac7456a0d77360cb47b8d2ed4366b883096d (patch) | |
tree | e33af1b56e5261b94c764ca1e7b5d74ce2bcd21c /tools | |
parent | 539764d07b49c5b322cc065d275f65df275e4991 (diff) |
selftests/bpf: Add cgroup id helpers to bpf_helpers.h
Add bpf_skb_cgroup_id and bpf_skb_ancestor_cgroup_id helpers to
bpf_helpers.h to use them in tests and samples.
Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools')
-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 5c32266c2c38..e4be7730222d 100644 --- a/tools/testing/selftests/bpf/bpf_helpers.h +++ b/tools/testing/selftests/bpf/bpf_helpers.h | |||
@@ -139,6 +139,10 @@ static unsigned long long (*bpf_get_current_cgroup_id)(void) = | |||
139 | (void *) BPF_FUNC_get_current_cgroup_id; | 139 | (void *) BPF_FUNC_get_current_cgroup_id; |
140 | static void *(*bpf_get_local_storage)(void *map, unsigned long long flags) = | 140 | static void *(*bpf_get_local_storage)(void *map, unsigned long long flags) = |
141 | (void *) BPF_FUNC_get_local_storage; | 141 | (void *) BPF_FUNC_get_local_storage; |
142 | static unsigned long long (*bpf_skb_cgroup_id)(void *ctx) = | ||
143 | (void *) BPF_FUNC_skb_cgroup_id; | ||
144 | static unsigned long long (*bpf_skb_ancestor_cgroup_id)(void *ctx, int level) = | ||
145 | (void *) BPF_FUNC_skb_ancestor_cgroup_id; | ||
142 | 146 | ||
143 | /* llvm builtin functions that eBPF C program may use to | 147 | /* llvm builtin functions that eBPF C program may use to |
144 | * emit BPF_LD_ABS and BPF_LD_IND instructions | 148 | * emit BPF_LD_ABS and BPF_LD_IND instructions |