aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_skb_cgroup_id_kern.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2022-01-19 22:05:27 -0800
committerAlexei Starovoitov <ast@kernel.org>2022-01-20 21:19:05 -0800
commitccc3f56918f670ccb5b8df2c6a15cbd083a4dd03 (patch)
treeef41b0e3950e32a62974dc7aa77c68283be3d4c2 /tools/testing/selftests/bpf/progs/test_skb_cgroup_id_kern.c
parentselftests/bpf: fail build on compilation warning (diff)
downloadlinux-ccc3f56918f670ccb5b8df2c6a15cbd083a4dd03.tar.xz
linux-ccc3f56918f670ccb5b8df2c6a15cbd083a4dd03.zip
selftests/bpf: convert remaining legacy map definitions
Converted few remaining legacy BPF map definition to BTF-defined ones. For the remaining two bpf_map_def-based legacy definitions that we want to keep for testing purposes until libbpf 1.0 release, guard them in pragma to suppres deprecation warnings which will be added in libbpf in the next commit. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20220120060529.1890907-3-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_skb_cgroup_id_kern.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_skb_cgroup_id_kern.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_skb_cgroup_id_kern.c b/tools/testing/selftests/bpf/progs/test_skb_cgroup_id_kern.c
index c304cd5b8cad..37aacc66cd68 100644
--- a/tools/testing/selftests/bpf/progs/test_skb_cgroup_id_kern.c
+++ b/tools/testing/selftests/bpf/progs/test_skb_cgroup_id_kern.c
@@ -10,12 +10,12 @@
#define NUM_CGROUP_LEVELS 4
-struct bpf_map_def SEC("maps") cgroup_ids = {
- .type = BPF_MAP_TYPE_ARRAY,
- .key_size = sizeof(__u32),
- .value_size = sizeof(__u64),
- .max_entries = NUM_CGROUP_LEVELS,
-};
+struct {
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __type(key, __u32);
+ __type(value, __u64);
+ __uint(max_entries, NUM_CGROUP_LEVELS);
+} cgroup_ids SEC(".maps");
static __always_inline void log_nth_level(struct __sk_buff *skb, __u32 level)
{