]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Add "map_extra" as a per-map-type extra flag
authorJoanne Koong <joannekoong@fb.com>
Wed, 27 Oct 2021 23:45:01 +0000 (16:45 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 28 Oct 2021 20:22:49 +0000 (13:22 -0700)
commit0a84d8f871d8a524ddf7d6e827a66ed8c6c060b7
treeb203c0c65d00e9b4df291253957f0465c3589f13
parentf60a0d787dde4c8f1ec7da4c935d5de6c0145129
libbpf: Add "map_extra" as a per-map-type extra flag

This patch adds the libbpf infrastructure for supporting a
per-map-type "map_extra" field, whose definition will be
idiosyncratic depending on map type.

For example, for the bloom filter map, the lower 4 bits of
map_extra is used to denote the number of hash functions.

Please note that until libbpf 1.0 is here, the
"bpf_create_map_params" struct is used as a temporary
means for propagating the map_extra field to the kernel.

Signed-off-by: Joanne Koong <joannekoong@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211027234504.30744-3-joannekoong@fb.com
tools/lib/bpf/bpf.c
tools/lib/bpf/bpf_gen_internal.h
tools/lib/bpf/gen_loader.c
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map
tools/lib/bpf/libbpf_internal.h