DPDK Tools User Guides(8)dpdk-test-eventdev應用程序

官方文檔查看地址:
http://doc.dpdk.org/guides/sample_app_ug/qos_scheduler.html
PDF下載地址:
https://www.intel.com/content/www/us/en/embedded/technology/packet-processing/dpdk/dpdk-sample-applications-user-guide.html?eu-cookie-notice

本篇難度係數:
翻譯:☆☆☆☆☆
理解:★★☆☆☆

8.dpdk-test-eventdev應用程序
dpdk-test-eventdev工具是一個數據平面開發工具包(DPDK:Data Plane Development Kit)應用程序,它允許使用各種eventdev用例。這個應用程序有一個通用框架,用於添加新的基於eventdev的測試用例,以驗證功能並度量DPDK eventdev設備的性能參數。

8.1編譯應用程序
構建應用程序
執行dpdk-setup.sh腳本,與dpdk-test-eventdev應用程序一起構建DPDK庫。

首先,用戶必須選擇一個DPDK目標,以選擇構建庫時使用的正確目標類型和編譯器選項。在此之前,用戶必須在系統中安裝所有庫、模塊、更新和編譯器,如本入門指南前面幾章所述。

8.2運行應用程序
應用程序有許多命令行選項:

dpdk-test-eventdev [EAL Options] -- [application options]

8.2.1EAL選項
以下是可以與dpdk-test-eventdev應用程序一起使用的EAL命令行選項。有關這些選項的更多信息,請參閱DPDK入門指南。

  • -c <COREMASK>-l <CORELIST>
    設置要運行的內核的十六進制位掩碼。corelist是要使用的內核列表。
  • --vdev <driver><id>
    添加一個虛擬eventdev設備。

8.2.2應用程序選項
以下是應用程序命令行選項:

  • --verbose
    制定詳細的水平。默認值爲1。值> 1顯示更多詳細信息。

  • --dev <n>
    設置事件設備的設備id。

  • --test <name>
    設置測試名稱,其中名稱爲以下內容之一:

order_queue
order_atq
perf_queue
perf_atq
pipeline_atq
pipeline_queue
  • --socket_id <n>
    設置應用程序資源的套接字id。

  • --pool-sz <n>
    設置要從mempool分配的mbufs的數量。

  • --plcores <CORELIST>
    設置要用作生成器的CPU核心列表。

  • --wlcores <CORELIST>
    設置要用作worker的CPU核心列表。

  • --stlist <type_list>
    設置每個階段的計劃類型,其中type_list大小決定測試應用程序中使用的階段數量。每個type_list成員可以是以下成員之一:

P or p : 並行調度類型
O or o : 訂購計劃類型
A or a : 原子表類型

應用程序期望type_list以逗號分隔的形式出現(即--stlist o,a,a,a)

  • --nb_flows <n>
    設置要生成的流的數量。

  • --nb_pkts <n>
    設置要生成的包的數量。0表示沒有極限。

  • --worker_deq_depth <n>
    設置工作程序的下隊列深度。

  • --fwd_latency
    執行正向延遲測量。

  • --queue_priority
    啓用隊列優先級。

  • --prod_type_ethdev
    使用以太網設備作爲生產者。

  • --prod_type_timerdev
    使用事件計時器適配器作爲生成器。

  • --prod_type_timerdev_burst
    使用突發模式事件計時器適配器作爲生成器。

  • --timer_tick_nsec
    用於指定事件計時器適配器的桶遍歷之間的納秒數。參考rte_event_timer_adapter_conf。

  • --max_tmo_nsec
    用於配置事件計時器適配器的最大arm超時(以納秒爲單位)。

  • --expiry_nsec
    指定事件計時器過期後的納秒數。

  • --nb_timers
    每個生產者核心將生成的事件計時器數量。

  • --nb_timer_adptrs
    要使用的事件計時器適配器的數量。每個適配器由生產者核心以循環方式使用。

  • --deq_tmo_nsec
    所有事件端口的全局dequeue超時如果提供的dequeue超時超出事件設備的支持範圍,則將其調整爲支持的最高/最低支持的dequeue超時。

