summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAmery Hung <ameryhung@gmail.com>2025-08-06 19:25:38 +0300
committerMartin KaFai Lau <martin.lau@kernel.org>2025-08-06 23:39:58 +0300
commitd87a513d093726d121dd5c816e26803111a259d0 (patch)
tree478265f73c6c33b13dd6e234d8dc7bd57a63a39f /include/linux
parentf3af62b6cee8af9f07012051874af2d2a451f0e5 (diff)
downloadlinux-d87a513d093726d121dd5c816e26803111a259d0.tar.xz
bpf: Allow struct_ops to get map id by kdata
Add bpf_struct_ops_id() to enable struct_ops implementors to use struct_ops map id as the unique id of a struct_ops in their subsystem. A subsystem that wishes to create a mapping between id and struct_ops instance pointer can update the mapping accordingly during bpf_struct_ops::reg(), unreg(), and update(). Signed-off-by: Amery Hung <ameryhung@gmail.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://patch.msgid.link/20250806162540.681679-2-ameryhung@gmail.com
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index cc700925b802..e7ee089e8a31 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1985,6 +1985,7 @@ static inline void bpf_module_put(const void *data, struct module *owner)
module_put(owner);
}
int bpf_struct_ops_link_create(union bpf_attr *attr);
+u32 bpf_struct_ops_id(const void *kdata);
#ifdef CONFIG_NET
/* Define it here to avoid the use of forward declaration */