diff options
| author | Paul Chaignon <paul.chaignon@gmail.com> | 2023-10-02 11:13:49 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-10-16 15:57:22 +0000 |
| commit | 1834ff143d083ae2c374f2a18d887575887321a9 (patch) | |
| tree | f38e1bdb955d329f6ab020929e6f476b72066ab6 /sys/linux | |
| parent | f757a3234f43deecbf7b1af37101b8ac6dd14cd0 (diff) | |
sys/linux: templatize arg for BPF_MAP_CREATE
This templatization of bpf_map_create_arg_base enables a less verbose
way to define map type-specific arguments. It can already be used for
maps of type BPF_MAP_TYPE_BLOOM_FILTER and will be used for maps holding
constant strings in a subsequent commit.
This commit doesn't have any functional changes.
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Diffstat (limited to 'sys/linux')
| -rw-r--r-- | sys/linux/bpf.txt | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/sys/linux/bpf.txt b/sys/linux/bpf.txt index edf636fc2..94b96f609 100644 --- a/sys/linux/bpf.txt +++ b/sys/linux/bpf.txt @@ -85,12 +85,12 @@ bpf_map_create_arg [ bloom_filter bpf_map_create_arg_bf ] -bpf_map_create_arg_base { - type flags[bpf_map_type, int32] - ksize int32 - vsize int32 - max int32 - flags flags[map_flags, int32] +type bpf_map_create_arg_t[TYPE, KSIZE, VSIZE, MAX, FLAGS, MAP_EXTRA] { + type TYPE + ksize KSIZE + vsize VSIZE + max MAX + flags FLAGS inner fd_bpf_map[opt] node int32 map_name array[const[0, int8], BPF_OBJ_NAME_LEN] @@ -99,25 +99,11 @@ bpf_map_create_arg_base { btf_key_type_id btf_opt_type_id btf_value_type_id btf_opt_type_id btf_vmlinux_type_id btf_opt_type_id - map_extra const[0, int64] + map_extra MAP_EXTRA } -bpf_map_create_arg_bf { - type const[BPF_MAP_TYPE_BLOOM_FILTER, int32] - ksize int32 - vsize int32 - max int32 - flags flags[map_flags, int32] - inner fd_bpf_map[opt] - node int32 - map_name array[const[0, int8], BPF_OBJ_NAME_LEN] - map_ifindex ifindex[opt] - btf_fd fd_btf[opt] - btf_key_type_id btf_opt_type_id - btf_value_type_id btf_opt_type_id - btf_vmlinux_type_id btf_opt_type_id - map_extra int64[0:15] -} +type bpf_map_create_arg_base bpf_map_create_arg_t[flags[bpf_map_type, int32], int32, int32, int32, flags[map_flags, int32], const[0, int64]] +type bpf_map_create_arg_bf bpf_map_create_arg_t[const[BPF_MAP_TYPE_BLOOM_FILTER, int32], int32, int32, int32, flags[map_flags, int32], int64[0:15]] bpf_map_get_fd_by_id_arg { map_id bpf_map_id |
