dpdk之路-环境部署
dpdk实验环境部署
1、实验环境说明
vmware workstatioin 12
centos 7.5.1804
dpdk-stable-18.11.1
2、实验步骤
(1)虚拟机安装
http://vault.centos.org/7.5.1804/isos/x86_64/从链接下载CentOS-7-x86_64-DVD-1804.iso,安装时需要准备3张虚拟网卡,一个为上网用,另外两个是仅主机模式用于dpdk使用。内存我选择分配3G,cpu 2核。
(2)
依赖下载:
yum install -y numactl-devel*x86_64 make gcc libpcap libpcap-devel 下载内核头文件:
wget http://vault.centos.org/7.5.1804/os/x86_64/Packages/kernel-devel-3.10.0-862.el7.x86_64.rpm 安装内核头文件:
rpm -ivh kernel-devel-3.10.0-862.el7.x86_64.rpm
内核头文件链接到内核模块中
ln -fs /usr/src/kernels/3.10.0-862.el7.x86_64/ /lib/modules/3.10.0-862.el7.x86_64/build/
(3)编译
make config T=x86_64-native-linuxapp-gcc
sed -ri 's,(PMD_PCAP=).*,\1y,' build/.config
make
(4)设置大页内存
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
mkdir /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
(5)加载驱动
modprobe uio_pci_generic
modprobe uio
modprobe vfio-pci
insmod build/kmod/igb_uio.ko
(6)查看网卡bind信息
usertools/dpdk-devbind.py --status
(7)绑定网卡
ifconfig ens34 down
ifconfig ens35 down ./usertools/dpdk-devbind.py --bind=igb_uio 02:02.0
./usertools/dpdk-devbind.py --bind=igb_uio 02:03.0
(8)查看绑定信息
ls /dev/uio* -l
(9)编译examples
make -C examples RTE_SDK=$(pwd) RTE_TARGET=build O=$(pwd)/build/examples
(10)运行helloworld程序
./build/examples/helloworld/build/helloworld
bug修正,
进入dpdk-stable-18.11.1/
vim kernel/linux/igb_uio/igb_uio.c
将pci_intx_mask_supported(dev)代码修改为如下的
pci_intx_mask_supported(dev)||true 修改后重新执行
make
modprobe uio_pci_generic
modprobe uio
modprobe vfio-pci
rmmod igb_uio.ko
insmod build/kmod/igb_uio.ko
usertools/dpdk-devbind.py --status
./usertools/dpdk-devbind.py --bind=igb_uio 02:02.0
./usertools/dpdk-devbind.py --bind=igb_uio 02:03.0
./build/examples/helloworld/build/helloworld
(11)testpmd测试程序
./build/app/testpmd -l 0-1 -n 2 -- -i
运行结果
[root@localhost dpdk-stable-18.11.1]# ./build/app/testpmd -l 0-1 -n 2 -- -i
EAL: Detected 2 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: PCI device 0000:02:01.0 on NUMA socket -1
EAL: Invalid NUMA socket, default to 0
EAL: probe driver: 8086:100f net_e1000_em
EAL: PCI device 0000:02:02.0 on NUMA socket -1
EAL: Invalid NUMA socket, default to 0
EAL: probe driver: 8086:100f net_e1000_em
EAL: PCI device 0000:02:03.0 on NUMA socket -1
EAL: Invalid NUMA socket, default to 0
EAL: probe driver: 8086:100f net_e1000_em
Interactive-mode selected
testpmd: create a new mbuf pool <mbuf_pool_socket_0>: n=155456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc
Configuring Port 0 (socket 0)
Port 0: 00:0C:29:D3:37:3B
Configuring Port 1 (socket 0)
Port 1: 00:0C:29:D3:37:45
Checking link statuses...
Done
testpmd> start //start后,等个10s,再执行stop
io packet forwarding - ports=2 - cores=1 - streams=2 - NUMA support enabled, MP allocation mode: native
Logical Core 1 (socket 0) forwards packets on 2 streams:
RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00 io packet forwarding packets/burst=32
nb forwarding cores=1 - nb forwarding ports=2
port 0: RX queue number: 1 Tx queue number: 1
Rx offloads=0x0 Tx offloads=0x0
RX queue: 0
RX desc=256 - RX free threshold=0
RX threshold registers: pthresh=0 hthresh=0 wthresh=0
RX Offloads=0x0
TX queue: 0
TX desc=256 - TX free threshold=0
TX threshold registers: pthresh=0 hthresh=0 wthresh=0
TX offloads=0x0 - TX RS bit threshold=0
port 1: RX queue number: 1 Tx queue number: 1
Rx offloads=0x0 Tx offloads=0x0
RX queue: 0
RX desc=256 - RX free threshold=0
RX threshold registers: pthresh=0 hthresh=0 wthresh=0
RX Offloads=0x0
TX queue: 0
TX desc=256 - TX free threshold=0
TX threshold registers: pthresh=0 hthresh=0 wthresh=0
TX offloads=0x0 - TX RS bit threshold=0
testpmd> stop
Telling cores to stop...
Waiting for lcores to finish... ---------------------- Forward statistics for port 0 ----------------------
RX-packets: 3087933 RX-dropped: 0 RX-total: 3087933
TX-packets: 3273024 TX-dropped: 0 TX-total: 3273024
---------------------------------------------------------------------------- ---------------------- Forward statistics for port 1 ----------------------
RX-packets: 3273028 RX-dropped: 0 RX-total: 3273028
TX-packets: 3087929 TX-dropped: 0 TX-total: 3087929
---------------------------------------------------------------------------- +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 6360961 RX-dropped: 0 RX-total: 6360961
TX-packets: 6360953 TX-dropped: 0 TX-total: 6360953
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Done.
testpmd> quit Stopping port 0...
Stopping ports...
Done Stopping port 1...
Stopping ports...
Done Shutting down port 0...
Closing ports...
Done Shutting down port 1...
Closing ports...
Done Bye...
dpdk之路-环境部署的更多相关文章
- 一个CentOS7的开发环境部署,包括防火墙|VPN|多IP多网关|HTTP代理服务器设置等
http://www.lenggirl.com/code/centos7.html layout: post title: "一个CentOS7的开发环境部署,包括防火墙|VPN|HTTP代 ...
- 企业Openvpn环境部署
企业Openvpn环境部署 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任 ...
- Vue2.0 生产环境部署
简要:继上次搭建vue环境后,开始着手vue的学习;为此向大家分享从开发环境部署到生产环境(线上)中遇到的问题和解决办法,希望能够跟各位VUE大神学习探索,如果有不对或者好的建议告知下:*~*! 一. ...
- Linux下FTP虚拟账号环境部署总结
vsftp的用户有三种类型:匿名用户.系统用户.虚拟用户.1)匿名登录:在登录FTP时使用默认的用户名,一般是ftp或anonymous.2)本地用户登录:使用系统用户登录,在/etc/passwd中 ...
- jmeter(1)——环境部署及安装
公司人事还有老大都找我谈了一下2019的目标和技能成长规划,所以整体想了一下,技能方面,自己今年准备从性能测试开始着手,也去咨询了一下大神,切入点最好是工具.性能测试是一门非常庞大的课程,最初级,最入 ...
- Vue 生产环境部署
简要:继上次搭建vue环境后,开始着手vue的学习;为此向大家分享从开发环境部署到生产环境(线上)中遇到的问题和解决办法,希望能够跟各位VUE大神学习探索,如果有不对或者好的建议告知下:*~*! 一. ...
- Web应用之LAMP源码环境部署
一.LAMP环境的介绍 1.LAMP环境的重要性 思索许久,最终还是决定写一篇详细的LAMP的源码编译安装的实验文档,一来是为了给自己一个交代,把技术进行系统的归纳,将技术以极致的形式呈现出来,做为一 ...
- Jmeter安装与环境部署
Jmeter安装与环境部署 版权声明:本文为博主原创文章,未经博主允许不得转载. 博主:海宁 联系:whnsspu@163.com
- 微信公众号开发系列教程一(调试环境部署续:vs远程调试)
http://www.cnblogs.com/zskbll/p/4080328.html 目录 C#微信公众号开发系列教程一(调试环境部署) C#微信公众号开发系列教程一(调试环境部署续:vs远程调试 ...
随机推荐
- 详细QRCode生成二维码和下载实现案例
using System; using System.Collections.Generic; using System.Linq; using System.Web; using ThoughtWo ...
- C# 获取当前服务器域名
"http://"是协议名 "www.test.com"是域名 "aaa"是站点名 "bbb.aspx"是页面名(文件名 ...
- C学习笔记(自增)
自增 (1)后缀:与Turbo C相同,在语句结束之前或者说分号之前才会执行自增. (2)前缀: 前两个自增统一取值,后面的自增即为取值. int i=2,j; j=++i+(++i)+(++i); ...
- asp.net的Request.ServerVariables参数说明
Request.ServerVariables["SERVER_NAME"] '获取服务器IPRequest.ServerVariables["HTTP_REFERER& ...
- java的环境变量配置失败(java.exe、javaw.exe、javaws.exe优先级问题冲突)
前言:首先安装了intelliJ Idea 其次安装了JDK 1.8 配置完三个系统变量后,java和javac执行不通过 配置过程 1.我的电脑(右键)--->属性---->高级---& ...
- IDEA Can't Update No tracked branch configured for branch master or the branch doesn't exist.
IDEA Can't Update No tracked branch configured for branch master or the branch doesn't exist.To make ...
- shell编程企业级实战
如何才能学好Shell编程 为什么要学习shell编程 Shell是Linux底层核心 Linux运维工作常用工具 自动化运维必备基础课程 学好shell编程所需Linux基础 熟练使用vim编辑器 ...
- 逆卷积的详细解释ConvTranspose2d(fractionally-strided convolutions)
1.首先先定义进行卷积的参数: 输入特征图为高宽一样的Hin*Hin大小的x 卷积核大小kernel_size 步长stride padding填充数(填充0) 输出特征图为Hout*Hout大小的y ...
- Vue的基础使用
渐进式的前端框架 vue react augular 作者: 尤雨溪 facebook 谷歌公司 前端框架和库的区别 功能上的不同: jquery库:包含DOM(操作DOM)+请求,就是一块功能. a ...
- 开发中,IDEA常用的快捷键
Settings文件: Ctrl+Alt+S 搜索文件:Ctrl+Shift+N 全文搜索: Ctrl+Shift+F 全文替换: Ctrl+Shift+R 搜索内容: Ctrl+F 内容替换: Ct ...