-
Notifications
You must be signed in to change notification settings - Fork 297
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 bpf_map_delete_elem
for XskMap
#848
base: main
Are you sure you want to change the base?
Conversation
✅ 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. |
8eb1cd3
to
423f86c
Compare
Hey @alessandrod, this pull request changes the Aya Public API and requires your review. |
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.
One small nit and one API related query for @alessandrod:
For eBPF maps that are array-like we expose get
and set
.
For eBPF maps that are hashmap-like we expose get
, insert
and remove
.
Since BPF_MAP_TYPE_ARRAY doesn't support bpf_map_delete_elem we never implemented it, so there is no precedent set for naming.
Would you go with, delete
, remove
or clear
?
/// | ||
/// Returns [`MapError::OutOfBounds`] if `index` is out of bounds, [`MapError::SyscallError`] | ||
/// if `bpf_map_update_elem` fails. | ||
pub fn clear_index(&mut self, index: u32) -> Result<(), MapError> { |
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.
This should likely be either remove
or delete
. Hold please while we hear from @alessandrod.
Hey @alessandrod, this pull request changes the Aya Public API and requires your review. |
480869c
to
3890914
Compare
3890914
to
cee470b
Compare
e09a4bb
to
05d7bff
Compare
05d7bff
to
b5d508f
Compare
Co-authored-by: Dave Tucker <[email protected]>
b5d508f
to
fb0af68
Compare
@alessandrod Could you take a look at this please? Without the function, it's not possible (as far as I know) to clean up a single AF_XDP socket without detaching/unloading the whole program. |
Add
clear_index()
to be able to usebpf_map_delete_elem
forXskMap
. Test is added to the existing af_xdp integration test.This change is