diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2021-11-24 11:32:30 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2021-11-25 23:35:46 +0100 |
commit | 992c4225419a38663d6239bc2f525b4ac0429188 (patch) | |
tree | 79400371e8ce6ff3de4e70f99d55c88f7ef2f19a /tools/lib/bpf/bpf_gen_internal.h | |
parent | e4f7ac90c2b09766e4acf771908987391c836413 (diff) | |
download | linux-992c4225419a38663d6239bc2f525b4ac0429188.tar.bz2 |
libbpf: Unify low-level map creation APIs w/ new bpf_map_create()
Mark the entire zoo of low-level map creation APIs for deprecation in
libbpf 0.7 ([0]) and introduce a new bpf_map_create() API that is
OPTS-based (and thus future-proof) and matches the BPF_MAP_CREATE
command name.
While at it, ensure that gen_loader sends map_extra field. Also remove
now unneeded btf_key_type_id/btf_value_type_id logic that libbpf is
doing anyways.
[0] Closes: https://github.com/libbpf/libbpf/issues/282
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211124193233.3115996-2-andrii@kernel.org
Diffstat (limited to 'tools/lib/bpf/bpf_gen_internal.h')
-rw-r--r-- | tools/lib/bpf/bpf_gen_internal.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/lib/bpf/bpf_gen_internal.h b/tools/lib/bpf/bpf_gen_internal.h index 75ca9fb857b2..ae7704deba30 100644 --- a/tools/lib/bpf/bpf_gen_internal.h +++ b/tools/lib/bpf/bpf_gen_internal.h @@ -51,7 +51,10 @@ void bpf_gen__init(struct bpf_gen *gen, int log_level); int bpf_gen__finish(struct bpf_gen *gen); void bpf_gen__free(struct bpf_gen *gen); void bpf_gen__load_btf(struct bpf_gen *gen, const void *raw_data, __u32 raw_size); -void bpf_gen__map_create(struct bpf_gen *gen, struct bpf_create_map_params *map_attr, int map_idx); +void bpf_gen__map_create(struct bpf_gen *gen, + enum bpf_map_type map_type, const char *map_name, + __u32 key_size, __u32 value_size, __u32 max_entries, + struct bpf_map_create_opts *map_attr, int map_idx); void bpf_gen__prog_load(struct bpf_gen *gen, enum bpf_prog_type prog_type, const char *prog_name, const char *license, struct bpf_insn *insns, size_t insn_cnt, |