Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bpf: Add batched ops support for percpu array

Uses the already in-place infrastructure provided by the
'generic_map_*_batch' functions.

No tweak was needed as it transparently handles the percpu variant.

As arrays don't have delete operations, let it return a error to
user space (default behaviour).

Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210424214510.806627-2-pctammela@mojatatu.com

authored by

Pedro Tammela and committed by
Daniel Borkmann
f008d732 05eb3791

+2
+2
kernel/bpf/arraymap.c
··· 698 698 .map_delete_elem = array_map_delete_elem, 699 699 .map_seq_show_elem = percpu_array_map_seq_show_elem, 700 700 .map_check_btf = array_map_check_btf, 701 + .map_lookup_batch = generic_map_lookup_batch, 702 + .map_update_batch = generic_map_update_batch, 701 703 .map_set_for_each_callback_args = map_set_for_each_callback_args, 702 704 .map_for_each_callback = bpf_for_each_array_elem, 703 705 .map_btf_name = "bpf_array",