官方文档查看地址:
http://doc.dpdk.org/guides/sample_app_ug/eventdev_pipeline.html
PDF下载地址:
https://www.intel.com/content/www/us/en/embedded/technology/packet-processing/dpdk/dpdk-sample-applications-user-guide.html?eu-cookie-notice
本篇难度系数:
翻译:☆☆☆☆☆
理解:★★☆☆☆
42.Eventdev管道示例应用程序
eventdev管道示例应用程序是一个示例应用程序,演示了使用PMD软件使用eventdev API。它展示了应用程序如何配置管道并分配一组工作内核来执行所需的处理。应用程序有一系列命令行参数,允许为不同的数字工作者核心、阶段、队列深度和每个工作阶段的周期配置命令行参数。这对于性能测试以及快速测试特定的管道配置非常有用。
42.1编译应用程序
要编译示例应用程序,请参见Compiling the Sample Applications。
应用程序位于examples子目录中。
2运行应用程序
应用程序有许多命令行选项。这允许使用eventdev PMD的规范和处理管道选项的许多属性。
下面是一个使用这些设置运行eventdev PMD软件的eventdev管道示例:
-r1: core mask 0x1 for RX
-t1: core mask 0x1 for TX
-e4: core mask 0x4 for the software scheduler
-w FF00: core mask for worker cores, 8 cores from 8th to 16th
-s4: 4 atomic stages
-n0: process infinite packets (run forever)
-c32: worker dequeue depth of 32
-W1000: do 1000 cycles of work per packet in each stage
-D: dump statistics on exit
./build/eventdev_pipeline --vdev event_sw0 -- -r1 -t1 -e4 -w FF00 -s4 -n0 -c32 -W1000 -D
应用程序有一些健全的检查内置,所以如果有一个函数(例如;没有分配cpu核心掩码的RX core),应用程序将打印一条错误消息:
Core part of pipeline was not assigned any cores. This will stall the
pipeline, please check core masks (use -h for details on setting core masks):
rx: 0
tx: 1
eventdev的配置在programmers guide(程序员指南)中有详细的介绍,请参阅Event Device Library一节。
3观察应用程序
在运行时,eventdev管道应用程序打印配置摘要,以及一些运行时统计信息,如每秒的数据包。在退出时,将打印工作人员统计信息,如果需要,还将打印PMD统计信息的完整转储。下面几节显示每种输出类型的示例输出。
3.1配置
这提供了管道的概述、每个阶段的调度类型以及选项的参数,比如要使用多少流以及使用什么eventdev PMD。有关详细信息,请参阅下面的示例输出:
Config:
ports: 2
workers: 8
packets: 0
priorities: 1
Queue-prio: 0
qid0 type: atomic
Cores available: 44
Cores used: 10
Eventdev 0: event_sw
Stages:
Stage 0, Type Atomic Priority = 128
Stage 1, Type Atomic Priority = 128
Stage 2, Type Atomic Priority = 128
Stage 3, Type Atomic Priority = 128
3.2运行时
在运行时,将打印使用者的统计信息,说明接收到的数据包数量、运行时(以毫秒为单位)、平均mpps和当前mpps。
用户RX= xxxxxxx,时间yyyy ms, avg z。电流www mmp)
# consumer RX= xxxxxxx, time yyyy ms, avg z.zzz mpps [current w.www mpps]
3.3关闭
在关机时,应用程序打印接收和传输的数据包数量,以及工作在工作核之间的分布概况。
Signal 2 received, preparing to exit...
worker 12 thread done. RX=4966581 TX=4966581
worker 13 thread done. RX=4963329 TX=4963329
worker 14 thread done. RX=4953614 TX=4953614
worker 0 thread done. RX=0 TX=0
worker 11 thread done. RX=4970549 TX=4970549
worker 10 thread done. RX=4986391 TX=4986391
worker 9 thread done. RX=4970528 TX=4970528
worker 15 thread done. RX=4974087 TX=4974087
worker 8 thread done. RX=4979908 TX=4979908
worker 2 thread done. RX=0 TX=0
Port Workload distribution:
worker 0 : 12.5 % (4979876 pkts)
worker 1 : 12.5 % (4970497 pkts)
worker 2 : 12.5 % (4986359 pkts)
worker 3 : 12.5 % (4970517 pkts)
worker 4 : 12.5 % (4966566 pkts)
worker 5 : 12.5 % (4963297 pkts)
worker 6 : 12.5 % (4953598 pkts)
worker 7 : 12.5 % (4974055 pkts)
要获得eventdev PMD状态的完整转储,请将-D标志传递给此应用程序。当应用程序使用Ctrl+C终止时,调用rte_event_dev_dump()函数,生成PMD提供的统计信息的转储。提供的统计信息取决于所使用的PMD,有关eventdev PMD列表,请参阅Event Device Drivers章节(see the Event Device Drivers section for a list of eventdev PMDs)。