dpdk安装及示例程序使用指南(虚拟机版)
dpdk工作原理

dpdk工作原理DPDK(Data Plane Development Kit)是一个用于数据包处理的开源工具集。
它的设计目标是提供一个高效灵活的网络数据包处理框架,以加速数据包处理应用程序的性能。
DPDK的工作原理可以概括为以下几个关键步骤:1. 初始化:应用程序通过调用DPDK提供的初始化函数来初始化环境。
这包括创建内存池、设置物理地址转换、配置核间通信等。
2. 配置:应用程序将网络设备绑定到DPDK的驱动程序上,以便DPDK可以直接访问网络设备的物理资源。
此外,还需要配置网络设备和队列的属性,如队列大小、数目、RSS配置等。
3. 启动:应用程序启动DPDK的运行时环境,并绑定每个逻辑核心到指定的物理核心。
这样可以确保数据包处理在指定的核心上执行,避免了多核心之间的上下文切换开销。
4. 接收:DPDK使用轮询模式或中断模式从网络设备接收数据包。
在轮询模式下,每个逻辑核心定期检查网络设备的接收队列,将接收到的数据包复制到应用程序的缓冲区。
在中断模式下,网络设备将接收到的数据包触发中断,逻辑核心在中断处理程序中将数据包复制到缓冲区。
5. 数据包处理:应用程序通过DPDK提供的数据包处理函数对接收到的数据包进行处理。
这包括解析数据包头部、查找路由表、执行策略等操作。
6. 发送:应用程序通过调用DPDK的数据包发送函数将处理后的数据包发送回网络设备。
DPDK会将数据包复制到发送队列,并通知网络设备发送数据包。
7. 结束:在应用程序完成数据包处理后,可以调用DPDK提供的清理函数来关闭网络设备、释放资源等。
这样可以确保环境的恢复和系统的稳定。
DPDK的工作原理基于用户空间的数据包处理模式,通过绕过操作系统内核,直接访问网络设备和物理资源,从而避免了操作系统内核的开销和限制。
这使得DPDK能够实现高效的数据包处理,提升网络应用程序的性能。
openstack ovs-dpdk原理

openstack ovs-dpdk原理OpenStack OVS-DPDK原理OpenStack是目前最流行的开源云计算管理平台之一,它提供了云计算中常见的计算、网络、存储等服务,可以帮助用户快速搭建自己的云计算环境。
而Open Virtual Switch (OVS)是OpenStack中常用的网络虚拟化技术,可以为VM (虚拟机)提供灵活的网络服务,同时保证了数据的安全性和可靠性。
而DPDK (Data Plane Development Kit)是Intel提供的一款数据平面开发工具包,可以帮助开发者实现高性能数据处理的应用程序。
本文主要介绍OpenStack OVS-DPDK原理,包括OVS和DPDK的概念、OVS-DPDK的架构、OVS-DPDK的工作原理以及如何配置使用OVS-DPDK等方面。
1. OVS和DPDK概念1.1 OVSOpen vSwitch(OVS)是一款开源的虚拟交换机,可以在虚拟机之间提供流量控制、QoS、负载均衡等网络功能。
OVS是使用C语言编写的,支持多种协议,例如VXLAN、GRE、STT、IPsec等。
OVS以插件的方式与OpenStack集成,并且可以与其他虚拟化软件和硬件配合使用,例如QEMU、XEN、DPDK等。
1.2 DPDKData Plane Development Kit(DPDK)是一个数据平面开发工具包,可以帮助开发者实现高性能数据处理的应用程序。
DPDK运行在x86、ARM和Power8等平台上,使用用户空间设备驱动程序(User Space Device Driver)和高效率的队列管理,可以在不使用内核网络协议栈的情况下,实现高速数据包的收发和处理。
2. OVS-DPDK架构OVS-DPDK是将OVS和DPDK结合起来实现的一种高性能的数据平面虚拟化技术。
OVS-DPDK的架构如图1所示:图1 OVS-DPDK架构从图1中可以看出,OVS-DPDK的架构由三部分组成,分别是:1. 用户态进程(OVS-DPDK)。
NVIDIA DOCA DPDK MLNX-15-060464 编程指南说明书

