Ubuntu 16.04 & Amazon Linux 2 install DPDK

Ubuntu 16.04

Ubuntu is VMware workstation virtual machine. 4G memory, 2 Cores.

Please add one or more network adapter for the virtual.

Open the virtual machine file(xxx.vmx), then replace this line for each interface(DPDK interface):

ethernet1.virtualDev = "e1000" -> ethernet1.virtualDev = "vmxnet3"

Because vmxnet3 supports Multiqueue and DPDK [1]
Run this command, if the output like this, that means interface support Multiqueue:

  root@sdn:/home/sdn# cat /proc/interrupts  | grep ens160
  56:         29        139   PCI-MSI 1572864-edge      ens160-rxtx-0
  57:         14         13   PCI-MSI 1572865-edge      ens160-rxtx-1
  58:          0          0   PCI-MSI 1572866-edge      ens160-event-2

Then shutdown the DPDK interface to allow DPDK to use them.


ifconfig ens160 down

Download DPDK from http://core.dpdk.org/download/

wget http://fast.dpdk.org/rel/dpdk-19.08.2.tar.xz
tar -xvf dpdk-19.08.2.tar.xz

Setup environment variable for DPDK

root@sdn:/home/sdn# cd dpdk-stable-19.08.2/
export RTE_SDK=/home/sdn/dpdk-stable-19.08.2/
export RTE_TARGET=x86_64-native-linux-gcc

Update OS and install library

apt update
apt install  libnuma-dev -y

Add UIO modules

modprobe uio

Enter the DPDK directory and run dpdk-setup.sh script

./usertools/dpdk-setup.sh

Do these things during the setup.

  • Set hugepages(For example 512)
  • Build the DPDK environment(For example x86_64-native-linux-gcc)
  • Insert IGB UIO module
  • Bind the interface with DPDK(make sure you already shutdown them before do it)

Run helloworld for test

cd /examples/helloworld
make
./build/helloworld

You should be able to see this kind of output.

****
hello from core 1
hello from core 0

Now DPDK has been installed to the Ubuntu.

Amazon Linux 2

For Amazon EC2, you need use Nitro-based instance because it supports ENA driver. DPDK support ENA. Just add one or more interface to the EC2 and shutdown them.
Other procedures remains the same.

[1] https://core.vmware.com/blog/virtual-networking-made-easy-vmware-vmxnet3-driver


发表评论

  • OωO
  • |´・ω・)ノ
  • ヾ(≧∇≦*)ゝ
  • (☆ω☆)
  • (╯‵□′)╯︵┴─┴
  •  ̄﹃ ̄
  • (/ω\)
  • ∠(ᐛ」∠)_
  • (๑•̀ㅁ•́ฅ)
  • →_→
  • ୧(๑•̀⌄•́๑)૭
  • ٩(ˊᗜˋ*)و
  • (ノ°ο°)ノ
  • (´இ皿இ`)
  • ⌇●﹏●⌇
  • (ฅ´ω`ฅ)
  • (╯°A°)╯︵○○○
  • φ( ̄∇ ̄o)
  • (งᵒ̌皿ᵒ̌)ง⁼³₌₃
  • (ó﹏ò。)
  • Σ(っ°Д°;)っ
  • ╮(╯▽╰)╭
  • o(*
  • >﹏<
  • (。•ˇ‸ˇ•。)
  • 泡泡
  • 颜文字

*