DPDK Test _DPDL

Source: Internet
Author: User
Tags syslog
1 installation Environment software recommended version

Gnumake

coreutils:cmp, SED, grep, arch

Gcc:versions >= 4.5.x

Libcheaders (glibc-devel.i686/libc6-dev-i386; glibc-devel.x86_64 for 64-bitcompilation)

Linuxkernel headers or sources required to build kernel modules. (kernel-devel.x86_64)

Additionalpackages required for 32-bit compilation on 64-bit Systems are:glibc.i686,libgcc.i686, libstdc++.i686 and glibc -devel.i686

Python,version 2.6 or 2.7

Intel Series network Card 2 script setup.sh Introduction

Scripts are used in the tools subdirectory to automate the creation of DPDK running environments. 2.1 Scripting Features

Scripts in the Tools subdirectory allow the user to complete the following tasks:

1 Build the Intel DPDK Library environment.

2 Insert and remove Intel DPDK Igb_uio, Vfio, Kni kernel modules.

3 Create and delete large page tables (hugpage) for NUMA and non-NUMA architectures.

4 Check the status of the network card and apply the reservation card for DPDK.

5 provides non-root users the right to use Vfio.

6 run test and TESTPMD programs.

7 View the memory information of the large page table.

8) View the/mnt/huge page table.

9 Remove the Intel DPDK Library environment.

Supplementary Note:

Igb_uio: Vfio support has been provided from the intel® ®DPDK 1.7 release, and Igb_uio module compilation and use has become an optional platform to support the use of Vfio. The item must be loaded and loaded with the following command:

sudo modprobe UiO

sudo insmod Kmod/igb_uio.ko

UIO (userspace I/O) is an I/O technology that runs in user space. The general drive device in the Linux system is run in kernel space, and in the user space is called by the application, while the UiO is to run a small part of the drive in the kernel space, and in the user space to achieve most of the functions driven. Use UiO to avoid problems where device drivers need to be updated with the kernel

Vfio:vfio is a set of user-state driven frameworks that can be used to write efficient user-state drivers. (For details, please visit:

https://www.ibm.com/developerworks/community/blogs/5144904d-5d75-45ed-9d2b-cf1754ee936a/entry/vfio?lang=en

KNI: (K Native Interface) Sun in the release of the KVM source code in fact already provides KNI (knative Interface) This set of comparison standard API Extension Helper Library 2.2 script steps

A total of 5 steps, each step provides some options for users to create a running environment. Briefly describe the tasks that each step completes.

1 Establishment of DPDK library environment

First, the user must select the correct object target and compilation environment. Also, the user's installation environment must have the previous recommended installation environment.

2) Installation Environment

The user configures the Linux runtime environment to use the DPDK application. Supports Nump and non-nump architectures. Large page tables that exist in the host environment are deleted. This step loads the corresponding kernel module and applies the appropriate network card (PORT) to the DPDK.

3) Running the application

Once the above steps have been completed, the user can run the test program that was brought with it. The test application allows some related functions of DPDK to be used. TESTPMD supports sending and receiving packets.

4) Check System environment

This step provides some tools to view hugepage information.

5) System Environment cleanup

You can restore the system to its original state. 3 Script Installation Examples

The following child is a demo of how to use the setup.sh script. The source command should run the script.

Run the script with the root user.

4SETUP.SH test Program

Description: The test program running process is done under the virtual machine. 4.1 Virtual Machine Build 4.1.1 Create virtual machines

Install virtual machines and centos6.5. 4.1.2 Add two inetl gigabit NIC

Mainly add two cards, eth0, eth1, eth2.

Eth1 and eth2 are used for Dpdk,eth0 to communicate with the host.

Add under Installation directory F:\CENTOS_VM\CENTOS.VMX file:

Ethernet1.virtualdev = "e1000"

Ethernet1.present = "TRUE"

Ethernet2.virtualdev = "e1000"

Ethernet2.present = "TRUE"

and set to host only. Open the virtual machine to see if you added success, use the following command to query: LSPCI | grep Ethernet 4.2 Start Installation Script

