bpf: inline bpf_map_lookup_elem() helper for PERCPU_HASH map
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 2 Apr 2024 02:13:05 +0000 (19:13 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 3 Apr 2024 17:29:56 +0000 (10:29 -0700)
commit0b56e637f705836b9aa51e2b1058c3c814c121a8
treed854878120567fc94dbc26d31c8238caffe88c2a
parentdb69718b8efac802c7cc20d5a6c7dfc913f99c43
bpf: inline bpf_map_lookup_elem() helper for PERCPU_HASH map

Using new per-CPU BPF instruction, partially inline
bpf_map_lookup_elem() helper for per-CPU hashmap BPF map. Just like for
normal HASH map, we still generate a call into __htab_map_lookup_elem(),
but after that we resolve per-CPU element address using a new
instruction, saving on extra functions calls.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/r/20240402021307.1012571-5-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/hashtab.c