diff options
Diffstat (limited to 'tools/testing/selftests/bpf/progs/netcnt_prog.c')
-rw-r--r-- | tools/testing/selftests/bpf/progs/netcnt_prog.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tools/testing/selftests/bpf/progs/netcnt_prog.c b/tools/testing/selftests/bpf/progs/netcnt_prog.c index a25c82a5b7c8..38a997852cad 100644 --- a/tools/testing/selftests/bpf/progs/netcnt_prog.c +++ b/tools/testing/selftests/bpf/progs/netcnt_prog.c @@ -11,20 +11,16 @@ #define NS_PER_SEC 1000000000 struct { - __u32 type; - struct bpf_cgroup_storage_key *key; - struct percpu_net_cnt *value; -} percpu_netcnt SEC(".maps") = { - .type = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, -}; + __uint(type, BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE); + __type(key, struct bpf_cgroup_storage_key); + __type(value, struct percpu_net_cnt); +} percpu_netcnt SEC(".maps"); struct { - __u32 type; - struct bpf_cgroup_storage_key *key; - struct net_cnt *value; -} netcnt SEC(".maps") = { - .type = BPF_MAP_TYPE_CGROUP_STORAGE, -}; + __uint(type, BPF_MAP_TYPE_CGROUP_STORAGE); + __type(key, struct bpf_cgroup_storage_key); + __type(value, struct net_cnt); +} netcnt SEC(".maps"); SEC("cgroup/skb") int bpf_nextcnt(struct __sk_buff *skb) |