Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subskeleton support for BPF libraries #2695

Closed
wants to merge 6 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: Subskeleton support for BPF libraries
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=622431

@kernel-patches-bot
Copy link
Author

Master branch: 357b3cc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=622431
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: a77c2cf
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=622431
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 6789ab9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=622431
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: c09df4b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=622431
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: d3b351f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=622431
version: 2

@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=622431 expired. Closing PR.

@kernel-patches-bot
Copy link
Author

Master branch: cbdaf71
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=623660
version: 3

@kernel-patches-bot
Copy link
Author

Master branch: 6585abe
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=623660
version: 3

@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=623660 expired. Closing PR.

@kernel-patches-bot
Copy link
Author

Master branch: ad13baf
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=624058
version: 4

@kernel-patches-bot
Copy link
Author

Master branch: 7cda76d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=624058
version: 4

@kernel-patches-bot
Copy link
Author

Master branch: a50cbac
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=624058
version: 4

@kernel-patches-bot
Copy link
Author

Master branch: a50cbac
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=624058
version: 4

@kernel-patches-bot
Copy link
Author

Master branch: e0999c8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=624058
version: 4

@kernel-patches-bot
Copy link
Author

Master branch: e0999c8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=624058
version: 4

Nobody and others added 4 commits March 17, 2022 20:47
Currently, libbpf considers a single routine in .text to be a program. This
is particularly confusing when it comes to library objects - a single routine
meant to be used as an extern will instead be considered a bpf_program.

This patch hides this compatibility behavior behind the pre-existing
SEC_NAME strict mode flag.

Signed-off-by: Delyan Kratunov <delyank@fb.com>
For internal and user maps, look up the key and value btf
types on open() and not load(), so that `bpf_map_btf_value_type_id`
is usable in `bpftool gen`.

Signed-off-by: Delyan Kratunov <delyank@fb.com>
In symmetry with bpf_object__open_skeleton(),
bpf_object__open_subskeleton() performs the actual walking and linking
of maps, progs, and globals described by bpf_*_skeleton objects.

Signed-off-by: Delyan Kratunov <delyank@fb.com>
@kernel-patches-bot
Copy link
Author

Master branch: 5a5c11e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=624058
version: 4

Delyan Kratunov added 2 commits March 17, 2022 20:47
Subskeletons are headers which require an already loaded program to
operate.

For example, when a BPF library is linked into a larger BPF object file,
the library userspace needs a way to access its own global variables
without requiring knowledge about the larger program at build time.

As a result, subskeletons require a loaded bpf_object to open().
Further, they find their own symbols in the larger program by
walking BTF type data at run time.

At this time, programs, maps, and globals are supported through
non-owning pointers.

Signed-off-by: Delyan Kratunov <delyank@fb.com>
This patch changes the selftests/bpf Makefile to also generate
a subskel.h for every skel.h it would have normally generated.

Separately, it also introduces a new subskeleton test which tests
library objects, externs, weak symbols, kconfigs, and user maps.

Signed-off-by: Delyan Kratunov <delyank@fb.com>
@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=624058 irrelevant now. Closing PR.

@kernel-patches-bot kernel-patches-bot deleted the series/619393=>bpf-next branch March 18, 2022 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant