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

bpf: Fix map pinning #171

Merged
merged 1 commit into from
Feb 11, 2022
Merged

Conversation

vadorovsky
Copy link
Member

Aya relies on the pinning field in BPF map definitions. libbpf doesn't
provide that field, so instead of using their bpf_map_def struct, here
we define our bpf_elf_map struct which has it.

Our structure is similar to those available in Cilium[0] and some
selftests in the kernel tree[1].

[0] https://github.com/cilium/cilium/blob/v1.11.1/bpf/include/bpf/loader.h#L19-L29
[1] https://elixir.bootlin.com/linux/v5.16.8/source/samples/bpf/tc_l2_redirect_kern.c#L23

Fixes: #169
Signed-off-by: Michal Rostecki mrostecki@opensuse.org

Aya relies on the `pinning` field in BPF map definitions. libbpf doesn't
provide that field, so instead of using their bpf_map_def struct, here
we define our bpf_elf_map struct which has it.

Our structure is similar to those available in Cilium[0] and some
selftests in the kernel tree[1].

[0] https://github.com/cilium/cilium/blob/v1.11.1/bpf/include/bpf/loader.h#L19-L29
[1] https://elixir.bootlin.com/linux/v5.16.8/source/samples/bpf/tc_l2_redirect_kern.c#L23

Fixes: lockc-project#169
Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
Copy link
Collaborator

@mjura mjura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vadorovsky vadorovsky merged commit c390720 into lockc-project:main Feb 11, 2022
@vadorovsky vadorovsky deleted the fix-map-pinning branch February 11, 2022 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could not found a container for a registered process
2 participants