8.3 Eventdev測試
8.3.1 ORDER_QUEUE測試
這是一個功能測試用例,旨在測試以下內容:

  • 1.驗證入口序列的維護。
  • 2.驗證每個eventdev端口對給定原子流的獨佔(原子)訪問。
# Items Value Comments
1 nb_queues 2 q0(ordered), q1(atomic)
2 nb_producers 1
3 nb_workers >= 1
4 nb_ports nb_workers + 1 Workers use port 0 to port n-1. Producer uses port n

在這裏插入圖片描述
圖8.4排序隊列測試操作。

order隊列測試將eventdev配置爲兩個隊列和一個事件生成器,以便將事件注入q0(有序)隊列。q0(ordered)和q1(atomic)都鏈接到所有worker。

事件生成器爲每個流維護一個序列號,並將事件注入有序隊列。worker從有序隊列接收事件並將其轉發到原子隊列。由於來自有序隊列的事件可以在不同的worker上並行處理,因此事件的傳入順序可能在下游原子隊列enqueue上發生了更改。在進入原子隊列時,eventdev PMD驅動程序將事件重新排序爲原始的進入順序(i。e生產商進入訂單)。

當工作人員將事件從原子隊列中退出隊列時,此測試通過比較每個流中空閒運行的預期序列號來驗證每個流中關聯事件的預期序列號。

8.3.1.1 應用程序選項
支持的應用程序命令行選項如下:

--verbose
--dev
--test
--socket_id
--pool_sz
--plcores
--wlcores
--nb_flows
--nb_pkts
--worker_deq_depth
--deq_tmo_nsec

8.3.1.2 例子
示例命令運行order隊列測試:

sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- --test=order_queue --plcores 1 --wlcores 2,3

8.3.2 ORDER_ATQ測試
此測試驗證order_queue測試的相同方面,不同之處是使用的隊列數量,此測試操作單個all type queue(atq),而不是order和atomic的兩個不同的隊列。

Table 8.2 Order all types queue test eventdev configuration.

# Items Value Comments
1 nb_queues 1 q0(all types queue)
2 nb_producers 1
3 nb_workers >= 1
4 nb_ports nb_workers + 1 Workers use port 0 to port n-1.Producer uses port n.

在這裏插入圖片描述
圖8.5排序所有類型隊列測試操作。

8.3.2.1應用程序選項
支持的應用程序命令行選項如下:

--verbose
--dev
--test
--socket_id
--pool_sz
--plcores
--wlcores
--nb_flows
--nb_pkts
--worker_deq_depth
--deq_tmo_nsec

8.3.2.2 例子
示例命令運行order all types隊列測試:

sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- --test=order_atq --plcores 1 --wlcores 2,3

8.3.3 PERF_QUEUE測試
這是一個性能測試用例,旨在測試以下內容:

  • 1.測量一秒鐘內可以處理的事件數量。
  • 2.測量轉發事件的延遲。

Table 8.3 Perf queue test eventdev configuration.

# Items Value Comments
1 nb_queues nb_producers * nb_stages 隊列將根據用戶請求的sched類型列表(-stlist)進行配置
2 nb_producers >= 1 通過- plcore命令行參數選擇。
3 nb_workers >= 1 通過- wlcore命令行參數選擇
4 nb_ports nb_workers + nb_producers 工作人員使用端口0到端口n-1。生產者使用n端口到p端口

在這裏插入圖片描述
Fig. 8.6 perf queue test operation.

perf隊列測試將eventdev配置爲Q隊列和P端口,其中Q和P是工作者數量、生產者數量和階段數量的函數,如表8.3中所述。

用戶可以通過--wlcore--plcore--stlist應用程序命令行參數分別選擇worker的數量、producer的數量和stage的數量。

生產者根據用戶通過--stlist命令行參數請求的第一階段sched類型列表,將事件注入eventdev。

