Set up DPDK on On-Premises Worker Nodes
Focus
Focus
CN-Series

Set up DPDK on On-Premises Worker Nodes

Table of Contents

Set up DPDK on On-Premises Worker Nodes

Data Plane Development Kit (DPDK) provides a simple framework for fast packet processing in dataplane applications.
  1. Install the following dependencies:
    Run all commands on the worker node on which you would like to set up DPDK.
    • For CentOS:
      yum groupinstall 'Development Tools' -y yum install net-tools pciutils -y yum install git gcc make -y yum install numactl-devel -y yum install which -y yum install -y sudo libhugetlbfs-utils libpcap-devel kernel kernel-devel kernel-headers yum update -y yum install epel-release -y yum install python36 -y
    • For Ubuntu OS:
      sudo apt install build-essential sudo apt-get install libnuma-dev
  2. After installing the dependencies:
    • Download the DPDK tar file from https://fast.dpdk.org/rel/. See DPDK documentation for compilation steps.
      wget https://fast.dpdk.org/rel/dpdk-19.11.9.tar.xz
    • Untar the file.
      tar -xvf dpdk-19.11.9.tar.xz cd dpdk-stable-19.11.9
    • Compile the file. The compiled file will be in the
      x86_64-native-linuxapp-gcc
      subfolder
      make install T=x86_64-native-linuxapp-gcc
  3. Insert the compiled kernel module statistically or dynamically during runtime (modprobe/insmod). For more information, see kernel module.
    cd x86_64-native-linuxapp-gcc/kmod insmod igb_uio.ko insmod rte_kni.ko
    On Ubuntu, if you see the error—
    insmod: ERROR: could not insert module igb_uio.ko
    , insert
    uio
    module first.
    modprobe uio
  4. Use distribution specific ways to insert modules during boot. Alternatively, you can create a service that runs the modprobe/insmod commands every time the system boots.
    cp <service-file> to /etc/systemd/system sudo systemctl daemon-reload
  5. Activate and mount 2M hugepages of size 2048K.
    You can also activate hugepages using the service script in Step 4.
    echo 2048 > /sys/devices/system/node/node0/hugepages/hugepages-2048/nr_hugepages echo 4292967296 > /sys/fs/cgroup/hugetlb/kubepods.slice/hugetlb.2MB.limit_in_bytes mkdir /mnt/huge mount -t hugetlbfs nodev /mnt/huge
  6. Create a snapshot of the VM for future use.

Recommended For You