dpdk测试环境搭建(vmware下ubuntu环境参考上文汇总流程)

简介: dpdk测试环境搭建(vmware下ubuntu环境参考上文汇总流程)

参考上一篇文章,这里做回顾以及整理:

使用vmware虚拟机(16.04)+dpdk(dpdk-19.08.2.tar)进行测试

1:定义两个网络适配器,第一个定义为桥接模式(用来连接dpdk)第二个设置为net模式,用来连接xshell方便测试

增加处理器,增加内存(方便设置多队列网卡,设置大内存页)

2:配置使多个网卡有效,

修改配置文件后要重启网络服务的,才能生效:sudo service networking restart

3:修改配置文件使环境支持多队列(虚拟机配置文件中修改对应网卡)

一定要在虚拟机关机状态下修改,修改后启动查看

启动后查看多队列网卡(这里网卡没有改为传统的eth命名,重启后网卡的命名会变化,由ens33变成的ens160):

重新修改一下,使多个网卡都生效:

修改后多网卡:(参考第二步,重新修改/etc/network/interfaces文件)

多队列网卡:

4:配置一下大内存页 /etc/default/gru,修改后一定要执行update-grub,并重启环境生效

default_hugepages=1G hugepagesz=2M hugepages=1024 isolcpus=0-2

5:编译dpdk环境(./usertools/dpdk-setup.sh ),执行39(x86_64-native-linux-gcc),根据描述,生成特定环境的dpdk。

如果报错缺少numa.h 需要安装libnuma-dev

这里我用的39,生成64为的linux上的dpdk,生成一个x86_64-native-linux-gcc目录。

6:如果39执行成功,设置环境变量:

# export RTE_SDK=/home/hlp/dpdk/dpdk-stable-19.08.2
    # export RTE_TARGET=x86_64-native-linux-gcc

7:编译dpdk环境(./usertools/dpdk-setup.sh ),执行43 插入 IGB_UIO 模块, 选择网卡为 vmxnet3 会加载此模块

8:编译dpdk环境(./usertools/dpdk-setup.sh ),执行44 插入 IGB_UIO 模块, 选择网卡为 e1000 会加载此模块

9:编译dpdk环境(./usertools/dpdk-setup.sh ),选择 49 绑定 igb_uio 模块。

会失败,关闭要绑定的网卡,重新进行绑定: 例如这里我关闭了ens160多队列网卡: sudo ifconfig ens160 down

会有对应的网卡提示,输入要绑定的网卡的前面的id就好,这里我已经绑定过:

一定要关闭网卡后,执行49的网卡绑定动作,可以重新执行49查看执行成功。

10:测试dpdk环境(./usertools/dpdk-setup.sh )执行53,运行testpmd

Enter hex bitmask of cores to execute testpmd app on
Example: to execute app on cores 0 to 7, enter 0xff
#这里选择 7
bitmask: 7
Launching app
EAL: Detected 8 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: PCI device 0000:02:06.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 8086:100f net_e1000_em
EAL: PCI device 0000:03:00.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 15ad:7b0 net_vmxnet3
Interactive-mode selected
testpmd: create a new mbuf pool <mbuf_pool_socket_0>: n=163456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc
Warning! port-topology=paired and odd forward ports number, the last port will pair with itself.
Configuring Port 0 (socket 0)
Port 0: 00:0C:29:EE:2E:64
Checking link statuses...
Done
# 这里可以用命令进行相关操作 查看相关信息
testpmd> show port info 0
********************* Infos for port 0  *********************
MAC address: 00:0C:29:EE:2E:64
Device name: 0000:03:00.0
Driver name: net_vmxnet3
Connect to socket: 0
memory allocation on the socket: 0
Link status: up
Link speed: 10000 Mbps
Link duplex: full-duplex
MTU: 1500
Promiscuous mode: enabled
Allmulticast mode: disabled
Maximum number of MAC addresses: 1
Maximum number of MAC addresses of hash filtering: 0
VLAN offload: 
  strip off 
  filter off 
  qinq(extend) off 
Supported RSS offload flow types:
  ipv4
  ipv4-tcp
  ipv6
  ipv6-tcp
Minimum size of RX buffer: 1646
Maximum configurable length of RX packet: 16384
Current number of RX queues: 1
Max possible RX queues: 16
Max possible number of RXDs per queue: 4096
Min possible number of RXDs per queue: 128
RXDs number alignment: 1
Current number of TX queues: 1
Max possible TX queues: 8
Max possible number of TXDs per queue: 4096
Min possible number of TXDs per queue: 512
TXDs number alignment: 1
Max segment number per packet: 255
Max segment number per MTU/TSO: 16
#quit退出
testpmd> quit

