aboutsummaryrefslogtreecommitdiff
path: root/kernel/bpf/stackmap.c
diff options
context:
space:
mode:
authorStijn Tintel <[email protected]>2022-02-25 17:23:55 +0200
committerDaniel Borkmann <[email protected]>2022-02-28 17:20:52 +0100
commita4fbfdd7a160eccaafc093eb5b34f838b1ca0bf0 (patch)
treeb5e4090496ae35296de1307aa6231a17fa339152 /kernel/bpf/stackmap.c
parent07609c193a0cfd1e3532a7dd81383c9d458f485c (diff)
libbpf: Fix BPF_MAP_TYPE_PERF_EVENT_ARRAY auto-pinning
When a BPF map of type BPF_MAP_TYPE_PERF_EVENT_ARRAY doesn't have the max_entries parameter set, the map will be created with max_entries set to the number of available CPUs. When we try to reuse such a pinned map, map_is_reuse_compat will return false, as max_entries in the map definition differs from max_entries of the existing map, causing the following error: libbpf: couldn't reuse pinned map at '/sys/fs/bpf/m_logging': parameter mismatch Fix this by overwriting max_entries in the map definition. For this to work, we need to do this in bpf_object__create_maps, before calling bpf_object__reuse_map. Fixes: 57a00f41644f ("libbpf: Add auto-pinning of maps when loading BPF objects") Signed-off-by: Stijn Tintel <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'kernel/bpf/stackmap.c')
0 files changed, 0 insertions, 0 deletions