-
Notifications
You must be signed in to change notification settings - Fork 786
Allow callers to create VariableSpecs #1882
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
Open
lmb
wants to merge
2
commits into
cilium:main
Choose a base branch
from
lmb:variable-spec-public
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.
Open
Conversation
This file contains hidden or 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
5791c45 to
79f1b65
Compare
Collaborator
Author
|
@ti-mo can you give this a review please? |
ti-mo
requested changes
Nov 3, 2025
Collaborator
ti-mo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I have some doubts around the caller having to manage .Value before using .Set and .Get, PTAL.
24dc2e3 to
081c036
Compare
VariableSpec is the only component of CollectionSpec with unexported fields. This makes it awkward to use during testing outside of package ebpf. Fix this by exporting and documenting the fields of variable spec. To achieve this, VariableSpec.Set doesn't immediately copy data into MapSpec.Contents. Instead VariableSpec.Value holds the marshaled data. The collection loader ensures that VariableSpec.Value is copied into MapSpec.Contents before loading. A nice side-effect is that this ends up creating a lot less copies of MapSpec.Contents. MapSpec uses uint32 to specify public sizes like ValueSize. This is because the kernel interfaces only allow specifying 32 bit quantities. Change the public API of VariableSpec and Variable to match this. Fixes: cilium#1868 Signed-off-by: Lorenz Bauer <[email protected]>
Using RewriteConstants currently enforces the presence of BTF, even though the code doesn't explicitly rely on it. Remove this restriciton. Signed-off-by: Lorenz Bauer <[email protected]>
081c036 to
582b855
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See the commit messages for details.
Fixes: #1868