diff options
author | Pedro Tammela <pctammela@gmail.com> | 2021-04-25 00:45:09 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2021-04-28 02:17:45 +0300 |
commit | f008d732ab181fd00d95c2e8a6e479d2f7c634b3 (patch) | |
tree | 45a933740031956a804209be3b462e3694f75e7e /kernel/bpf | |
parent | 05eb3791a0deb79027c7f392342531cb1c884ede (diff) | |
download | linux-f008d732ab181fd00d95c2e8a6e479d2f7c634b3.tar.xz |
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
Diffstat (limited to 'kernel/bpf')
-rw-r--r-- | kernel/bpf/arraymap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 463d25e1e67e..3c4105603f9d 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -698,6 +698,8 @@ const struct bpf_map_ops percpu_array_map_ops = { .map_delete_elem = array_map_delete_elem, .map_seq_show_elem = percpu_array_map_seq_show_elem, .map_check_btf = array_map_check_btf, + .map_lookup_batch = generic_map_lookup_batch, + .map_update_batch = generic_map_update_batch, .map_set_for_each_callback_args = map_set_for_each_callback_args, .map_for_each_callback = bpf_for_each_array_elem, .map_btf_name = "bpf_array", |