DPDK testpmd

由于工作需要,需要在DPDK上用testpmd应用程序进行测试。本文主要为了记录自己需要掌握的testpmd的操作命令。

官方文档:http://doc.dpdk.org/guides/testpmd_app_ug/intro.html

Introduction

testpmd对dpdk来说是dpdk工具包的一部分,主要是用来对dpdk的测试,当然其中也包括其他的一些功能,就工作而言,我需要理解其中的一些命令的含义并且能够熟练的使用。

Compiling the Application

testpmd作为一个应用工具包,使用前需要将其编译

  1. 首先进入dpdk的目录,配置环境变量

export RTE_SDK=dpdk的路径

  1. 设置编译目标

export RTE_TARGET=x86_64-native-linux-gcc

  1. 编译应用程序

make -j install T= x86_64-native-linuxapp-gcc(这里的-j,如果是单核的cpu则不需要加)

  1. 找到你的编译成功后的目录,在之后的使用就可以直接执行

./x86_64-native-linuxapp-gcc/app/testpmd

Running the Application

在启动testpmd的,需要加上dpdk的一些参数,比如

./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf -n 6 – -i --rxq=4 --txq=4

这些EAL参数都是需要理解的

  • -c:通过十六进制的掩码来设置使用哪些cpu核,就上述的-c 0xf,0xf的二进制是1111,假设我有8个核,所以就是使用0~3号核。
  • -l:列出所有的核
  • -b:表示不会使用黑名单中的pci设备
  • -n:设置每个socket的内存通道数
    testpmd命令:
  • -i:以交互的方式启动testpmd,意思就是不加-i就直接进入转发模式
  • -h:help
  • –stats:如果不开启交互模式,设置stats值,用来每个一段时间统计信息
  • –nb:设置转发内核的数量
  • –rxq:设置rx队列的数量
  • –txq:设置tx队列的数量
    后续有重要的在补充…

Testpmd Runtime Functions

  • 进入交互模式后,通过命令行进行操作

testpmd>

  • 同样的和linux类似,可以用tab将命令自动补全
  • 启动包转发

testpmd> start

  • 停止包转发

testpmd> stop

  • 退出testpmd

testpmd> quit

  • 查看port

testpmd> show port (info|summary|stats|xstats|fdir|stat_qmap|dcb_tc|cap) (port_id|all)
info:基本的port信息
summary:简要的port信息,驱动名,port名
stats:RX/TX 统计信息
xstats:扩展网卡信息

  • 清除端口的统计信息

testpmd> clear port (info|stats|xstats|fdir|stat_qmap) (port_id|all)

  • 设置包转发模式

testpmd> set fwd (io|mac|macswap|flowgen|rxonly|txonly|csum|icmpecho|noisy) (""|retry)

  • 设置debug的等级

testpmd> set verbose (level)

  • 显示rx队列

testpmd> read rxd (port_id) (queue_id) (rxd_id)

  • 加载动态设备包列表

testpmd> ddp get list (port_id)

  • 显示动态设备包信息

testpmd> ddp get info (profile_path)

  • 显示vf统计信息

testpmd> show vf stats (port_id) (vf_id)

  • 重置vf的统计信息

testpmd> clear vf stats (port_id) (vf_id)

  • l列出所有pctype映射表

testpmd> show port (port_id) pctype mapping

  • 恢复默认设置

testpmd> set default

  • 设置16进制掩码

testpmd> set coremask (mask)

  • 设置转发端口的list

testpmd> set portlist (x[,y]*)

太多了,不想写了…

  • 0
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值