Programming GuideTable of Contents Chapter 1. Reference (1)Chapter 1.ReferencePlease refer to DPDK's official programmer's guide for programming guidance as well as relevant BlueField platform and DPDK driver information.NoticeThis document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation nor any of its direct or indirect subsidiaries and affiliates (collectively: “NVIDIA”) make no representations or warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assume no responsibility for any errors contained herein. NVIDIA shall have no liability for the consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material (defined below), code, or functionality.NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice. Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete.NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this document. No contractual obligations are formed either directly or indirectly by this document.NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can reasonably be expected to result in personal injury, death, or property or environmental damage. NVIDIA accepts no liability for inclusion and/or use of NVIDIA products in such equipment or applications and therefore such inclusion and/or use is at customer’s own risk. NVIDIA makes no representation or warranty that products based on this document will be suitable for any specified use. Testing of all parameters of each product is not necessarily performed by NVIDIA. It is customer’s sole responsibility to evaluate and determine the applicability of any information contained in this document, ensure the product is suitable and fit for the application planned by customer, and perform the necessary testing for the application in order to avoid a default of the application or the product. Weaknesses in customer’s product designs may affect the quality and reliability of the NVIDIA product and may result in additional or different conditions and/or requirements beyond those contained in this document. NVIDIA accepts no liability related to any default, damage, costs, or problem which may be based on or attributable to: (i) the use of the NVIDIA product in any manner that is contrary to this document or (ii) customer product designs.No license, either expressed or implied, is granted under any NVIDIA patent right, copyright, or other NVIDIA intellectual property right under this document. Information published by NVIDIA regarding third-party products or services does not constitute a license from NVIDIA to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property rights of the third party, or a license from NVIDIA under the patents or other intellectual property rights of NVIDIA.Reproduction of information in this document is permissible only if approved in advance by NVIDIA in writing, reproduced without alteration and in full compliance with all applicable export laws and regulations, and accompanied by all associated conditions, limitations, and notices.THIS DOCUMENT AND ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL NVIDIA BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Notwithstanding any damages that customer might incur for any reason whatsoever, NVIDIA’s aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms of Sale for the product.TrademarksNVIDIA, the NVIDIA logo, and Mellanox are trademarks and/or registered trademarks of Mellanox Technologies Ltd. and/or NVIDIA Corporation in the U.S. and in other countries. Other company and product names may be trademarks of the respective companies with which they are associated.Copyright© 2021 NVIDIA Corporation & affiliates. All rights reserved.NVIDIA Corporation | 2788 San Tomas Expressway, Santa Clara, CA 95051。
dpdk安装及示例程序使用指南(虚拟机版)

DPDK安装及示例程序使用指南(适用于虚拟机)--torronto 2016.1.27 关于dpdk的介绍不用多说,主要就是它是intel开发的一个网络数据包查找转发的套件,用以分析网络数据的,所以只支持intel的网卡以及极少数除intel之外的网卡,具体支持的型号,官网有说明。
因此,大多数时候,我们都是用虚拟机来仿真。
1.在虚拟机中的ubuntu系统上手动设置2个网卡(一共3个),就使用默认的桥接模式,然后修改处理器个数为2个处理器,每个处理器2核心。
内存分配,1GB以上,2GB更好。
2.去官网下载dpdk软件包,http://www.dpdk.eu/download3.将软件包解压在主目录下,根据个人喜好,因为后面编译和使用示例每次都要访问的。
4.从终端进入5.tools文件夹中有一个setup.sh方便新手完成dpdk的设置初始化操作:(当然,配置编译之前先进入特权模式)6.我们可以看到setup.sh里的一些选项如下:------------------------------------------------------------------------------RTE_SDK exported as /home/torronto/dpdk-2.2.0----------------------------------------------------------------------------------------------------------------------------------------Step 1: Select the DPDK environment to build----------------------------------------------------------[1] arm64-armv8a-linuxapp-gcc[2] arm64-thunderx-linuxapp-gcc[3] arm64-xgene1-linuxapp-gcc[4] arm-armv7a-linuxapp-gcc[5] i686-native-linuxapp-gcc[6] i686-native-linuxapp-icc[7] ppc_64-power8-linuxapp-gcc[8] tile-tilegx-linuxapp-gcc[9] x86_64-ivshmem-linuxapp-gcc[10] x86_64-ivshmem-linuxapp-icc[11] x86_64-native-bsdapp-clang[12] x86_64-native-bsdapp-gcc[13] x86_64-native-linuxapp-clang[14] x86_64-native-linuxapp-gcc[15] x86_64-native-linuxapp-icc[16] x86_x32-native-linuxapp-gcc----------------------------------------------------------Step 2: Setup linuxapp environment----------------------------------------------------------[17] Insert IGB UIO module[18] Insert VFIO module[19] Insert KNI module[20] Setup hugepage mappings for non-NUMA systems[21] Setup hugepage mappings for NUMA systems[22] Display current Ethernet device settings[23] Bind Ethernet device to IGB UIO module[24] Bind Ethernet device to VFIO module[25] Setup VFIO permissions----------------------------------------------------------Step 3: Run test application for linuxapp environment----------------------------------------------------------[26] Run test application ($RTE_TARGET/app/test)[27] Run testpmd application in interactive mode ($RTE_TARGET/app/testpmd)----------------------------------------------------------Step 4: Other tools----------------------------------------------------------[28] List hugepage info from /proc/meminfo----------------------------------------------------------Step 5: Uninstall and system cleanup----------------------------------------------------------[29] Unbind NICs from IGB UIO or VFIO driver[30] Remove IGB UIO module[31] Remove VFIO module[32] Remove KNI module[33] Remove hugepage mappings[34] Exit ScriptOption:7.先进行配置,我的系统是ubuntu12.04,64位,所以应该输入14,选择x86_64-native-linuxapp-gcc进行编译,如果是32位系统则是x86_x32-native-linuxapp-gcc,或者是i686-native-linuxapp-gcc,因为i386、i686都是32位的,平台选错了会导致后面编译不成功。
dpdk test编译

