Skip to main content

Crate dpdk_sys

Crate dpdk_sys 

Source
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§

c_void
Equivalent to C’s void type when used as a pointer.

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_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
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.

Type Aliases§

c_char
c_int
c_uint
size_t
ssize_t