Professional Documents
Culture Documents
CS744 DPDK Deep Dive Slides
CS744 DPDK Deep Dive Slides
(DPDK)
CS 744
Tx to Worker Rx from
Core Master Core
CPU Core
Process
RX Process TX
RX TX
NIC NIC
Run-to-completion model
Core 1
Process
Core 2 Core n
pkt
. . .
DPDK
RSS in NIC
DPDK
RSS on NIC not compulsory
Ethernet IP UDP Payload
Insert IGB_UIO
Run dpdk-setup.sh Compile drivers and
(PMD) kernel
script application
module
Run
Application
Let’s look at an example
DPDK
Ethernet Ethernet
(Src:MAC_A, IP packet (Src:MAC_B, IP packet
Dst: MAC_B) Dst: MAC_A)
L2 forwarding sample application
Server B, running L2-fwd
Ethernet
(Src:MAC_A, IP packet 1. Rx Ethernet pkts
Dst: MAC_B) 2. Show packet contents
Load 3. Swap MAC
generator Ethernet 4. Tx packets
(Src:MAC_B, IP packet
(Server A)
Dst: MAC_A)
DPDK driver
Ethernet
(Src:MAC_B, IP packet
Dst: MAC_A)
L2-fwd: Explanation
➢ This should be the first API to be called. It initializes the EAL layer & makes way
for the application to use the DPDK framework.
ret = rte_eal_init(argc, argv);
➢ argc: No. of command line arguments (both EAL & application specific
parameters)
➢ ret: On success, ret stores the no. of parsed arguments, which is equal to the
no. of EAL parameters passed. The application can now use argc & argv to
parse application specific parameters like any other normal C/C++ program
using int main(int argc, char *argv[]).
L2-fwd: Explanation
❖ Setting up ports/queues:
➢ Setting up Tx queue(s).
rte_eth_tx_queue_setup();
■ No. of Tx ring descriptors to allot, what Tx offloading feature to be enabled etc.
➢ Setting up Rx queue(s).
rte_eth_rx_queue_setup();
■ No. of Rx ring descriptors to allot, what Rx offloading feature to be enabled etc.