编译DPDK19以及testpmd和pktgen的测试

本文只提供比较简单的testpmd和pktgen的测试步骤,更为详细的请参考DPDK官网内容。如果是自己开发的pmd,那么需要先添加pmd到DPDK中。

目录

1. 解压缩

2. Setup以及跑testpmd

2.1 Setup

2.1.1 运行脚本

2.1.1 Compile dpdk source

2.1.2 Insert IGB UIO module

2.1.3 Setup hugepage mappings for NUMA systems

2.1.4 Bind Ethernet/Baseband/Crypto device to IGB UIO module

 2.2 Run testpmd

2.2.1 Run testpmd application in interactive mode ($RTE_TARGET/app/testpmd)

2.2.2 Show port information

2.2.3 Start forwarding packets and repeat several times

3. Pktgen Test

3.1 Build DPDK first

3.2 Set RTE_SDK and RTE_TARGET (Be careful about RTE_SDK)

3.3 Make

3.4 Run pktgen

3.5 Result


1. 解压缩

官网下载需要版本的DPDK之后,解压缩。

2. Setup以及跑testpmd

2.1 Setup

2.1.1 运行脚本

./usertools/dpdk-setup.sh

2.1.1 Compile dpdk source

选择 x86_64-native-linux-gcc,我这里的编号是 44。

2.1.2 Insert IGB UIO module

我这里的编号是 48。

2.1.3 Setup hugepage mappings for NUMA systems

我这里的编号是52。

Number of pages for node0: 1024

2.1.4 Bind Ethernet/Baseband/Crypto device to IGB UIO module

我这里的编号是54。

Enter PCI address of device to bind to IGB UIO driver: 02:00.0 03:00.0

 2.2 Run testpmd

2.2.1 Run testpmd application in interactive mode ($RTE_TARGET/app/testpmd)

我这里的编号是58,bitmask 0xf。

2.2.2 Show port information

testpmd> show port info all

2.2.3 Start forwarding packets and repeat several times

testpmd> start tx_first

/* wait some seconds */

testpmd> stop

3. Pktgen Test

3.1 Build DPDK first

3.2 Set RTE_SDK and RTE_TARGET (Be careful about RTE_SDK)

/* 进入pktgen的目录下 */
# cd pktgen-19.12.0/

/* 设置DPDK源码包的绝对路径。当编译外部应用时,用户必须定义这个环境变量。 */
# export RTE_SDK=/home/Driver/dpdk-stable-19.11.6

/* 设置Target,这个和之前编译时选择的相同 */
# export RTE_TARGET=x86_64-native-linux-gcc

3.3 Make

# make

3.4 Run pktgen

执行下面的命令来运行pktgen,下面的参数可以自己查询然后更改,比如变成彩色的(-T)。

# ./app/x86_64-native-linux-gcc/app/pktgen -l 0-3 -n 3 -- -P -m"1.0,2.1"

建议全屏展示,不然容易出现乱码。等网卡link之后,就可以做下面的动作。

/* 设置需要跑的size大小 */
Pktgen:/> set all size xxx

/* start all的缩写,也可以start 0,即运行port 0 */
Pktgen:/> str

/* stop all的缩写 */
Pktgen:/> stp

/* 退出pktgen */
Pktgen:/> quit

3.5 Result

首先,需要能够稳定运行,之后可以记录速度来测试pmd。

Packet Size

64

128

256

512

1024

1280

1518

Mbit/s

以上就是全部内容。

如果觉得这篇文章有用的话,可以点赞、评论或者收藏,万分感谢,goodbye~

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值