Skip to content
Commit f04deb90 authored by Andrey Grafin's avatar Andrey Grafin Committed by Alexei Starovoitov
Browse files

libbpf: Apply map_set_def_max_entries() for inner_maps on creation



This patch allows to auto create BPF_MAP_TYPE_ARRAY_OF_MAPS and
BPF_MAP_TYPE_HASH_OF_MAPS with values of BPF_MAP_TYPE_PERF_EVENT_ARRAY
by bpf_object__load().

Previous behaviour created a zero filled btf_map_def for inner maps and
tried to use it for a map creation but the linux kernel forbids to create
a BPF_MAP_TYPE_PERF_EVENT_ARRAY map with max_entries=0.

Fixes: 646f02ff ("libbpf: Add BTF-defined map-in-map support")
Signed-off-by: default avatarAndrey Grafin <conquistador@yandex-team.ru>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Acked-by: default avatarYonghong Song <yonghong.song@linux.dev>
Acked-by: default avatarHou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/bpf/20240117130619.9403-1-conquistador@yandex-team.ru


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 091f2bf6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment