WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: DPDK on TC 14  (Read 1063 times)

Offline LotusDew

  • Newbie
  • *
  • Posts: 11
DPDK on TC 14
« on: September 09, 2023, 12:29:19 PM »
Hi Experts,

I want to use DPDK (www.dpdk.org) which enables userspace network stack for fast packet processing. I was able to compile the drivers but one of the requirement is to setup huge pages. I checked that the kernel configs has HUGEPAGES enabled by default.

In the documentation the following steps are mentioned to get the hugepages to work

  mkdir -p /dev/hugepages
  mountpoint -q /dev/hugepages || mount -t hugetlbfs nodev /dev/hugepages
  echo 64 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages

I was however not able to complete the last step as the directory "node" is missing in /sys/devices/system

Can someone guide me what is the equivalent way of setting the number of hugepages in TC ?

Offline LotusDew

  • Newbie
  • *
  • Posts: 11
Re: DPDK on TC 14
« Reply #1 on: September 10, 2023, 04:10:10 AM »
Okay I managed to make DPDK and Hugepages work in TC

DPDK is pretty straightforward - just follow the documentation

You will need to install python3.6 and the pip3 install pyelftools for DPDK to compile with meson and ninja (both also have to be installed along with other build tools)

Hugepages was a scratcher. I have just barely managed to make it work after trial and error so looking for guidance on what can be improved/avoided.

I initially thought that HUGEPAGEs is not compiled into the kernel but thats NOT true. Default kernel config comes with HUGEPAGES

First create a mountpoint where hugepages has to be located

I used /home/hugepages to avoid being overwritten by automatic fstab when I was experimenting

I have a hard install booting via UEFI bios
1. sudo mkdir -p /home/hugepages
2. sudo mountpoint -q /home/hugepages
3. Now hugepages has to be mounted on boot. So in /opt/bootlocal.sh (aka startup programs akin to Windows) add the line
sysctl -w vm.nr_hugepages=512
sudo mount -t hugetlbfs nodev /home/hugepage
4. filetool.sh -bFileHugePages:         0 kB

Then I rebooted and when I do cat /proc/meminfo

FilePmdMapped:         0 kB
HugePages_Total:     512
HugePages_Free:      512
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:         1048576 kB