Skip to content

libbpf-cargo: Make all XXX_data skeleton members optional #1162

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

Merged
merged 2 commits into from
May 7, 2025

Conversation

d-e-s-o
Copy link
Collaborator

@d-e-s-o d-e-s-o commented May 5, 2025

Please see individual commits for descriptions.

d-e-s-o added 2 commits May 5, 2025 09:48
Commit 27dfe16 "libbpf-cargo: Don't provide kconfig data access after "open""
worked around the fact that the kconfig data member may not be present
whenever. As it turns out, there is no guarantee that any of the data
members are available as memory mapped data: on older kernels that "do
not support memory-mapped global variable maps, libbpf will just avoid
doing mmap" [0].
Revert this special sauce work around, as that means it's basically
unnecessary now and we have to come up with a generic solution instead.

This reverts commit 27dfe16.

[0]: libbpf#1151 (comment)

Signed-off-by: Daniel Müller <[email protected]>
As discussed in libbpf#1151, libbpf may not provide direct memory map access
to any of the BPF map members if the kernel does not support
memory-mapped global variable maps.
To that end, make them all optional.

Closes: libbpf#1151

Signed-off-by: Daniel Müller <[email protected]>
@d-e-s-o d-e-s-o requested a review from anakryiko May 5, 2025 17:06
@d-e-s-o d-e-s-o force-pushed the topic/opt-mmap-maps branch from d244e61 to cc819a0 Compare May 5, 2025 17:07
@d-e-s-o d-e-s-o linked an issue May 5, 2025 that may be closed by this pull request
@d-e-s-o d-e-s-o force-pushed the topic/opt-mmap-maps branch 2 times, most recently from 40f685f to 6ea7be7 Compare May 5, 2025 17:32
Copy link
Member

@anakryiko anakryiko left a comment

Choose a reason for hiding this comment

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

given sched_ext isn't bothered by this much, lgtm

@d-e-s-o d-e-s-o merged commit d3d725a into libbpf:master May 7, 2025
14 checks passed
@d-e-s-o d-e-s-o deleted the topic/opt-mmap-maps branch May 7, 2025 15:39
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.

libbpf-rs is unable to load eBPF programs on older kernel versions
2 participants