diff options
author | Roman Gushchin <guroan@gmail.com> | 2018-12-11 00:43:02 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-12-13 00:33:44 +0100 |
commit | 8f9a8a61931197d32ae31960f4179ff60ccbe3db (patch) | |
tree | 5293f8968ed542f9e6b3089ba6952e754b5d1569 /tools | |
parent | bpf: add bpffs pretty print for cgroup local storage maps (diff) | |
download | linux-8f9a8a61931197d32ae31960f4179ff60ccbe3db.tar.xz linux-8f9a8a61931197d32ae31960f4179ff60ccbe3db.zip |
selftests/bpf: add btf annotations for cgroup_local_storage maps
Add btf annotations to cgroup local storage maps (per-cpu and shared)
in the network packet counting example.
Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/netcnt_prog.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/netcnt_prog.c b/tools/testing/selftests/bpf/netcnt_prog.c index 1198abca1360..9f741e69cebe 100644 --- a/tools/testing/selftests/bpf/netcnt_prog.c +++ b/tools/testing/selftests/bpf/netcnt_prog.c @@ -16,12 +16,18 @@ struct bpf_map_def SEC("maps") percpu_netcnt = { .value_size = sizeof(struct percpu_net_cnt), }; +BPF_ANNOTATE_KV_PAIR(percpu_netcnt, struct bpf_cgroup_storage_key, + struct percpu_net_cnt); + struct bpf_map_def SEC("maps") netcnt = { .type = BPF_MAP_TYPE_CGROUP_STORAGE, .key_size = sizeof(struct bpf_cgroup_storage_key), .value_size = sizeof(struct net_cnt), }; +BPF_ANNOTATE_KV_PAIR(netcnt, struct bpf_cgroup_storage_key, + struct net_cnt); + SEC("cgroup/skb") int bpf_nextcnt(struct __sk_buff *skb) { |