This repository contains skeleton code for benchmarking packet RX throughput with libpcap and DPDK written in C and in Rust.
count
: counts the total number of packets received, and the total number of packets received per RX queuelivestats
: slightly more complex than simple-count, but outputs packet throughput in real-time
These applications are meant to be run on a multi-core Linux server with a Mellanox CX-5 adapter. More interfaces are ok, but for simplicity these assume that port index 0 is on the Mellanox card.
Build and install DPDK on your system. See the Getting Started Guide for more details.
This has been tested on the following DPDK versions:
- 20.11
- 21.02
For Mellanox NICs, install MLNX_OFED. Tested on OFED versions:
- 5.1-2.5.8.0
- 5.2-2.2.0.0
Set the DPDK_PATH
environment variable to the DPDK installation directory, and set LD_LIBRARY_PATH
to $DPDK_PATH/lib/x86_64-linux-gnu
.
DPDK takes EAL parameters to select the list of cores to run on (-l
) and the number of memory channels to use (-n
). Be sure to only use consecutive core IDs, as both apps default to core 0
as the main core, and cores 1
through N
as the N worker cores. Each worker core maps to a single RX queue. The following examples use cores 0 through 4 and 6 memory channels.
make
sudo ./build/simple-count -l 0-4 -n 6
cargo build --release
sudo env LD_LIBRARY_PATH=$LD_LIBRARY_PATH ./target/release/simple_count -l 0-4 -n 6
Ctrl-c to stop execution and display statistics.