根據要處理的階段數(通過--stlist選擇),應用程序將事件轉發到下一個上游隊列,並在到達管道中的最後一個階段時終止。在事件終止時,應用程序遞增處理的事件數量,並在一秒鐘內定期打印,以獲得一秒鐘內處理的事件數量。當--fwd_latency命令行選項被選中時,應用程序在第一階段的事件中插入時間戳,然後在終止時更新轉發包的週期數。應用程序使用此值計算轉發包的平均延遲。

當選擇--prod_type_ethdev命令行選項時,應用程序將探測到的以太網設備配置爲Rx適配器,而不是使用合成生成器,從而將它們用作生成器。

8.3.4 PERF_ATQ測試
這是一個性能測試用例,旨在用所有類型的隊列eventdev方案測試以下內容。測量一秒鐘內可以處理的事件數量。測量轉發事件的延遲。

8.3.4.2 例子
示例命令運行perfall types queue測試:

sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- --test=perf_atq --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0

使用事件計時器適配器運行perf所有類型隊列測試的示例命令:

sudo  build/app/dpdk-test-eventdev --vdev="event_octeontx" -- --wlcores 4 --plcores 12 --test perf_atq --verbose 20 --stlist=a --prod_type_timerdev --fwd_latency

8.3.5. PIPELINE_QUEUE 測試
這是一個管道測試用例,旨在測試以下內容:

  • 1.使用以太網dev度量事件dev的端到端性能。
  • 2.維護從Rx到Tx的數據包順序。

表8.5管線隊列測試eventdev配置。

# Items Value Comments
1 nb_queues (nb_producers * nb_stages) + nb_producers Queues will be configured based on the user requested sched type list(–stlist) At the last stage of the schedule list the event is enqueued onto per port unique queue which is then Transmitted.
2 nb_producers >= 1 Producers will be configured based on the number of detected ethernet devices. Each ethdev will be configured as an Rx adapter.
3 nb_workers >= 1 Selected through –wlcores command line argument
4 nb_ports nb_workers + (nb_produces * 2) Workers use port 0 to port n. Producers use port n+1 to port n+m, depending on the Rx adapter capability. Consumers use port n+m+1 to port n+o depending on the Tx adapter capability.

在這裏插入圖片描述
Fig. 8.9 pipeline queue test operation.

管道隊列測試將eventdev配置爲Q隊列和P端口,其中Q和P是工作者數量、生產者數量和階段數量的函數,如表8.5中所述。

用戶可以通過--wlcore--stlist應用程序命令行參數分別選擇worker的數量和stage的數量。

生產者的數量取決於檢測到的以太網設備的數量,每個以太網設備都配置爲充當生產者的event_eth_rx_adapter。

生產者根據用戶通過--stlist命令行參數請求的第一階段sched類型列表,將事件注入eventdev。

基於數量的階段過程(選擇通過--stlist),該應用程序將事件轉發給下一個上游隊列,當它到達最後階段的管道,如果事件類型是原子到ethdev Tx隊列維護命令事件類型設置爲其他原子和隊列的隊列到最後階段。

如果ethdev和eventdev隊有 RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT能力,然後工人排隊核心包eventdev直接使用rte_event_eth_tx_adapter_enqueue其他工作核心的包到SINGLE_LINK_QUEUE排隊管理的Tx適配器。Tx適配器退出數據包隊列並傳輸它。

在包Tx上,應用程序增加處理的事件數量,並在一秒鐘內定期打印,以獲得一秒鐘內處理的事件數量。

8.3.5.1 應用程序選項
支持的應用程序命令行選項如下:

--verbose
--dev
--test
--socket_id
--pool_sz
--wlcores
--stlist
--worker_deq_depth
--prod_type_ethdev
--deq_tmo_nsec

注意
--prod_type_ethdev是運行這個測試所必需的。

8.3.5.2. 例子
示例命令運行管道隊列測試:

sudo build/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- --test=pipeline_queue --wlcore=1 --prod_type_ethdev --stlist=a

8.3.6. PIPELINE_ATQ Test
This is a pipeline test case that aims at testing the following with all types queue eventdev scheme.

Measure the end-to-end performance of an event dev with a ethernet dev.
Maintain packet ordering from Rx to Tx.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章