]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: Add BPF_F_CPU and BPF_F_ALL_CPUS flags support for percpu_hash and lru_percpu_ha...
authorLeon Hwang <leon.hwang@linux.dev>
Wed, 7 Jan 2026 02:20:18 +0000 (10:20 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 7 Jan 2026 04:48:32 +0000 (20:48 -0800)
commitc6936161fd55d0c6ffde01da726e66ff5f2934e8
tree38981fa76a03931b2170ffd4fe8c4ad238aadf92
parent8eb76cb03f0f6c2bd7b15cf45dcffcd6bd07a360
bpf: Add BPF_F_CPU and BPF_F_ALL_CPUS flags support for percpu_hash and lru_percpu_hash maps

Introduce BPF_F_ALL_CPUS flag support for percpu_hash and lru_percpu_hash
maps to allow updating values for all CPUs with a single value for both
update_elem and update_batch APIs.

Introduce BPF_F_CPU flag support for percpu_hash and lru_percpu_hash
maps to allow:

* update value for specified CPU for both update_elem and update_batch
APIs.
* lookup value for specified CPU for both lookup_elem and lookup_batch
APIs.

The BPF_F_CPU flag is passed via:

* map_flags along with embedded cpu info.
* elem_flags along with embedded cpu info.

Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Link: https://lore.kernel.org/r/20260107022022.12843-4-leon.hwang@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
kernel/bpf/hashtab.c
kernel/bpf/syscall.c