dpdk-stdlib
Safe Rust wrappers for DPDK EAL, Port, Mbuf, Mempool, and RX/TX queues.
Overview
This crate provides safe, idiomatic Rust abstractions over the raw DPDK FFI bindings in dpdk-stdlib-sys. It handles resource lifecycle, error conversion, and NUMA-aware allocation so higher-level crates don't need to touch unsafe code.
Key Types
Eal— DPDK Environment Abstraction Layer. Initializes DPDK, manages global state, and cleans up on drop.Port— Ethernet device (NIC). Configures RX/TX queues, starts/stops the device, and provides burst I/O.Mbuf— Message buffer. Zero-copy packet buffer with builder API for constructing Ethernet frames.Mempool— Pre-allocated pool of Mbufs. NUMA-aware, configurable size and cache.MacAddress— 6-byte MAC address with display formatting and broadcast/multicast detection.PortConfig— Builder for port configuration including RX/TX offloads.
Usage
This crate is a dependency of dpdk-stdlib-udp and is not typically used directly. If you need safe DPDK primitives:
[]
= "0.1"
use ;
use MempoolConfig;
use PortConfig;
// Initialize DPDK
let eal = new?;
// Create a mempool
let pool = create?;
// Configure and start a port
let port = new?;
port.start?;
Hardware Offload
The crate queries NIC capabilities at port init and exposes them:
- IPv4 header checksum offload (RX and TX)
- UDP checksum offload (RX and TX)
- TCP checksum offload (RX and TX)
License
MIT