-
Notifications
You must be signed in to change notification settings - Fork 119
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
feat(s2n-quic-xdp): add if_xdp module #1702
Conversation
8510776
to
3636b73
Compare
3636b73
to
82bde64
Compare
#[derive(Copy, Clone, Debug, Default)] | ||
#[repr(transparent)] | ||
pub struct UmemFlags: u32 { | ||
const UNALIGNED_CHUNK_FLAG = 1 << 0; | ||
} |
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.
why is this sized as u32?
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.
All of the flags are u32
. You can also see the config field in libxdp. I can link this if that's helpful.
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.
So if I understand correctly, this is specifically matching the xdp-project interface. Yea it would be good to include a link to the xdp-project github, since this is definitely new territory for me and possible others.
#[repr(C)] | ||
pub struct Address { | ||
pub family: u16, | ||
pub flags: XdpFlags, |
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.
nice!
tools/xdp/s2n-quic-xdp/src/if_xdp.rs
Outdated
/// Dropped due to invalid descriptor | ||
pub rx_invalid_descriptors: u64, | ||
/// Dropped due to invalid descriptor | ||
pub tx_invalid_descriptors: u32, |
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.
pub tx_invalid_descriptors: u32, | |
pub tx_invalid_descriptors: u64, |
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.
nice catch. that would have been annoying to debug 😄
Description of changes:
This PR:
if_xdp.rs
module, which implements the structs, flags, and definitions in the kernel.Call-outs:
The
if_xdp
could probably have been auto-generated with bindgen. However, the macro definitions aren't correctly translated, since they don't have an explicit type. I also wanted to make it a bit more ergonomic by using thebitflags
crate, expanding the struct names/fields, and adding some additional documentation and references.I also regenerated the bpf code while I was here, as a few dependencies have been updated since they were last committed.
Testing:
The xdp CI task now includes a
cargo test
andcargo clippy
, which will build the s2n-quic-xdp crate and run any associated tests.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.