Data Plane Development Kit (DPDK): Getting Started

参考:dpdk getting started

系统:

Ubuntu 14.04

内核信息:

执行 uname -a

Linux chen-VirtualBox 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Using the Data Plane Development Kit

预准备

三种安装途径:

(1) wget www.dpdk.org/browse/dpdk/snapshot/dpdk-2.1.0.tar.gz

(2) sudo apt-get www.dpdk.org/browse/dpdk/snapshot/dpdk-2.1.0.tar.gz

(3) yum install www.dpdk.org/browse/dpdk/snapshot/dpdk-2.1.0.tar.gz

Ubuntu系统下选择(1) 或者 (2),等待五分钟安装完毕。

解压压缩包:

tar zxvf dpdk-2.1.0.tar.gz

进入目录:

cd dpdk-2.1.0

检查CPU设置 Check the CPU configurations.

cd tools
./cpu_layout.py

结果:
885822-20161021121217701-131159154.png

检查NIC配置 Check the NIC configurations.

./dpdk_nic_bind.py --status

结果:
885822-20161021121314826-1749173900.png

Set up the DPDK

setup.sh is a useful utility that guides you through the process of compiling DPDK and configuring your system. To run it you need to be the root, and from the tools directory simply type:

./setup.sh

运行脚本,出现如下选项:

------------------------------------------------------------------------------
RTE_SDK exported as /admin/software_installfiles/dpdk-2.1.0
------------------------------------------------------------------------------
----------------------------------------------------------
Step 1: Select the DPDK environment to build
----------------------------------------------------------
[1] i686-native-linuxapp-gcc
[2] i686-native-linuxapp-icc
[3] ppc_64-power8-linuxapp-gcc
[4] tile-tilegx-linuxapp-gcc
[5] x86_64-ivshmem-linuxapp-gcc
[6] x86_64-ivshmem-linuxapp-icc
[7] x86_64-native-bsdapp-clang
[8] x86_64-native-bsdapp-gcc
[9] x86_64-native-linuxapp-clang
[10] x86_64-native-linuxapp-gcc
[11] x86_64-native-linuxapp-icc
[12] x86_x32-native-linuxapp-gcc

----------------------------------------------------------
Step 2: Setup linuxapp environment
----------------------------------------------------------
[13] Insert IGB UIO module
[14] Insert VFIO module
[15] Insert KNI module
[16] Setup hugepage mappings for non-NUMA systems
[17] Setup hugepage mappings for NUMA systems
[18] Display current Ethernet device settings
[19] Bind Ethernet device to IGB UIO module
[20] Bind Ethernet device to VFIO module
[21] Setup VFIO permissions

----------------------------------------------------------
Step 3: Run test application for linuxapp environment
----------------------------------------------------------
[22] Run test application ($RTE_TARGET/app/test)
[23] Run testpmd application in interactive mode ($RTE_TARGET/app/testpmd)

----------------------------------------------------------
Step 4: Other tools
----------------------------------------------------------
[24] List hugepage info from /proc/meminfo
----------------------------------------------------------
Step 5: Uninstall and system cleanup
----------------------------------------------------------
[25] Uninstall all targets
[26] Unbind NICs from IGB UIO or VFIO driver
[27] Remove IGB UIO module
[28] Remove VFIO module
[29] Remove KNI module
[30] Remove hugepage mappings

[31] Exit Script

Option: 

你需要选择一个选项运行。

首先选择DPDK环境进行编译,一般选择Option 10.
结果:
885822-20161021121818373-1193289941.png

设置linux app环境,Option 13,加载最新的IGB UIO模型,并编译它的驱动。
结果:
885822-20161021122012279-1313339472.png

关于IGB UIO:IGB UIO is a DPDK kernel module which deals with PCI enumeration and handles links status interrupts in user mode, instead of being handled by the kernel.

接下来设置 Huge page mappings。需要根据在预准备阶段跑的命令./cpu_layout.py所显示的socket个数进行选择。
我的socket个数为0,选择 Option 16. 在教程内选择的是Option 17.

选择了 Option 16,在跳出来的选项中输入128.
885822-20161021122509810-358865107.png
注意:如果选择了Option 17,那么根据原教程需要输入两次128。

接下来查看当前的以太网设置,Option 18:
885822-20161021122719420-871500003.png

Option 19,从Linux kernel driver中解耦出网卡,再通过Option 13绑定到IGB UIO模型(视频教程中没有进行选项13的操作,这里根据视频教程来)。
Option 19:
885822-20161021123245013-1871721015.png
注意:Option 19,需要输入一个PCI的地址,这个地址需要在弹出的内容中找到有igb.uio的选项。
我这里只有一个选项,填的是00:03.0

再次查看以太网设置。
Option 18:
885822-20161021123634513-1442816319.png

使用Option 24测试下:
885822-20161021123744920-1038895095.png

Option 31 退出。

2016/10/21

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值