dpdk test编译DPDK(Data Plane Development Kit)是一个开源的数据包处理框架,用于高效处理网络数据包。
下面是编译DPDK test的步骤:1. 首先,下载DPDK的最新版本。
你可以从DPDK的官方网站下载源代码压缩包。
2. 解压缩源代码压缩包到一个合适的目录。
可以使用以下命令进行解压缩:```tar -xf dpdk-x.x.x.tar.gz```这里的x.x.x是DPDK的版本号。
3. 进入解压缩后的源代码目录:```cd dpdk-x.x.x```4. 设置编译环境变量。
可以使用以下命令设置环境变量:```export RTE_SDK=$(pwd)```这里的`$(pwd)`表示当前所在的目录。
5. 定义目标架构。
DPDK支持多种不同的架构,如x86、ARM等。
根据你的需求,执行以下命令定义目标架构:```export RTE_TARGET=xx-xx-xx```这里的`xx-xx-xx`表示目标架构的标识,例如x86_64-native-linuxapp-gcc。
6. 配置编译选项。
执行以下命令进入配置界面:```make config```然后根据提示选择所需的选项。
你可以根据需求启用或禁用不同的功能。
7. 编译DPDK test。
执行以下命令开始编译:```make```编译过程可能需要一些时间,取决于你的系统配置和编译选项。
8. 编译完成后,你可以在`x86_64-native-linuxapp-gcc/app/test`目录中找到生成的可执行文件。
完成上述步骤后,你已成功编译DPDK test。
现在你可以在你的系统上运行测试,并进行网络数据包处理的相关开发工作。
希望以上步骤对你有所帮助。
中国电信DPDK技术白皮书v1.0

dpdk+ovs安装和编译(一)

