버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.

목차


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

...

정보

Set the hugepage to 1G and number of page as per your requirements (just increase 'nr_hugepages' if the eval mem allocation failed). more details: https://haryachyy.wordpress.com/2019/04/17/learning-dpdk-huge-pages/

There are three ways to do it as follows.

코드 블럭
languagebash
themeEmacs
# 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)

...

Image Removed
코드 블럭
languagebash
Sender:  /usr/local/bin/pktgen --huge-dir /dev/hugepages -l 1-10 -n 2 -- -P -m '[0:2-8].2-6' -T
코드 블럭
languagebash
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 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