[RFC PATCH net-next 05/13] bpf: offload: allow PERCPU_ARRAY maps for offloaded programs
From: Taehee Yoo
Date: Sun Jul 19 2026 - 14:02:57 EST
The knod BPF offload keeps hot per-CPU statistics in a PERCPU_ARRAY
map that is mirrored into accelerator memory and aggregated back on the
host. Permit this map type on the offload path.
Signed-off-by: Taehee Yoo <ap420073@xxxxxxxxx>
(cherry picked from commit c447c9012940d48c1ec20a8ebac8d779e7d5a6fa)
---
kernel/bpf/offload.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/offload.c b/kernel/bpf/offload.c
index 0d6f5569588c..36e747a12cbe 100644
--- a/kernel/bpf/offload.c
+++ b/kernel/bpf/offload.c
@@ -510,7 +510,8 @@ struct bpf_map *bpf_map_offload_map_alloc(union bpf_attr *attr)
if (!capable(CAP_SYS_ADMIN))
return ERR_PTR(-EPERM);
if (attr->map_type != BPF_MAP_TYPE_ARRAY &&
- attr->map_type != BPF_MAP_TYPE_HASH)
+ attr->map_type != BPF_MAP_TYPE_HASH &&
+ attr->map_type != BPF_MAP_TYPE_PERCPU_ARRAY)
return ERR_PTR(-EINVAL);
offmap = bpf_map_area_alloc(sizeof(*offmap), NUMA_NO_NODE);
--
2.43.0