Pre-req: Install dependencies
코드 블럭 |
---|
# For Ubuntu
apt install build-essential
apt install python3-pyelftools
apt-get install -y libarchive-dev
apt-get install -y libelf-dev
apt install cmake
apt-get install -y pkg-config
apt-get install -y libdpdk-dev
apt-get install -y libnuma-dev
apt-get install git libpcap-dev
apt install python3-pip
pip3 install meson ninja
pip3 install meson ninja
# For Rocky/RHEL
dnf groupinstall "Development Tools"
dnf install numactl-devel
pip3 install meson ninja
pip3 install pyelftools
# For CentOS 7
yum -y install kernel-devel.x86_64
yum -y install numactl-devel.x86_64
yum -y install elfutils-libelf-devel
yum -y install libpcap-devel |
Pre-req: Install mlxofed pkg with --dpdk and --upstream-lib
...
코드 블럭 |
---|
|
# 1. Using dpdk based python program
/usr/local/bin/dpdk-hugepages.py -p 1G --setup 32G
# 2. Insert 'nr_hugepages'
echo 4 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
# 3. The permanent option (but I won't recommend this, this makes the the grub penic attack in rocky linux and goes to emergency mode)
vi /etc/fstab
nodev /mnt/huge hugetlbfs pagesize=1GB 0 0 |
Download pktgen-dpdk from official website (make sure, the version of pktgen-dpdk is higher than dpdk → it's very fragile)
코드 블럭 |
---|
export RTE_SDK=/root/dpdk-23.03
export RTE_TARGET=x86_64-native-linux-gcc
wget https://git.dpdk.org/apps/pktgen-dpdk/snapshot/pktgen-dpdk-pktgen-23.06.1.tar.xz
tar xJf pktgen-dpdk-pktgen-23.06.1.tar.xz
|
Following configuration can be applied if the expected bandwidth is not showing up for mellanox X5 (ref: https://stackoverflow.com/questions/72345569/why-does-dpdk-mellanox-connectx5-process-128b-packets-much-faster-than-other-s/72393527#72393527)
코드 블럭 |
---|
systemctl 335 stop irqbalance.service
systemctl disable irqbalance.service
systemctl stop wpa_supplicant
systemctl disable wpa_supplicant
./set_irq_affinity_cpulist.sh [non dpdk cores] [desired NIC]
mlxconfig -d /dev/mst/mt4119_pciconf0[pcie device id] set SRIOV_EN=0
mlx_tune -r
ifconfig [NIC] txqueuelen 20000
ethtool -G [NIC] rx 8192 tx 8192
ethtool -A [NIC] rx off tx off
mlxconfig -d [pcie address] set ZERO_TOUCH_TUNING_ENABLE=1
336 mlxconfig -d /dev/mst/mt4119_pciconf0[pcie address] set CQE_COMPRESSION=1\n
337 mlxconfig -d /dev/mst/mt4119_pciconf0[pcie address] s PCI_WR_ORDERING=1
338 reboot |
Testing between two servers. We are using 8 virtual function in each server but not utilizing all of them.
코드 블럭 |
---|
| Sender: /usr/local/bin/pktgen --huge-dir /dev/hugepages -l 1-10 -n 2 -- -P -m '[0:2-8].2-6' -T |
| 코드 블럭 |
---|
| Receiver: /usr/local/bin/pktgen --huge-dir /dev/hugepages -l 1-10 -n 2 -- -P -m '[2-5:6-10].0' -T -s 2:output.pcap |
| Image Removed
|
Image Removed
Image Added
코드 블럭 |
---|
Pktgen:/> set 2-6 src ip 10.10.11.0/24
Pktgen:/> set 2-6 dst ip 10.0.10.3
Pktgen:/> set 2-6 dst mac fe:63:23:fc:5e:36
Pktgen:/> set 2-6 size 512
Pktgen:/> start 2-6 |
| Image Added
|
Some helpful config in pkt-gen: https://stackoverflow.com/questions/73218563/dpdk-pktgen-how-to-change-rate-of-packet-transmission