Download source, from the official web download, test version for dpdk-1.7.0. 4.2.1 Add Environment variables

exportrte_sdk= ' pwd '

#export RTE_TARGET=X86_64-DEFAULT-LINUXAPP-GCC

EXPORTRTE_TARGET=I686-DEFAULT-LINUXAPP-GCC (this may be adjusted according to your own catalogue)

Since I am a 32 virtual machine, so I choose i686, x86_64 the line of the environment variable annotation, it is recommended to write environment variables in/etc/profile. 4.2.2 Run setup.sh

./tools/setup.sh

------------------------------------------------------------------------------

RTE_SDK exported as/home/pym/dpdk-1.7.0

------------------------------------------------------------------------------

----------------------------------------------------------

Step 1:select the DPDK environment to build

----------------------------------------------------------

[1]I686-NATIVE-LINUXAPP-GCC

[2]I686-NATIVE-LINUXAPP-ICC

[3]X86_64-IVSHMEM-LINUXAPP-GCC

[4]X86_64-IVSHMEM-LINUXAPP-ICC

[5]X86_64-NATIVE-BSDAPP-GCC

[6]X86_64-NATIVE-LINUXAPP-GCC

[7]X86_64-NATIVE-LINUXAPP-ICC

----------------------------------------------------------

Step 2:setup Linuxapp Environment

----------------------------------------------------------

[8] Insert IGB UIO Module

[9] Insert Vfio Module

[10] Insert KNI Module

[11] Setup hugepage mappings for Non-numa Systems

[12] Setup hugepage mappings for NUMA Systems

[13] Display Current Ethernet Device settings

[14] Bind Ethernet device to IGB UIO module

[15] Bind Ethernet device to Vfio module

[16] Setup Vfio Permissions

----------------------------------------------------------

Step 3:run test Application for Linuxapp environment

----------------------------------------------------------

[17] Run test Application ($RTE _target/app/test)

[18] Run TESTPMD application in interactive mode ($RTE _TARGET/APP/TESTPMD)

----------------------------------------------------------

Step 4:other Tools

----------------------------------------------------------

[19] List Hugepage Info From/proc/meminfo

----------------------------------------------------------

Step 5:uninstall and System cleanup

----------------------------------------------------------

[20] Uninstall All targets

[21] Unbind NICs from IGB UIO driver

[22] Remove IGB UIO Module

[23] Remove Vfio Module

[24] Remove KNI Module

[25] Remove Hugepage Mappings

[26] Exit Script 4.2.3 based on system type

Test Environment Select 1 4.2.4 Installation Igb_uio

Select 8

For Igb_uio.ko-driven installation, this driver is compiled, in the i686-default-linuxapp-gcc/kmod/directory; in fact, in the installation of Igb_ Before Uio.ko, the script installed the UiO module first, UiO is a user-driven implementation mechanism, DPDK some things based on uio implementation; 4.2.5 Settings Hugepage

Select 11

Let you enter the reserved memory size of my input is 64, 64 times 2M can be 128M to do a simple test enough. 4.2.6 for network card bind

Select 14

Let you enter the address of the PCI, you just 0000:02:06.0, 0000 Colon After the number of input on the line, such as 02:06.0 remember to lose punctuation. 4.2.7 Select the corresponding program to test

Select 17 or 18 5 test program run

The main learning/home/pym/dpdk-1.7.0/examples directory test procedures, the following test procedures to help us faster learning DPDK usage.

Learn the introductory program HelloWorld below. 5.1 Compiling programs

into the corresponding directory to compile, may want to modify the makefile file, I modified the following place in the test: Rte_target = I686-NATIVE-LINUXAPP-GCC. 5.2 Running the program

./build/helloworld-c 0x03-n 2

-C Bound CPU core

-N Memory channel number

Other options:

Ealoptions:

-c coremask:a hexadecimal bitmask of cores to run on

-N Num:number of memory channels

-v:display Version information on startup

-D LIB.so:add Driver (can used multiple times)

-M mb:memory to allocate (also--SOCKET-MEM)

