Date created: Saturday, September 21, 2019 4:55:58 PM. Last modified: Sunday, May 19, 2024 7:28:41 PM

MoonGen

Install

Ubuntu 14.04.6 LTS:

# Install pre-reqs and clone MoonGen repo:
sudo apt-get install -y git build-essential cmake linux-headers-`uname -r` pciutils libnuma-dev
git clone https://github.com/emmericp/MoonGen.git
cd MoonGen/

# Build MoonGen, this will fail to bind NICs (after the build is completed) if DPDK was not already installed, due to the igb_uio Kernel module being missing:
./build.sh

# Load the module which should have been built when the MoonGen build script was run
# (it will have installed and compiled libmoon, DPDK and all other dependencies).
# The uio module must be loaded before the igb_uio module can be loaded:
sudo modprobe uio
lsmod | grep uio
modinfo ./libmoon/deps/dpdk/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
sudo insmod ./libmoon/deps/dpdk/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
lsmod | grep uio

# Before disconnecting an i40e based NIC like an Intel X710, disabled LLDP,
# which is enabled in the firmware by default, not the driver, so ethtool can't be used:
sudo bash -c "echo lldp stop > /sys/kernel/debug/i40e/0000:01:00.0/command"
sudo bash -c "echo lldp stop > /sys/kernel/debug/i40e/0000:01:00.1/command"

# Before disconnecting an ixgbe based NIC like Intel 82599ES, disable flow control,
# which is enabled by the ixgbe driver by default, so use ethtool:
sudo ethtool -a eth1
sudo ethtool -A eth1 rx off tx off
sudo ethtool -A eth2 rx off tx off
sudo ethtool -1 eth1

# Disconnect the test interfaces from the Kernel and load them with the UIO driver
sudo lshw -c network | grep driver
sudo ip link set down eth1
sudo ip link set down eth2
# This will bind all down interfaces: sudo ./bind-interfaces.sh
# Bind specific ones only:
sudo ./libmoon/deps/dpdk/usertools/dpdk-devbind.py --bind=igb_uio 0000:01:00.0
sudo ./libmoon/deps/dpdk/usertools/dpdk-devbind.py --bind=igb_uio 0000:01:00.1
sudo ./libmoon/deps/dpdk/usertools/dpdk-devbind.py --status

# Setup huge pages