dpdk+ovs安装和编译(⼀)绑定前⽹卡驱动[root@localhost ~]# ethtool -i enp5s0driver: hinicversion:firmware-version:expansion-rom-version:bus-info: 0000:05:00.0supports-statistics: nosupports-test: nosupports-eeprom-access: nosupports-register-dump: nosupports-priv-flags: no[root@localhost ~]#安装ovs遇到⼀个问题那就是ovs version和dpdk version不匹配,华为鲲鹏920上安装的dpdk是dpdk-19.11ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev[root@localhost ~]# ovs-vsctl add-port br0 dpdk1 -- set Interface dpdk1 type=dpdk options:dpdk-devargs=0000:05:00.0ovs-vsctl: Error detected while setting up 'dpdk1': could not open network device dpdk1 (Address family not supported by protocol). See ovs-vswitchd log for details. ovs-vsctl: The default log directory is "/var/log/openvswitch".[root@localhost ~]# ovs-vsctl showbb6aa323-f96b-4872-98f8-7aa87fc99958Bridge "br0"datapath_type: netdevPort "dpdk1"Interface "dpdk1"type: dpdkoptions: {dpdk-devargs="0000:05:00.0"}error: "could not open network device dpdk1 (Address family not supported by protocol)"Port "br0"Interface "br0"type: internal[root@localhost ~]#查看⽹卡与dpdk绑定状态[root@localhost dpdk-19.11]# ./usertools/dpdk-devbind.py --statusNetwork devices using DPDK-compatible driver============================================0000:05:00.0'Hi1822 Family (2*25GE) 0200' drv=vfio-pci unused=hinic0000:06:00.0'Hi1822 Family (2*25GE) 0200' drv=vfio-pci unused=hinicNetwork devices using kernel driver===================================0000:7d:00.0'HNS GE/10GE/25GE RDMA Network Controller a222'if=enp125s0f0 drv=hns3 unused=hns_roce_hw_v2,vfio-pci *Active*0000:7d:00.1'HNS GE/10GE/25GE Network Controller a221'if=enp125s0f1 drv=hns3 unused=vfio-pci0000:7d:00.2'HNS GE/10GE/25GE RDMA Network Controller a222'if=enp125s0f2 drv=hns3 unused=hns_roce_hw_v2,vfio-pci0000:7d:00.3'HNS GE/10GE/25GE Network Controller a221'if=enp125s0f3 drv=hns3 unused=vfio-pciNo 'Baseband' devices detected==============================No 'Crypto' devices detected============================No 'Eventdev' devices detected==============================No 'Mempool' devices detected=============================No 'Compress' devices detected==============================No 'Misc (rawdev)' devices detected===================================[root@localhost dpdk-19.11]#编译dpdk修改配置⽂件config/common_linuxapp,这⾥我们测试vhost模式,所以需要把下⾯两个配置项,配置为yes。
VMware Workstation Player for Linux 16.0 用户指南说明书