-R num:force Number of memory ranks (don ' t detect)

--xen-dom0:support application running Onxen Domain0 without

--syslog:set syslog Facility

--socket-mem:memory to allocate on specific

Sockets (use comma separatedvalues)

--huge-dir:directory where Hugetlbfs is mounted

--proc-type:type of this process

--file-prefix:prefix for Hugepage filenames

--pci-blacklist,-b:add a PCI device Inblack list.

Prevent EAL from the using this pcidevice. The argument

Format Is<domain:bus:devid.func>.

--pci-whitelist,-w:add a PCI device Inwhite list.

Only use the specified pcidevices. The argument format

Is<[domain:]bus:devid.func>. This option can be present

Several times (once Per device).

[Note:pci Whitelist cannot beused with-b option]

--vdev:add a virtual device.

The argument format Is<driver><id>[,key=val,...]

(Ex:--vdev=eth_pcap0,iface=eth2).

--vmware-tsc-map:use VMware TSC map Insteadof native RDTSC

--base-virtaddr:specify Base virtual Address

--vfio-intr:specify desired Interrupt modefor vfio (legacy|msi|msix)

--create-uio-dev:create/dev/uiox (Usuallydone by HotPlug)

Ealoptions for DEBUG with only:

--no-huge:use malloc instead of HUGETLBFS

--no-pci:disable PCI

--no-hpet:disable Hpet

--no-shconf:no shared config (mmap ' d files) 6 test program feature Introduction

The main purpose is to have targeted learning. 6.1 Cmdline_test

The command-line sample application demonstrates a simple application that uses the command line interface for Intel ®DPDK. This application is a readline-like interface that can be used to debug an Intel ®DPDK application in a Linux application. 6.2 Exception_path

The exception path sample application is a simple example of how to use Intel ®DPDK to build an exception path to allow packets to pass through the Linux kernel. This is accomplished by using a virtual network interface. These packets may be read and written by the Intel ®DPDK application and appear as a standard interface in the kernel. 6.3helloworld

The Hello World example is the simplest example that can be written in an Intel ®DPDK application. This application HelloWorld messages for each boot Lcore output. 6.4ip_fragmentation

The application of IPV4 fragments is a simple example of the use of packet processing intel® data plane Development Kit (intel® ®DPDK). The application L3 forward IPv4 and IPV6 packet fragmentation. 6.5ipv4_multicast

The IPV4 multicast application is a simple example of packet processing using the Intel® Data Plane Development Kit (intel® ®DPDK). Perform L3 multicast in the application. 6.6ip_reassembly

L3 forwarding application is a simple example of using the Intel ®DPDK to process packets. This application performs L3 forwarding of fragmented IPV4 and IPV6 packets. 6.7KNI

The kernel NIC interface (KNI) is an intel® ®DPDK Control Panel solution that allows user-space applications to exchange packets with the kernel protocol stack. To be realistic, the intel® ®DPDK user space application uses IOCTL to create a Kni virtual set on the Linux kernel. The IOCTL call provides the interface information and the physical address space, and the address space is mapped again to the kernel address space by the Kii kernel loading module, and the address space holds the information to the context of the virtual device. Intel ®DPDK a FIFO queue for each assigned device to allow the packet to enter and leave the kernel module.

This kni loadable kernel module is a standard network driver that receives/forwards packets from the Intel ®DPDK user space application from the IOCTL call Intel ®DPDK Access FIFO queue. The FIFO queue in Intel ®DPDK contains pointers to packets.

1 provides a faster mechanism to interact with the Kernel network protocol stack, system call evaluation.

2 There is a network tool in use of the standard in Intel ®DPDK.

The kernel NIC interface is a simple example of an application, in order to illustrate the use of Intel ®DPDK to create a path through which packets pass through the Linux kernel. Complete by creating one or more kernel network sets for each Intel ®DPDK port. This application allows standard Linux tools such as Ethtool, Ifconfig, tcpdump, and Intel ®DPDK to be used together. Also exchange packets between the Linux kernel and the Intel ®DPDK application.

6.8 Follow-up supplements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.