Crate xdp

Source
Expand description

§📨 xdp

AF_XDP socket support in Rust

Crates.io API Docs dependency status Build Status

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

§License

Licensed under either of

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§

pub use packet::Packet;
pub use umem::Umem;

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§

CompletionRing
The ring used to dequeue buffers that the kernel has finished sending
FillRing
The ring used to enqueue buffers for the kernel to fill in with packets received from a NIC
RingConfig
Used to configure the rings created by the kernel in crate::socket::XdpSocketBuilder::build_rings
RingConfigBuilder
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
WakableFillRing
The wakable version of FillRing, which requires that we notify the kernel when there are new buffers available to receive packets
WakableRings
The set of rings tied to an XDP socket
WakableTxRing
Wakable version of TxRing