Expand description
Raw FFI bindings to DPDK (Data Plane Development Kit)
This crate provides low-level bindings to DPDK. It operates in two modes:
§With DPDK installed (bindgen feature)
When compiled with the bindgen feature and DPDK is installed, this crate
generates real FFI bindings using bindgen:
[dependencies]
dpdk-sys = { version = "0.1", features = ["bindgen"] }§Without DPDK (default)
By default, this crate provides stub implementations that allow development and testing without requiring DPDK to be installed. The stubs provide the same API but don’t perform actual packet I/O.
§Environment Variables
DPDK_PATH: Path to DPDK installation (e.g.,/usr/local/dpdk)PKG_CONFIG_PATH: Can be set to help pkg-config find DPDK
Structs§
- rte_
eth_ conf - Ethernet device configuration
- rte_
eth_ desc_ lim - rte_
eth_ dev_ info - Ethernet device info
- rte_
eth_ intr_ conf - rte_
eth_ link - Link status
- rte_
eth_ rss_ conf - rte_
eth_ rx_ adv_ conf - rte_
eth_ rxconf - rte_
eth_ rxmode - rte_
eth_ stats - Ethernet statistics
- rte_
eth_ thresh - rte_
eth_ tx_ adv_ conf - rte_
eth_ txconf - rte_
eth_ txmode - rte_
ether_ addr - Ethernet address (MAC address)
- rte_
ether_ hdr - Ethernet header
- rte_
ipv4_ hdr - IPv4 header
- rte_
mbuf - Memory buffer for packet data
- rte_
mbuf_ hash - Hash union for rte_mbuf
- rte_
mempool - Memory pool (simplified stub version for testing)
- rte_
mempool_ cache - Memory pool cache (opaque)
- rte_
ring - Ring buffer (opaque)
- rte_
tcp_ hdr - TCP header
- rte_
udp_ hdr - UDP header
Enums§
Constants§
- RTE_
ERRNO_ BASE - RTE_
ETHER_ ADDR_ LEN - RTE_
ETHER_ TYPE_ ARP - RTE_
ETHER_ TYPE_ IPV4 - RTE_
ETHER_ TYPE_ IPV6 - RTE_
ETHER_ TYPE_ VLAN - RTE_
ETH_ RX_ OFFLOAD_ IPV4_ CKSUM - RTE_
ETH_ RX_ OFFLOAD_ TCP_ CKSUM - RTE_
ETH_ RX_ OFFLOAD_ UDP_ CKSUM - RTE_
ETH_ RX_ OFFLOAD_ VLAN_ STRIP - RTE_
ETH_ TX_ OFFLOAD_ IPV4_ CKSUM - RTE_
ETH_ TX_ OFFLOAD_ TCP_ CKSUM - RTE_
ETH_ TX_ OFFLOAD_ UDP_ CKSUM - RTE_
ETH_ TX_ OFFLOAD_ VLAN_ INSERT - RTE_
MAX_ ETHPORTS - RTE_
MAX_ LCORE - RTE_
MBUF_ DEFAULT_ BUF_ SIZE - RTE_
MBUF_ F_ RX_ IP_ CKSUM_ BAD - RTE_
MBUF_ F_ RX_ IP_ CKSUM_ GOOD - RTE_
MBUF_ F_ RX_ IP_ CKSUM_ MASK - RTE_
MBUF_ F_ RX_ IP_ CKSUM_ UNKNOWN - RTE_
MBUF_ F_ RX_ L4_ CKSUM_ BAD - RTE_
MBUF_ F_ RX_ L4_ CKSUM_ GOOD - RTE_
MBUF_ F_ RX_ L4_ CKSUM_ MASK - RTE_
MBUF_ F_ RX_ L4_ CKSUM_ UNKNOWN - RTE_
MBUF_ F_ RX_ VLAN - RTE_
MBUF_ F_ RX_ VLAN_ STRIPPED - RTE_
MBUF_ F_ TX_ IPV4 - RTE_
MBUF_ F_ TX_ IP_ CKSUM - RTE_
MBUF_ F_ TX_ UDP_ CKSUM - RTE_
MBUF_ F_ TX_ VLAN - RTE_
PKTMBUF_ HEADROOM - SOCKET_
ID_ ANY
Functions§
- is_
real_ dpdk - Check if real DPDK bindings are being used
- is_stub
- Check if stub implementations are being used
- mbuf_
get_ ⚠tx_ offload - mbuf_
set_ ⚠tx_ offload - rte_
be_ to_ cpu_ 16 - rte_
be_ to_ cpu_ 32 - rte_
cpu_ to_ be_ 16 - rte_
cpu_ to_ be_ 32 - rte_
eal_ cleanup - rte_
eal_ init - rte_
errno - rte_
eth_ allmulticast_ disable - rte_
eth_ allmulticast_ enable - rte_
eth_ allmulticast_ get - rte_
eth_ dev_ close - rte_
eth_ dev_ configure - rte_
eth_ dev_ count_ avail - rte_
eth_ dev_ info_ get - rte_
eth_ dev_ set_ mc_ addr_ list - rte_
eth_ dev_ socket_ id - rte_
eth_ dev_ start - rte_
eth_ dev_ stop - rte_
eth_ link_ get - rte_
eth_ link_ get_ nowait - rte_
eth_ macaddr_ get - rte_
eth_ promiscuous_ disable - rte_
eth_ promiscuous_ enable - rte_
eth_ promiscuous_ get - rte_
eth_ rx_ burst - rte_
eth_ rx_ queue_ setup - rte_
eth_ stats_ get - rte_
eth_ stats_ reset - rte_
eth_ tx_ burst - rte_
eth_ tx_ queue_ setup - rte_
get_ main_ lcore - rte_
ipv4_ cksum - rte_
ipv4_ udptcp_ cksum - rte_
lcore_ count - rte_
lcore_ id - rte_
mempool_ avail_ count - rte_
mempool_ empty - rte_
mempool_ free - rte_
mempool_ full - rte_
mempool_ in_ use_ count - rte_
pktmbuf_ alloc - rte_
pktmbuf_ alloc_ bulk - rte_
pktmbuf_ clone - rte_
pktmbuf_ free - rte_
pktmbuf_ pool_ create - rte_
socket_ id - rte_
strerror - stub_
eal_ is_ cleaned_ up - Returns true if EAL was cleaned up after being initialized. This is the state that causes segfaults with real DPDK.
- stub_
eal_ is_ initialized - Returns true if EAL is currently initialized (init called, cleanup not yet called). Exposed for tests to verify lifecycle behavior.
- stub_
eal_ reset - Reset EAL state to “never initialized” (0). For use in test teardown so serial tests don’t leak state to the next test.