]> Git Repo - linux.git/commit
libbpf: Find correct module BTFs for struct_ops maps and progs.
authorKui-Feng Lee <[email protected]>
Fri, 19 Jan 2024 22:50:03 +0000 (14:50 -0800)
committerMartin KaFai Lau <[email protected]>
Wed, 24 Jan 2024 01:12:52 +0000 (17:12 -0800)
commit9e926acda0c2e21bca431a1818665ddcd6939755
tree4d4f1f22b84386dcd06c0402d196ffb748be121b
parentf6be98d19985411ca1f3d53413d94d5b7f41c200
libbpf: Find correct module BTFs for struct_ops maps and progs.

Locate the module BTFs for struct_ops maps and progs and pass them to the
kernel. This ensures that the kernel correctly resolves type IDs from the
appropriate module BTFs.

For the map of a struct_ops object, the FD of the module BTF is set to
bpf_map to keep a reference to the module BTF. The FD is passed to the
kernel as value_type_btf_obj_fd when the struct_ops object is loaded.

For a bpf_struct_ops prog, attach_btf_obj_fd of bpf_prog is the FD of a
module BTF in the kernel.

Signed-off-by: Kui-Feng Lee <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin KaFai Lau <[email protected]>
tools/lib/bpf/bpf.c
tools/lib/bpf/bpf.h
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_probes.c
This page took 0.052762 seconds and 4 git commands to generate.