11:执行测试代码 helloworld测试

直接去测试模块下可以用make进行编译。

root@hlp:/home/hlp/dpdk/dpdk-stable-19.08.2/examples/helloworld# ./build/helloworld -l 0-7 -n 8
EAL: Detected 8 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: PCI device 0000:02:06.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 8086:100f net_e1000_em
EAL: PCI device 0000:03:00.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 15ad:7b0 net_vmxnet3
hello from core 1
hello from core 2
hello from core 3
hello from core 4
hello from core 5
hello from core 6
hello from core 7
hello from core 0

12:还没搞懂的逻辑及测试

#kni测试
  ./build/kni -l 4-7 -n 4 -- -P -p 0x3 -m --config="(0, 4, 6),(1, 5, 7)"
#l3fwd测试
  ./build/l3fwd -l 4-7 -n 4 -- -p 0x3 --config="(0,0,4),(1,0,5)" --parse-ptype
#会报错 port 1 is not present on the board
目录
相关文章
|
19天前
|
Ubuntu 编译器 开发工具
在Ubuntu系统上搭建RISC-V交叉编译环境
以上步骤涵盖了在Ubuntu系统上搭建RISC-V交叉编译环境的主要过程。这一过程涉及了安装依赖、克隆源码、编译安装工具链以及设置环境变量等关键步骤。遵循这些步骤,可以在Ubuntu系统上搭建一个用于RISC-V开发的强大工具集。
105 22
|
14天前
|
Ubuntu 编译器 计算机视觉
Ubuntu 20.04环境下无法找到#include<opencv/cv.h>文件 - 解决方案。
希望这些信息能帮助你解决遇到的问题。
114 10
|
1月前
|
存储 网络协议 Linux
VMware vCenter Server 9.0.1.0 发布 - 集中管理 vSphere 环境
VMware vCenter Server 9.0.1.0 发布 - 集中管理 vSphere 环境
284 7
|
5月前
|
存储 人工智能 虚拟化
VMware vCenter Server 9.0 正式版发布下载 - 集中管理 vSphere 环境
VMware vCenter Server 9.0 正式版发布下载 - 集中管理 vSphere 环境
431 0
VMware vCenter Server 9.0 正式版发布下载 - 集中管理 vSphere 环境
|
2月前
|
存储 Ubuntu 自动驾驶
运行Udacity的MPC控制项目指南(project_10)在Ubuntu 18.04环境下
以上步骤应该能够帮助您成功设置并运行Udacity MPC控制项目,在此过程中您将学习如何应用模型预测控制理论去指导车辆沿着轨迹自主驾驶,在模拟环境下测试其效果。这个过程不但涵盖了理论知识也有实践操作,对于学习自动驾驶车辆控制系统非常有帮助。
101 15
|
3月前
|
缓存 Ubuntu Docker
Ubuntu环境下删除Docker镜像与容器、配置静态IP地址教程。
如果遇见问题或者想回滚改动, 可以重启系统.
217 16
|
2月前
|
消息中间件 人工智能 运维
Ubuntu环境下的 RabbitMQ 安装与配置详细教程
本文聚焦在Ubuntu下RabbitMQ安装与配置教程,旨在帮助读者快速构建稳定可用的消息队列服务。
|
4月前
|
Ubuntu 关系型数据库 MySQL
在Ubuntu上配置phpMyAdmin和WordPress环境的步骤
执行以上步骤后,你将成功配置Ubuntu系统上的phpMyAdmin和WordPress环境。需要注意的是,应该根据自己实际的环境如具体的Ubuntu版本、WordPress版本和个人的安全需求做适当调整。此配置指南假定你拥有一个干净的Ubuntu服务器环境,某些步骤比如MySQL的root密码已经设置好了。
116 14
|
4月前
|
移动开发 安全 API
VMware vCenter Server 8.0U3g 发布 - 集中管理 vSphere 环境
VMware vCenter Server 8.0U3g 发布 - 集中管理 vSphere 环境
252 0
VMware vCenter Server 8.0U3g 发布 - 集中管理 vSphere 环境
|
4月前
|
Ubuntu 网络协议 虚拟化
在VMware环境安装Ubuntu Server中遇到的无法安装问题
安装Ubuntu Server中遇到的无法安装问题解决思路

热门文章

最新文章