-
Notifications
You must be signed in to change notification settings - Fork 289
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
aya: add feature probing for program and map type #1063
Draft
tyrone-wu
wants to merge
4
commits into
aya-rs:main
Choose a base branch
from
tyrone-wu:aya/probe-prog-types
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for aya-rs-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hey @alessandrod, this pull request changes the Aya Public API and requires your review. |
mergify
bot
added
aya
This is about aya (userspace)
aya-obj
Relating to the aya-obj crate
test
A PR that improves test cases or CI
labels
Oct 19, 2024
tyrone-wu
force-pushed
the
aya/probe-prog-types
branch
from
October 19, 2024 20:32
97dcc2b
to
d9bc9b7
Compare
tyrone-wu
changed the title
aya: add feature probing program types
aya: add feature probing for program and map type
Oct 21, 2024
tyrone-wu
force-pushed
the
aya/probe-prog-types
branch
4 times, most recently
from
October 22, 2024 01:07
7628c03
to
0e67fa4
Compare
When `aya::obj` was migrated to be its own crate `aya-obj`, the `obj` alias was created to preserve existing imports that relied on `crate::obj`. This resulted in 3 ways to import `aya-obj` objects: - `use aya_obj::*` - `use obj::*` - `use crate::obj::*` The `obj` alias is now removed to avoid confusion, and all `obj` imports should now refer to `aya_obj`.
Adds API that probes whether kernel supports a program type. Additionally add `const fn bpf_insn::new()` so that common instructions are not re-computed from `copy_instructions()`. Assertions for `LircMode2` and `Lsm` are disabled because they require certain kernel configs to be enabled, which are not by default in VM tests.
Add API that probes whether kernel supports a map type. Assertion for `InodeStorage` are disabled because they require CONFIG_BPF_LSM to be enabled, which is not be default in VM tests.
Cached probed for ProgramInfo fields instead of exposing it through global FEATURE. Probing operation happens on cache miss, which happens when first accessing the field, *and* if the field is 0. No need to probe if non-zero.
tyrone-wu
force-pushed
the
aya/probe-prog-types
branch
from
October 24, 2024 17:59
0e67fa4
to
6075a11
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api/needs-review
Makes an API change that needs review
aya
This is about aya (userspace)
aya-obj
Relating to the aya-obj crate
test
A PR that improves test cases or CI
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add API for detecting whether kernel supports program type and map type.
Also add
const fn bpf_insn::new(...)
so that common bpf instructions are not re-computed every time fromcopy_instructions()
.Assertions for
LircMode2
andLsm
are disabled because they require certain kernel configs to be enabled, which are not by default in VM integration tests. Same withInodeStorage
map assertion.I tested the new integration tests against a ton of ubuntu mainline kernels. Basically on every version where the program/map type was introduced I was able to verify that they were passing as expected, except for ones below
v4.4
since it gave errors on/sys/fs/bpf ENOENT: No such file or directory
.