mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
selftests/bpf: convert selftests using BTF-defined maps to new syntax
Convert all the existing selftests that are already using BTF-defined maps to use new syntax (with no static data initialization). Signed-off-by: Andrii Nakryiko <andriin@fb.com> Acked-by: Song Liu <songliubraving@fb.com> Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
00acd00814
commit
bc7430cc8b
20 changed files with 300 additions and 494 deletions
|
@ -13,14 +13,11 @@ struct socket_cookie {
|
|||
};
|
||||
|
||||
struct {
|
||||
__u32 type;
|
||||
__u32 map_flags;
|
||||
int *key;
|
||||
struct socket_cookie *value;
|
||||
} socket_cookies SEC(".maps") = {
|
||||
.type = BPF_MAP_TYPE_SK_STORAGE,
|
||||
.map_flags = BPF_F_NO_PREALLOC,
|
||||
};
|
||||
__uint(type, BPF_MAP_TYPE_SK_STORAGE);
|
||||
__uint(map_flags, BPF_F_NO_PREALLOC);
|
||||
__type(key, int);
|
||||
__type(value, struct socket_cookie);
|
||||
} socket_cookies SEC(".maps");
|
||||
|
||||
SEC("cgroup/connect6")
|
||||
int set_cookie(struct bpf_sock_addr *ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue