配置DPDK (初学者适用)
陈新 2016/4/29
1. dpdk-1.8.0 文件夹中找到tools文件夹, 其中找到 setup.sh, 进入特权模式下运行.
[root@localhost tools]# ./setup.sh 2. 应该输入9,选择x86_64-native-linuxapp-gcc进行编译
3. 载入IGB组件, 输入11.
4. 设置页大小, 输入14, 先设置位1024,即1024*2MB的页大小
5. 选择[22] List hugepage info from /proc/meminfo, 可以查看页大小,以及多少页是空闲的.
6. 查看当前网卡状态, 选择[16] Display current Ethernet device settings.
7. 绑定网卡
选择[17] Bind Ethernet device to IGB UIO module. 输入网卡前面的数字序号,即可绑定该网卡. 针对网卡绑定, 我绑定了所有非active状态的网卡归DPDK使用.
8. dpdk的配置都已经结束了,下面可以运行一下dpdk自带的示例程序,比如说testpmd: 选择[21] Run testpmd application in interactive mode ($RTE_TARGET/app/testpmd) 输入f, 回车: testpmd> start testpmd> stop
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 0 RX-dropped: 0 RX-total: 0 TX-packets: 0 TX-dropped: 0 TX-total: 0 ----------------------------------------------------------------------------
---------------------- Forward statistics for port 1 ----------------------
RX-packets: 0 RX-dropped: 0 RX-total: 0 TX-packets: 0 TX-dropped: 0 TX-total: 0 ----------------------------------------------------------------------------
---------------------- Forward statistics for port 2 ----------------------
RX-packets: 0 RX-dropped: 0 RX-total: 0 TX-packets: 0 TX-dropped: 0 TX-total: 0 ----------------------------------------------------------------------------
---------------------- Forward statistics for port 3 ----------------------
RX-packets: 0 RX-dropped: 0 RX-total: 0 TX-packets: 0 TX-dropped: 0 TX-total: 0 ----------------------------------------------------------------------------
---------------------- Forward statistics for port 4 ----------------------
RX-packets: 0 RX-dropped: 0 RX-total: 0 TX-packets: 0 TX-dropped: 14328 TX-total: 14328 ----------------------------------------------------------------------------
---------------------- Forward statistics for port 5 ----------------------
RX-packets: 14695 RX-dropped: 0 RX-total: 14695 RX-badcrc: 0 RX-badlen: 0 RX-error: 27336 RX-nombufs: 0
TX-packets: 0 TX-dropped: 0 TX-total: 0 ----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++ RX-packets: 14695 RX-dropped: 0 RX-total: 14695 TX-packets: 0 TX-dropped: 14328 TX-total: 14328
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
输入quit 可以退出. 最后就是分析数据了.