Skip to content

DPDK (Data Plane Development Kit)

Status: Planned

This module is not yet implemented. The design below represents the target architecture for kernel-bypass networking.

Overview

DPDK provides userspace poll-mode drivers (PMDs) for direct NIC access, bypassing the Linux kernel networking stack entirely. Achieves line-rate packet processing with sub-microsecond latency.

Architecture

┌──────────────────────────────────────────────────────────────────────┐
│  Traditional Linux Stack          vs.         DPDK Architecture       │
│                                                                       │
│  ┌─────────────┐                     ┌─────────────┐                 │
│  │ Application │                     │ Application │                 │
│  └──────┬──────┘                     └──────┬──────┘                 │
│         │ syscall                           │ direct call             │
│  ┌──────▼──────┐                     ┌──────▼──────┐                 │
│  │   Kernel    │                     │  DPDK PMD   │                 │
│  │  Net Stack  │                     │ (Userspace) │                 │
│  └──────┬──────┘                     └──────┬──────┘                 │
│         │ DMA                               │ DMA                    │
│  ┌──────▼──────┐                     ┌──────▼──────┐                 │
│  │     NIC     │                     │     NIC     │                 │
│  └─────────────┘                     └─────────────┘                 │
│                                                                       │
│  Latency: 5-10 µs                   Latency: < 500 ns               │
└──────────────────────────────────────────────────────────────────────┘

Planned API

typedef struct {
    uint16_t port_id;           /* DPDK port number */
    uint16_t rx_queue_count;    /* Number of RX queues */
    uint16_t tx_queue_count;    /* Number of TX queues */
    uint32_t rx_ring_size;      /* Descriptors per RX ring */
    uint32_t tx_ring_size;      /* Descriptors per TX ring */
    struct rte_mempool *mbuf_pool;  /* Packet buffer pool */
} dpdk_port_t;

/* Lifecycle */
int dpdk_init(int argc, char **argv);   /* EAL initialization */
int dpdk_port_configure(dpdk_port_t *port, uint16_t port_id);
int dpdk_port_start(dpdk_port_t *port);
void dpdk_port_stop(dpdk_port_t *port);

/* Packet I/O (poll-mode, no interrupts) */
uint16_t dpdk_rx_burst(dpdk_port_t *port, uint16_t queue_id,
                       struct rte_mbuf **pkts, uint16_t max_pkts);
uint16_t dpdk_tx_burst(dpdk_port_t *port, uint16_t queue_id,
                       struct rte_mbuf **pkts, uint16_t nb_pkts);

DPDK Memory Model

┌───────────────────────────────────────────────────────────────────┐
│  Hugepage-backed memory (no TLB misses):                           │
│                                                                    │
│  ┌───────────────────────────────────────────────────────────────┐ │
│  │  rte_mempool (mbuf pool):                                      │ │
│  │  ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐          │ │
│  │  │mbuf 0│mbuf 1│mbuf 2│mbuf 3│mbuf 4│  ... │mbuf N│          │ │
│  │  └──────┴──────┴──────┴──────┴──────┴──────┴──────┘          │ │
│  │                                                                │ │
│  │  Per-core cache: thread-local free list (no contention)        │ │
│  └───────────────────────────────────────────────────────────────┘ │
│                                                                    │
│  NIC DMA descriptors point directly into mbuf data areas.          │
│  Zero-copy from wire to application.                               │
└───────────────────────────────────────────────────────────────────┘

Performance Targets

Metric Target Notes
Packet processing latency < 500 ns Per-packet, single core
Throughput (64B packets) 14.88 Mpps 10 GbE line rate
Throughput (1518B packets) 812 Kpps 10 GbE line rate
Memory allocation O(1) Per-core cached mempool

Dependencies

Dependency Version Purpose
DPDK ≥ 22.11 PMD, EAL, mempool
Linux hugepages 2MB/1GB Contiguous DMA memory
IOMMU / VFIO any Userspace device access
libnuma any NUMA-aware allocation

Planned NIC Support

Driver NICs Status
net_ixgbe Intel X520, X540, X550 Planned
net_i40e Intel XL710, X722 Planned
net_mlx5 Mellanox ConnectX-5/6 Planned
net_virtio QEMU/KVM virtio-net Planned (testing)

Implementation Roadmap

  • EAL initialization wrapper
  • Port configuration (RSS, flow director)
  • mbuf pool management
  • RX/TX burst API with batch processing
  • Integration with SPSC ring buffer for cross-core dispatch
  • Flow classification and steering rules
  • Performance benchmark suite