使用适用于 Linux 的 VMware Workstation PlayerVMware Workstation Player for Linux 16.0您可以从 VMware 网站下载最新的技术文档:https:///cn/。
VMware, Inc.3401 Hillview Ave. Palo Alto, CA 94304 威睿信息技术(中国)有限公司北京办公室北京市朝阳区新源南路 8 号启皓北京东塔 8 层 801/cn上海办公室上海市淮海中路 333 号瑞安大厦 804-809 室/cn广州办公室广州市天河路 385 号太古汇一座 3502 室/cn版权所有© 2020 VMware, Inc. 保留所有权利。
版权和商标信息使用适用于 Linux 的 VMware Workstation Player目录使用 VMware Workstation Player for Linux91简介和系统要求10Workstation Player 的主机系统要求10主机系统的处理器要求10支持的主机操作系统11主机系统的内存要求11主机系统的显示要求11主机系统的磁盘驱动器要求12主机系统的局域网络连接要求12虚拟机的功能与规范13支持的客户机操作系统13虚拟机处理器支持13虚拟机内存分配13兼容的虚拟机132安装和使用 Workstation Player14在 Linux 主机上安装 Workstation Player 14Linux 命令行安装选项15启动 Workstation Player16使用 Workstation Player 窗口16传输文件和文本17使用拖放功能17使用复制与粘贴功能18在 Workstation Player 中下载虚拟设备19从 Workstation Player 的库中移除虚拟机19卸载 Workstation Player193更改 Workstation Player 首选项设置20配置关闭行为首选项设置20配置软件更新设置21为代理服务器配置连接设置21了解自动软件更新过程21加入或退出客户体验改进计划22配置 Workstation Player 颜色主题设置224在 Workstation Player 中创建虚拟机24了解虚拟机24准备创建虚拟机24选择客户机操作系统25指定虚拟机名称和文件位置26为虚拟机指定磁盘容量27创建虚拟机28使用简易安装来安装客户机操作系统29手动安装客户机操作系统30导入虚拟机31导入开放虚拟化格式虚拟机31导入 VMware vCenter Server Appliance325安装和升级 VMware Tools33安装 VMware Tools33升级 VMware Tools 34配置软件更新首选项35为特定虚拟机配置 VMware Tools 更新36手动安装和升级 VMware Tools36在 Windows 虚拟机中手动安装 VMware Tools36在 Linux 虚拟机中手动安装 VMware Tools37在 NetWare 虚拟机中手动安装 VMware Tools 40在 Solaris 虚拟机中手动安装 VMware Tools40在 FreeBSD 虚拟机中手动安装 VMware Tools41不使用会话管理器时手动启动 VMware 用户进程43卸载 VMware Tools436在 Workstation Player 中启动和停止虚拟机45在 Workstation Player 中启动虚拟机45在 Workstation Player 中启动加密的虚拟机46在 Workstation Player 中下载虚拟设备46在 Workstation Player 中关闭虚拟机46从 Workstation Player 的库中移除虚拟机47使用 Ctrl+Alt+Delete 关闭客户机47在 Workstation Player 中挂起和恢复虚拟机47在 Workstation Player 中复位虚拟机48在 Windows 虚拟机中启用自动登录48设置 Workstation Player 的虚拟机关闭行为首选项497更改虚拟机显示50为虚拟机配置显示设置50在 Workstation Player 中使用全屏模式51在客户机中报告电池信息52为一个虚拟机使用多个监视器52多监视器的限制538在虚拟机中使用可移动设备和打印机54在虚拟机中使用可移动设备54将 USB 设备连接到虚拟机55禁用 USB 设备的自动连接55将 USB HID 连接到虚拟机55安装 PDA 驱动程序并与虚拟机同步56排除 USB 设备控制共享问题56允许虚拟机打印到主机打印机57将虚拟打印机添加到虚拟机57安装 VMware 虚拟打印机58卸载 VMware 虚拟打印机59在虚拟机中使用智能卡60在虚拟机中使用智能卡61禁用智能卡共享62在 Linux 主机上切换到虚拟智能卡读卡器629为虚拟机设置共享文件夹63使用共享文件夹63支持共享文件夹的客户机操作系统64使用权限限制对 Linux 客户机中共享文件的访问权限64为虚拟机启用共享文件夹65在 Windows 客户机中查看共享文件夹66在 Linux 客户机中装载共享文件夹66更改共享文件夹属性67更改虚拟机能够共享的文件夹68为虚拟机禁用文件夹共享68将虚拟磁盘映射到主机系统69将虚拟磁盘映射或装载到主机系统上的驱动器69从主机系统断开虚拟磁盘6910配置和管理虚拟机71更改虚拟机名称71更改虚拟机的客户机操作系统72更改虚拟机的工作目录72更改虚拟机的虚拟机目录73更改虚拟机的内存分配73配置视频和声音74设置屏幕色深74使用 3D 图形加速75配置声音76移动虚拟机77将虚拟机移到新位置或新主机77配置虚拟机兼容性78使用虚拟机 UUID79将虚拟机配置为 VNC 服务器79为 VNC 客户端指定某种语言的键盘映射80使用 VNC 客户端连接到虚拟机82查看虚拟机的 VNC 连接82删除虚拟机83查看虚拟机的消息日志83在虚拟机中安装新软件83在程序无法运行时禁用加速8411配置和管理设备85配置 DVD、CD-ROM 和软盘驱动器85将 DVD 或 CD-ROM 驱动器添加到虚拟机85将软盘驱动器添加到虚拟机86为 DVD 或 CD-ROM 驱动器配置旧版仿真模式87配置 USB 控制器87将 USB 控制器添加到虚拟机88启用同步 USB 设备支持88配置和维护虚拟硬盘89配置虚拟硬盘90压缩虚拟硬盘92扩展虚拟硬盘92整理虚拟硬盘碎片93从虚拟机中移除虚拟硬盘94使用锁定文件防止虚拟硬盘上的一致性问题94将虚拟硬盘移动到新位置94配置虚拟端口95将虚拟并行端口添加到虚拟机95在 Linux 2.6.x 内核主机上配置虚拟并行端口96在 Linux 主机上为并行端口设备配置权限97对并行端口的 ECR 错误进行故障排除97将虚拟串行端口添加到虚拟机98更改串行连接的输入速度99配置通用 SCSI 设备99将通用 SCSI 设备添加到虚拟机100在 Linux 主机上避免 SCSI 设备的并行访问问题100对检测通用 SCSI 设备时遇到的问题进行故障排除101配置十六路虚拟对称多处理102配置十六路虚拟对称多处理102使用具有十六个以上虚拟处理器的虚拟机102配置键盘功能103在按键组合中使用 Ctrl+Alt103配置远程 X 服务器的键盘映射104更改特定按键的映射方式105配置键盘符号的映射方式105V-Scan 代码表107修改虚拟机的硬件设置11012配置网络连接111了解虚拟网络连接组件111了解常见网络连接配置112配置桥接模式网络连接113在桥接模式网络连接环境中分配 IP 地址114为现有虚拟机配置桥接模式网络连接114配置网络地址转换114配置仅主机模式网络连接115为现有虚拟机配置仅主机模式网络连接116更改网络连接配置116查找虚拟机的网络类型116将虚拟网络适配器添加到虚拟机117修改虚拟机的现有虚拟网络适配器117启用巨型帧118在 Linux 主机上启用巨型帧11813配置虚拟机选项设置119为虚拟机配置常规选项设置119更改虚拟机名称120更改客户机操作系统120更改虚拟机工作目录120为虚拟机配置电源选项120为虚拟机配置 VMware Tools 选项121为虚拟机配置自动登录12114配置虚拟机硬件设置123将硬件添加到虚拟机124从虚拟机中移除硬件125调整虚拟机内存125配置虚拟机处理器设置126配置和维护虚拟硬盘126对虚拟硬盘进行碎片整理127扩展虚拟硬盘127压缩虚拟硬盘128将虚拟磁盘映射到主机系统128更改虚拟硬盘节点和模式设置129配置 CD-ROM 和 DVD 驱动器设置129配置 CD-ROM 和 DVD 驱动器状态和连接设置130更改虚拟设备节点和旧版模拟设置130配置软盘驱动器设置130配置虚拟网络适配器设置131配置虚拟网络适配器设备状态设置131配置桥接模式网络连接132配置网络地址转换132配置仅主机模式网络连接133配置 LAN 区段133配置虚拟网络适配器高级设置133配置 USB 控制器设置134配置声卡设置135配置并行端口设置135配置串行端口设置135配置通用 SCSI 设备设置136配置打印机设置136配置显示设置137在物理磁盘或未使用的分区上安装客户机操作系统13715使用 VMware Workstation Player REST API139使用 VMware Workstation Player REST API139使用 VMware Workstation Player for Linux《使用 VMware Workstation Player for Linux》介绍了如何使用 VMware Workstation Player™创建、配置和管理 Linux 主机上的虚拟机。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
DPDK安装及示例程序使用指南(适用于虚拟机)--torronto 2016.1.27 关于dpdk的介绍不用多说,主要就是它是intel开发的一个网络数据包查找转发的套件,用以分析网络数据的,所以只支持intel的网卡以及极少数除intel之外的网卡,具体支持的型号,官网有说明。
因此,大多数时候,我们都是用虚拟机来仿真。
1.在虚拟机中的ubuntu系统上手动设置2个网卡(一共3个),就使用默认的桥接模式,然后修改处理器个数为2个处理器,每个处理器2核心。
内存分配,1GB以上,2GB更好。
2.去官网下载dpdk软件包,http://www.dpdk.eu/download3.将软件包解压在主目录下,根据个人喜好,因为后面编译和使用示例每次都要访问的。
4.从终端进入5.tools文件夹中有一个setup.sh方便新手完成dpdk的设置初始化操作:(当然,配置编译之前先进入特权模式)6.我们可以看到setup.sh里的一些选项如下:------------------------------------------------------------------------------RTE_SDK exported as /home/torronto/dpdk-2.2.0----------------------------------------------------------------------------------------------------------------------------------------Step 1: Select the DPDK environment to build----------------------------------------------------------[1] arm64-armv8a-linuxapp-gcc[2] arm64-thunderx-linuxapp-gcc[3] arm64-xgene1-linuxapp-gcc[4] arm-armv7a-linuxapp-gcc[5] i686-native-linuxapp-gcc[6] i686-native-linuxapp-icc[7] ppc_64-power8-linuxapp-gcc[8] tile-tilegx-linuxapp-gcc[9] x86_64-ivshmem-linuxapp-gcc[10] x86_64-ivshmem-linuxapp-icc[11] x86_64-native-bsdapp-clang[12] x86_64-native-bsdapp-gcc[13] x86_64-native-linuxapp-clang[14] x86_64-native-linuxapp-gcc[15] x86_64-native-linuxapp-icc[16] x86_x32-native-linuxapp-gcc----------------------------------------------------------Step 2: Setup linuxapp environment----------------------------------------------------------[17] Insert IGB UIO module[18] Insert VFIO module[19] Insert KNI module[20] Setup hugepage mappings for non-NUMA systems[21] Setup hugepage mappings for NUMA systems[22] Display current Ethernet device settings[23] Bind Ethernet device to IGB UIO module[24] Bind Ethernet device to VFIO module[25] Setup VFIO permissions----------------------------------------------------------Step 3: Run test application for linuxapp environment----------------------------------------------------------[26] Run test application ($RTE_TARGET/app/test)[27] Run testpmd application in interactive mode ($RTE_TARGET/app/testpmd)----------------------------------------------------------Step 4: Other tools----------------------------------------------------------[28] List hugepage info from /proc/meminfo----------------------------------------------------------Step 5: Uninstall and system cleanup----------------------------------------------------------[29] Unbind NICs from IGB UIO or VFIO driver[30] Remove IGB UIO module[31] Remove VFIO module[32] Remove KNI module[33] Remove hugepage mappings[34] Exit ScriptOption:7.先进行配置,我的系统是ubuntu12.04,64位,所以应该输入14,选择x86_64-native-linuxapp-gcc进行编译,如果是32位系统则是x86_x32-native-linuxapp-gcc,或者是i686-native-linuxapp-gcc,因为i386、i686都是32位的,平台选错了会导致后面编译不成功。
编译界面如下,有点长。
如果编译有错,往往是软件包依赖关系不满足,安装相应的软件包,对于ubuntu15.10出的错可能和内核有关,所以建议使用的linux3.x内核的。
8.编译完成后,载入IGB组件9.设置页大小先设置位128,即128*2MB的页大小10.选择[28] List hugepage info from /proc/meminfo可以查看页大小,以及多少页是空闲的11.查看当前网卡状态通过上图,我们看出有三块网卡,都是intel e1000型号的,下面两块网卡是我们后来手动添加的,然而都是active的状态,要将他们作为dpdk的网卡,就必须要先关掉另开一个终端:再次查看,网卡状态,可以进行网卡绑定了:12.绑定网卡选择[23] Bind Ethernet device to IGB UIO module输入网卡前面的数字序号,即可绑定该网卡,这里我们有两个需要绑定,eth1和eth2,它们的序号分别是0000:02:06.0和0000:02:07.0绑定完再次查看网卡状态,我们可以看见两个网卡都已经是用于dpdk了:13.到这一步dpdk的配置都已经结束了,下面可以运行一下dpdk自带的示例程序,比如说testpmd:选择[27] Run testpmd application in interactive mode ($RTE_TARGET/app/testpmd)然后会出现testpmd>的显示如下,即显示了start到stop之间发送接受的包数量Port 0 Link Up - speed 1000 Mbps - full-duplexPort 1 Link Up - speed 1000 Mbps - full-duplexDonetestpmd> startio packet forwarding - CRC stripping disabled - packets/burst=32nb forwarding cores=1 - nb forwarding ports=2RX queues=1 - RX desc=128 - RX free threshold=0RX threshold registers: pthresh=0 hthresh=0 wthresh=0TX queues=1 - TX desc=512 - TX free threshold=0TX threshold registers: pthresh=0 hthresh=0 wthresh=0TX RS bit threshold=0 - TXQ flags=0x0testpmd>testpmd> stopTelling cores to stop...Waiting for lcores to finish...---------------------- Forward statistics for port 0 ----------------------RX-packets: 149536 RX-dropped: 0 RX-total: 149536 TX-packets: 149536 TX-dropped: 0 TX-total: 149536 -------------------------------------------------------------------------------------------------- Forward statistics for port 1 ----------------------RX-packets: 149536 RX-dropped: 0 RX-total: 149536 TX-packets: 149536 TX-dropped: 0 TX-total: 149536 ----------------------------------------------------------------------------+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++RX-packets: 299072 RX-dropped: 0 RX-total: 299072TX-packets: 299072 TX-dropped: 0 TX-total: 299072++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++Done.testpmd>输入quit即可退出。