-
Notifications
You must be signed in to change notification settings - Fork 298
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
Implement XDP Map Types #292
Conversation
✅ Deploy Preview for aya-rs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
This commit adds implementations for: - xskmap - devmap - devmap_hash - cpumap Which can all be used to redirect XDP packets to various different locations Signed-off-by: Dave Tucker <[email protected]>
Signed-off-by: Dave Tucker <[email protected]>
Add BpfLoader::set_max_entries, which sets the max_entries for the specified map, as the load-time option. The max_entries set at map initialization in the ebpf component can be overwritten by this method called on the userspace component. If you want to set max_entries for multiple maps in an ebpf component, you can do so by calling set_max_entries in the form of a method chain. Fixes: aya-rs#308 Refs: aya-rs#292
Add BpfLoader::set_max_entries, which sets the max_entries for the specified map, as the load-time option. The max_entries set at map initialization in the ebpf component can be overwritten by this method called on the userspace component. If you want to set max_entries for multiple maps in an ebpf component, you can do so by calling set_max_entries in the form of a method chain. Fixes: aya-rs#308 Refs: aya-rs#292
Add BpfLoader::set_max_entries, which sets the max_entries for the specified map, as the load-time option. The max_entries set at map initialization in the ebpf component can be overwritten by this method called on the userspace component. If you want to set max_entries for multiple maps in an ebpf component, you can do so by calling set_max_entries in the form of a method chain. Fixes: aya-rs#308 Refs: aya-rs#292
NonNull::new(value as *mut u32).map(|p| p.as_ref()) | ||
} | ||
} | ||
} |
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.
I think that a method such as the following is also necessary, as there's otherwise no way to access the raw map (that I've found) so that bpf_redirect_map
can be called by a user of this type
} | |
pub unsafe fn redirect(&mut self, key: u64, flags: u64) -> i64 { | |
bpf_redirect_map( | |
&mut self.def as *mut _ as *mut _, | |
key, | |
flags, | |
) | |
} | |
} |
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.
Correct, I just wondered about the "missing" bpf_redirect_map()
wrapper myself.
Please consider enabling these new maps for use in multi-buffer contexts (via their specific section names), similar to #519. Thanks for your efforts! |
Closing in favour of #527 |
@dave-tucker, this pull request is now in conflict and requires a rebase. |
Closing for real. |
This commit adds implementations for:
Which can all be used to redirect XDP packets to various different
locations
TODO:
aya-bpf
Closes: #193 #194 #195 #199