Expand description
This crate allows for the creation and usage of AF_XDP sockets on Linux, along with the attendant memory mappings and rings.
The primary difference between this crate and the other XSK/XDP crates available on crates.io is that this crate does not depend on any C code.
§Why not use this crate?
This crate is still early days, and focused on the needs of Quilkin, so feature requests or bug fixes that don’t pertain to it would most likely need outside contribution. There are already several other Rust crates available that (probably) have more full featured support.
§Features
- Network interface enumeration and capability querying
- Basic Umem support
- Shared Umem support
- Fill, RX, TX, Completion rings
- TX checksum offload/completion timestamp
- RX metadata
§License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
§Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Re-exports§
Modules§
- affinity
- Core affinity helpers
- error
- Errors that can be returned by various calls in this crate
- libc
- Simple inline definitions of various types and constants so that we can properly comment them, as well as add a few missing ones.
- nic
- Utilities for querying NIC capabilities
- packet
- Utilities for raw
Packet
reading and writing - slab
- Contains simple slab data structures for use with the TX and RX rings
- socket
- Initialization and polling of an
AF_XDP
socket - umem
Umem
creation and operation
Structs§
- Completion
Ring - The ring used to dequeue buffers that the kernel has finished sending
- Fill
Ring - The ring used to enqueue buffers for the kernel to fill in with packets received from a NIC
- Ring
Config - Used to configure the rings created by the kernel in
crate::socket::XdpSocketBuilder::build_rings
- Ring
Config Builder - Builder for the rings that will be created for an XDP socket.
- Rings
- The set of rings tied to an XDP socket
- RxRing
- Ring from which we can dequeue packets that have been filled by the kernel
- TxRing
- The ring used to enqueue packets for the kernel to send
- Wakable
Fill Ring - The wakable version of
FillRing
, which requires that we notify the kernel when there are new buffers available to receive packets - Wakable
Rings - The set of rings tied to an XDP socket
- Wakable
TxRing - Wakable version of
TxRing