The Data Plane Development Kit (DPDK) completely removes the kernel from network routing. In this chapter, we outline poll-mode drivers, rings, and memory management pools (mbufs).
Poll-Mode Drivers (PMD)
Traditional network cards trigger hardware interrupts to notify the OS of arriving packets. Context switching and interrupt processing degrade CPU throughput under high loads.
DPDK bypasses interrupts entirely by utilizing a Poll-Mode Driver (PMD). Dedicated CPU cores run infinite polling loops, fetching packets directly from the NIC’s RX ring buffers into user space.
Memory Management: Mbufs
Memory allocation is a critical latency bottleneck. DPDK uses pre-allocated memory pools (mempools) containing packet buffers (rte_mbuf) mapped across hugepages to avoid virtual memory translation lookups.
#include <rte_eal.h>
#include <rte_ethdev.h>
// Poll packets from NIC port
uint16_t RetrievePackets(uint16_t port_id, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) {
// Poll burst of packets directly from NIC RX queue into pre-allocated memory
return rte_eth_rx_burst(port_id, 0, rx_pkts, nb_pkts);
}