bpf: add bpf_map_lookup_percpu_elem for percpu map
authorFeng Zhou <zhoufeng.zf@bytedance.com>
Wed, 11 May 2022 09:38:53 +0000 (17:38 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 12 May 2022 01:16:54 +0000 (18:16 -0700)
commit07343110b293456d30393e89b86c4dee1ac051c8
tree61054fae2b7d0c6ea163a0eeaf272501f1ba470f
parent571b8739dd6df6d41bdcc83ed50b481a27af912c
bpf: add bpf_map_lookup_percpu_elem for percpu map

Add new ebpf helpers bpf_map_lookup_percpu_elem.

The implementation method is relatively simple, refer to the implementation
method of map_lookup_elem of percpu map, increase the parameters of cpu, and
obtain it according to the specified cpu.

Signed-off-by: Feng Zhou <zhoufeng.zf@bytedance.com>
Link: https://lore.kernel.org/r/20220511093854.411-2-zhoufeng.zf@bytedance.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/bpf/arraymap.c
kernel/bpf/core.c
kernel/bpf/hashtab.c
kernel/bpf/helpers.c
kernel/bpf/verifier.c
kernel/trace/bpf_trace.c
tools/include/uapi/linux/bpf.h