Disclaimer: This document is only for learning and exchange, do not use for other commercial purposes author: Chaoyang _tony
E-mail:linzhaolover@gmail.com
Create date:2013-7-10 13:59:31 Wednesday
Last change:2013-7-14 22:53:11 Sunday
Reprint please indicate the source: Http://blog.csdn.net/linzhaolover
This article in the source code can go to http://dpdk.org/dev web page download; More official documents please visit http://dpdk.org
PKTGEN-DPDK Introduction
PKTGEN-DPDK is a 6wind outsourcing tool developed by Intel DPDK, which is used to test the packet forwarding capability of DPDK;
You can see its details in Https://github.com/Pktgen/Pktgen-DPDK;
My test environment is REHL6.2 system;
Download Source mode
Git clone http://github.com/Pktgen/Pktgen-DPDK.git
installation compiled source code;
Download the source code after entering the PKTGEN-DPDK/DPDK directory, the implementation of installation;
Make install T=X86_64-WR-LINUXAPP-GCC
If you encounter the following variable name duplicate definition error;
In file included from/home/linzh/repo/pktgen-dpdk/dpdk/lib/libwr_mcos/rte_mcos.c:81:
/home/linzh/repo/ Pktgen-dpdk/dpdk/lib/libwr_mcos/rte_mcos.h:321:error:redefinition of the typedef ' mcos_master_t '
/home/linzh/repo /pktgen-dpdk/dpdk/lib/libwr_mcos/rte_mcos_debug.h:114:note:previous declaration of ' mcos_master_t ' is here
/ Home/linzh/repo/pktgen-dpdk/dpdk/lib/libwr_mcos/rte_mcos.h:385:error:redefinition of the typedef ' mInfo_t '
/home/ linzh/repo/pktgen-dpdk/dpdk/lib/libwr_mcos/rte_mcos_debug.h:113:note:previous declaration of ' mInfo_t ' is here
Need to modify the file variable definition, I just temporarily made a change;
Vim/home/linzh/repo/pktgen-dpdk/dpdk/lib/libwr_mcos/rte_mcos_debug.h
%s/minfo_t/minfo_t_bak/g
%s/mcos_master_t/mcos_master_t_bak/g
Renaming the minfo_t in the Rte_mcos_debug.h file to Minfo_t_bak, renaming mcos_master_t to Mcos_master_t_bak;
setting environment variables;
Export rte_sdk= ' pwd '
export RTE_TARGET=X86_64-WR-LINUXAPP-GCC
Execute the script to install the configuration;
./tools/setup.sh
Run the scripts after running them separately
[6] Insert IGB UIO module
[7] Insert KNI module
[8] Setup hugepage mappings for Non-numa Systems
Install the new Intel NIC driver;
Set Hugepage information, I entered 1024, that is, allocating 1024 2M of memory, equal to 2G of memory space;
Run 11, take a DPDK test; in 11 if a core source, if the input F knock enter, that is, 0 to 3 of these core to test;
[One] Run TESTPMD application in interactive mode ($RTE _TARGET/APP/TESTPMD)
Option:11
Enter hex bitmask of cores to execute TESTPMD app
in example:to execute app on cores 0 to 7, Enter 0xf F
bitmask:f
Enter F after knocking in the carriage
Show some of the information below to indicate success
Interactive-mode selected
configuring Port 0
pmd:to improve 1G driver performance, consider setting the TX wthres H value to 4, 8, or.
Configuring Port 1
pmd:to improve 1G driver performance, consider setting the TX Wthresh value to 4, 8, or.
Configuring Port 2
pmd:to improve 1G driver performance, consider setting the TX Wthresh value to 4, 8, or.
Configuring Port 3
pmd:to improve 1G driver performance, consider setting the TX Wthresh value to 4, 8, or.
Checking link statuses
... Port 0 Link up-speed 1000 mbps-full-duplex
port 1 link up-speed 1000 mbps-full-duplex
Port 2 link up-s Peed 1000 Mbps-full-duplex
Port 3 Link up-speed 1000 mbps-full-duplex
done
testpmd>
Then try running the start and stop commands separately;
testpmd> start IO packet forwarding-crc stripping disabled-packets/burst=16 nb forwarding cores=1-nb Forwardi ng ports=4 Rx Queues=1-rx desc=128-rx free threshold=0 RX threshold registers:pthresh=8 hthresh=8 wthresh=4 TX QUEUES=1-TX desc=512-tx Free threshold=0 TX threshold registers:pthresh=36 hthresh=0 wthresh=0 TX RS bit Threshol
D=0-TXQ flags=0x0 testpmd> stop telling cores to stop ... Waiting for Lcores to finish ...----------------------Forward statistics for Port 0----------------------Rx-packe ts:24 rx-dropped:0 rx-total:24 tx-packets:0 tx-dropped:0 tx-total: 0--------------------------------------------------------------------------------------------------Forward Statistics for Port 1----------------------rx-packets:24 rx-dropped:0 rx-total:24 Tx-pac kets:0 tx-dropped:0 tx-total:0--------------------------------------------------------------------------------------------------Forward statistics for Port 2---------------- ------rx-packets:24 rx-dropped:0 rx-total:24 tx-packets:0 tx-dropped:0 tx-total:0------------------------------------------------------------------------------------------------ --Forward statistics for Port 3----------------------rx-packets:24 rx-dropped:0 rx-total: tx-packets:0 tx-dropped:0 tx-total:0-------------------------------------------------- --------------------------+++++++++++++++ accumulated forward statistics for all ports+++++++++++++++ rx-packets:96 rx-dropped:0 rx-total:96 tx-packets:0 tx-dropped:0 tx-total:0 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ done.
Testpmd>
Test Pktgen below
Enter Pktgen-dpdk/dpdk/wr-examples/pktgen catalogue;
Execute make to compile Pktgen;
Run the setup script to configure the environment, the script is actually configured Hugepage, and the new installation of the Intel network card driver;
./setup
Run doit to test pktgen;
./doit
If an error is found;
Eal:coremask set to e
eal:auto-detected process type:primary
eal:detected Lcore 1 as core 1 on socket 0
EA L:detected Lcore 2 as Core 2 on socket 0
eal:detected Lcore 3 as core 8 on socket 0
eal:setting up hugepage mem
Ory ... Eal:ask a virtual area of 0x80000000 bytes
eal:virtual area found at 0x7f1a14e00000 (size = 0x80000000)
eal:not Enough memory available on socket 1! REQUESTED:128MB, AVAILABLE:0MB
PANIC in Rte_eal_init ():
cannot init memory
6: [./app/build/pktgen () [ 0X4038B9]]
5: [/lib64/libc.so.6 (__LIBC_START_MAIN+0XFD) [0X7F1A95368CDD]]
4: [./app/build/pktgen () [ 0X41595F]]
3: [./app/build/pktgen () [0x49aabb]]
2: [./app/build/pktgen () [0x49fea0]]
1: [./app/build /pktgen () [0x49fd86]]
./doit:line 8: 3445 aborted (core dumped)./app/build/pktgen-c E-n 3--proc-type A UTO--socket-mem 128,128--file-prefix pg---p 0x14-p-M "2.0, 3.1"-F Test/set_seq.cmd
This should be the execution procedure is, the incoming test parameter error;
--socket-mem 128,128
There is a problem with this parameter, I do not have a solution for the moment, do not understand the specific use of this parameter, the following 128 removed and then run;
./app/build/pktgen-c e-n 3--proc-type Auto--SOCKET-MEM 128--file-prefix PG---p 0x14-p-M "2.0, 3.1"-F Test/set_se Q.cmd
-C refers to the selection of the core mask, E equals 1110 is the choice of 1, 2, 3rd core;
--proc-type selected Auto, if it is the current system first executed DPDK related program, select Primary mode, if the second is secondary mode;
--file-prefix PG Sets the filename prefix of the/mnt/huge/memory allocation module;
-P 0x14 0x14 equals 00010100, select one of the 2 Intel related network card ports in your current system;
-P enables network blending mode,
-M "2.0, 3.1" This refers to a matrix model, 2.0 refers to the 2nd Lcore bound Port 0, 3.1 refers to the lcore3 bound Port 1
-F Test/set_seq.cmd Finally imports the Pktgen execution configuration file and, when executing Pktgen, uses the configuration to generate the packet;
The
eventually appears with the following interface; You can have more official Readme.pktgen files, perform some configuration, and related tests;
| Ports 0-1 of 2 * * Main Page * * Copyright (c) <2010-2013> Wind River Systems, Inc., powered by INTEL®DPDK Flag S:port:p---------: 0 P---------: 1 Link State: <UP-1000-FD> <UP-1000-FD>---T
Otalrate---pkts/s rx:6 6 12 tx:0 0 0 mbits/s Rx/tx : 0/0 0/0 0/0 Broadcast: 0 0 multicast:0 0 bytes:0 0 65-127:0 0 128-255:0 0 256-511:0 0 512-1023:0 0 1024-1518:0 0 runts/jumbos:0/0 0/0 Errors rx/tx:0/0 0/0 Total Rx pkts:39 Tx pkts: 0 0 Rx mbs:0 0 Tx MBs: 0 0 arp/icmp pkts:0/0 0/0 Tx failed:0
0:229386/1 229386/1 Tx count/% rate:forever/100% forever/100% Pktsize/tx burst:64/128 64/128 src/dest port:1234/5678 1234/5678 Pkt TYPE:VL An id:ipv4/tcp:0001 ipv4/tcp:0001 Dst IP address:192.168.1.1 192.168.0.1 SRC IP address:1 92.168.0.1/24 192.168.1.1/24 Dst mac address:0016:31ff:d074 0016:31ff:d01a Src mac Address:0016:31ff:d01 A 0016:31ff:d074--PKtgen ver:2.1.3 (DPDK-1.3.0)------------------------------------------------------------------------------------ -Pktgen> # * * * * executing file (test/set_seq.cmd) pktgen> * * * Unable to find file (test/set_seq.cmd) or invalid
Call pktgen>
The level of technology needs to be improved, if there is a wrong place to want the reader to correct and learn from each other; O (∩_∩) o~