1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(c) 2017 Cavium, Inc
4 dpdk-test-eventdev Application
5 ==============================
7 The ``dpdk-test-eventdev`` tool is a Data Plane Development Kit (DPDK)
8 application that allows exercising various eventdev use cases.
9 This application has a generic framework to add new eventdev based test cases to
10 verify functionality and measure the performance parameters of DPDK eventdev
13 Compiling the Application
14 -------------------------
16 **Build the application**
18 Execute the ``dpdk-setup.sh`` script to build the DPDK library together with the
19 ``dpdk-test-eventdev`` application.
21 Initially, the user must select a DPDK target to choose the correct target type
22 and compiler options to use when building the libraries.
23 The user must have all libraries, modules, updates and compilers installed
24 in the system prior to this,
25 as described in the earlier chapters in this Getting Started Guide.
27 Running the Application
28 -----------------------
30 The application has a number of command line options:
32 .. code-block:: console
34 dpdk-test-eventdev [EAL Options] -- [application options]
39 The following are the EAL command-line options that can be used in conjunction
40 with the ``dpdk-test-eventdev`` application.
41 See the DPDK Getting Started Guides for more information on these options.
43 * ``-c <COREMASK>`` or ``-l <CORELIST>``
45 Set the hexadecimal bitmask of the cores to run on. The corelist is a
48 * ``--vdev <driver><id>``
50 Add a virtual eventdev device.
55 The following are the application command-line options:
59 Set verbose level. Default is 1. Value > 1 displays more details.
63 Set the device id of the event device.
67 Set test name, where ``name`` is one of the following::
78 Set the socket id of the application resources.
82 Set the number of mbufs to be allocated from the mempool.
84 * ``--plcores <CORELIST>``
86 Set the list of cores to be used as producers.
88 * ``--wlcores <CORELIST>``
90 Set the list of cores to be used as workers.
92 * ``--stlist <type_list>``
94 Set the scheduled type of each stage where ``type_list`` size
95 determines the number of stages used in the test application.
96 Each type_list member can be one of the following::
98 P or p : Parallel schedule type
99 O or o : Ordered schedule type
100 A or a : Atomic schedule type
102 Application expects the ``type_list`` in comma separated form (i.e. ``--stlist o,a,a,a``)
106 Set the number of flows to produce.
110 Set the number of packets to produce. 0 implies no limit.
112 * ``--worker_deq_depth <n>``
114 Set the dequeue depth of the worker.
118 Perform forward latency measurement.
120 * ``--queue_priority``
122 Enable queue priority.
124 * ``--prod_type_ethdev``
126 Use ethernet device as producer.
128 * ``--prod_type_timerdev``
130 Use event timer adapter as producer.
132 * ``--prod_type_timerdev_burst``
134 Use burst mode event timer adapter as producer.
136 * ``--timer_tick_nsec``
138 Used to dictate number of nano seconds between bucket traversal of the
139 event timer adapter. Refer `rte_event_timer_adapter_conf`.
143 Used to configure event timer adapter max arm timeout in nano seconds.
147 Dictate the number of nano seconds after which the event timer expires.
151 Number of event timers each producer core will generate.
153 * ``--nb_timer_adptrs``
155 Number of event timer adapters to be used. Each adapter is used in
156 round robin manner by the producer cores.
164 This is a functional test case that aims at testing the following:
166 #. Verify the ingress order maintenance.
167 #. Verify the exclusive(atomic) access to given atomic flow per eventdev port.
169 .. _table_eventdev_order_queue_test:
171 .. table:: Order queue test eventdev configuration.
173 +---+--------------+----------------+------------------------+
174 | # | Items | Value | Comments |
176 +===+==============+================+========================+
177 | 1 | nb_queues | 2 | q0(ordered), q1(atomic)|
179 +---+--------------+----------------+------------------------+
180 | 2 | nb_producers | 1 | |
182 +---+--------------+----------------+------------------------+
183 | 3 | nb_workers | >= 1 | |
185 +---+--------------+----------------+------------------------+
186 | 4 | nb_ports | nb_workers + | Workers use port 0 to |
187 | | | 1 | port n-1. Producer uses|
189 +---+--------------+----------------+------------------------+
191 .. _figure_eventdev_order_queue_test:
193 .. figure:: img/eventdev_order_queue_test.*
195 order queue test operation.
197 The order queue test configures the eventdev with two queues and an event
198 producer to inject the events to q0(ordered) queue. Both q0(ordered) and
199 q1(atomic) are linked to all the workers.
201 The event producer maintains a sequence number per flow and injects the events
202 to the ordered queue. The worker receives the events from ordered queue and
203 forwards to atomic queue. Since the events from an ordered queue can be
204 processed in parallel on the different workers, the ingress order of events
205 might have changed on the downstream atomic queue enqueue. On enqueue to the
206 atomic queue, the eventdev PMD driver reorders the event to the original
207 ingress order(i.e producer ingress order).
209 When the event is dequeued from the atomic queue by the worker, this test
210 verifies the expected sequence number of associated event per flow by comparing
211 the free running expected sequence number per flow.
216 Supported application command line options are following::
232 Example command to run order queue test:
234 .. code-block:: console
236 sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
237 --test=order_queue --plcores 1 --wlcores 2,3
243 This test verifies the same aspects of ``order_queue`` test, the difference is
244 the number of queues used, this test operates on a single ``all types queue(atq)``
245 instead of two different queues for ordered and atomic.
247 .. _table_eventdev_order_atq_test:
249 .. table:: Order all types queue test eventdev configuration.
251 +---+--------------+----------------+------------------------+
252 | # | Items | Value | Comments |
254 +===+==============+================+========================+
255 | 1 | nb_queues | 1 | q0(all types queue) |
257 +---+--------------+----------------+------------------------+
258 | 2 | nb_producers | 1 | |
260 +---+--------------+----------------+------------------------+
261 | 3 | nb_workers | >= 1 | |
263 +---+--------------+----------------+------------------------+
264 | 4 | nb_ports | nb_workers + | Workers use port 0 to |
265 | | | 1 | port n-1.Producer uses |
267 +---+--------------+----------------+------------------------+
269 .. _figure_eventdev_order_atq_test:
271 .. figure:: img/eventdev_order_atq_test.*
273 order all types queue test operation.
278 Supported application command line options are following::
294 Example command to run order ``all types queue`` test:
296 .. code-block:: console
298 sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
299 --test=order_atq --plcores 1 --wlcores 2,3
305 This is a performance test case that aims at testing the following:
307 #. Measure the number of events can be processed in a second.
308 #. Measure the latency to forward an event.
310 .. _table_eventdev_perf_queue_test:
312 .. table:: Perf queue test eventdev configuration.
314 +---+--------------+----------------+-----------------------------------------+
315 | # | Items | Value | Comments |
317 +===+==============+================+=========================================+
318 | 1 | nb_queues | nb_producers * | Queues will be configured based on the |
319 | | | nb_stages | user requested sched type list(--stlist)|
320 +---+--------------+----------------+-----------------------------------------+
321 | 2 | nb_producers | >= 1 | Selected through --plcores command line |
323 +---+--------------+----------------+-----------------------------------------+
324 | 3 | nb_workers | >= 1 | Selected through --wlcores command line |
326 +---+--------------+----------------+-----------------------------------------+
327 | 4 | nb_ports | nb_workers + | Workers use port 0 to port n-1. |
328 | | | nb_producers | Producers use port n to port p |
329 +---+--------------+----------------+-----------------------------------------+
331 .. _figure_eventdev_perf_queue_test:
333 .. figure:: img/eventdev_perf_queue_test.*
335 perf queue test operation.
337 The perf queue test configures the eventdev with Q queues and P ports, where
338 Q and P is a function of the number of workers, the number of producers and
339 number of stages as mentioned in :numref:`table_eventdev_perf_queue_test`.
341 The user can choose the number of workers, the number of producers and number of
342 stages through the ``--wlcores``, ``--plcores`` and the ``--stlist`` application
343 command line arguments respectively.
345 The producer(s) injects the events to eventdev based the first stage sched type
346 list requested by the user through ``--stlist`` the command line argument.
348 Based on the number of stages to process(selected through ``--stlist``),
349 The application forwards the event to next upstream queue and terminates when it
350 reaches the last stage in the pipeline. On event termination, application
351 increments the number events processed and print periodically in one second
352 to get the number of events processed in one second.
354 When ``--fwd_latency`` command line option selected, the application inserts
355 the timestamp in the event on the first stage and then on termination, it
356 updates the number of cycles to forward a packet. The application uses this
357 value to compute the average latency to a forward packet.
359 When ``--prod_type_ethdev`` command line option is selected, the application
360 uses the probed ethernet devices as producers by configuring them as Rx
361 adapters instead of using synthetic producers.
366 Supported application command line options are following::
382 --prod_type_timerdev_burst
393 Example command to run perf queue test:
395 .. code-block:: console
397 sudo build/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \
398 --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
400 Example command to run perf queue test with ethernet ports:
402 .. code-block:: console
404 sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
405 --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --prod_type_ethdev
407 Example command to run perf queue test with event timer adapter:
409 .. code-block:: console
411 sudo build/app/dpdk-test-eventdev --vdev="event_octeontx" -- \
412 --wlcores 4 --plcores 12 --test perf_queue --stlist=a \
413 --prod_type_timerdev --fwd_latency
418 This is a performance test case that aims at testing the following with
419 ``all types queue`` eventdev scheme.
421 #. Measure the number of events can be processed in a second.
422 #. Measure the latency to forward an event.
424 .. _table_eventdev_perf_atq_test:
426 .. table:: Perf all types queue test eventdev configuration.
428 +---+--------------+----------------+-----------------------------------------+
429 | # | Items | Value | Comments |
431 +===+==============+================+=========================================+
432 | 1 | nb_queues | nb_producers | Queues will be configured based on the |
433 | | | | user requested sched type list(--stlist)|
434 +---+--------------+----------------+-----------------------------------------+
435 | 2 | nb_producers | >= 1 | Selected through --plcores command line |
437 +---+--------------+----------------+-----------------------------------------+
438 | 3 | nb_workers | >= 1 | Selected through --wlcores command line |
440 +---+--------------+----------------+-----------------------------------------+
441 | 4 | nb_ports | nb_workers + | Workers use port 0 to port n-1. |
442 | | | nb_producers | Producers use port n to port p |
443 +---+--------------+----------------+-----------------------------------------+
445 .. _figure_eventdev_perf_atq_test:
447 .. figure:: img/eventdev_perf_atq_test.*
449 perf all types queue test operation.
452 The ``all types queues(atq)`` perf test configures the eventdev with Q queues
453 and P ports, where Q and P is a function of the number of workers and number of
454 producers as mentioned in :numref:`table_eventdev_perf_atq_test`.
457 The atq queue test functions as same as ``perf_queue`` test. The difference
458 is, It uses, ``all type queue scheme`` instead of separate queues for each
459 stage and thus reduces the number of queues required to realize the use case
460 and enables flow pinning as the event does not move to the next queue.
466 Supported application command line options are following::
481 --prod_type_timerdev_burst
492 Example command to run perf ``all types queue`` test:
494 .. code-block:: console
496 sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
497 --test=perf_atq --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
499 Example command to run perf ``all types queue`` test with event timer adapter:
501 .. code-block:: console
503 sudo build/app/dpdk-test-eventdev --vdev="event_octeontx" -- \
504 --wlcores 4 --plcores 12 --test perf_atq --verbose 20 \
505 --stlist=a --prod_type_timerdev --fwd_latency
511 This is a pipeline test case that aims at testing the following:
513 #. Measure the end-to-end performance of an event dev with a ethernet dev.
514 #. Maintain packet ordering from Rx to Tx.
516 .. _table_eventdev_pipeline_queue_test:
518 .. table:: Pipeline queue test eventdev configuration.
520 +---+--------------+----------------+-----------------------------------------+
521 | # | Items | Value | Comments |
523 +===+==============+================+=========================================+
524 | 1 | nb_queues | (nb_producers | Queues will be configured based on the |
525 | | | * nb_stages) + | user requested sched type list(--stlist)|
526 | | | nb_producers | At the last stage of the schedule list |
527 | | | | the event is enqueued onto per port |
528 | | | | unique queue which is then Transmitted. |
529 +---+--------------+----------------+-----------------------------------------+
530 | 2 | nb_producers | >= 1 | Producers will be configured based on |
531 | | | | the number of detected ethernet devices.|
532 | | | | Each ethdev will be configured as an Rx |
534 +---+--------------+----------------+-----------------------------------------+
535 | 3 | nb_workers | >= 1 | Selected through --wlcores command line |
537 +---+--------------+----------------+-----------------------------------------+
538 | 4 | nb_ports | nb_workers + | Workers use port 0 to port n. |
539 | | | (nb_produces * | Producers use port n+1 to port n+m, |
540 | | | 2) | depending on the Rx adapter capability. |
541 | | | | Consumers use port n+m+1 to port n+o |
542 | | | | depending on the Tx adapter capability. |
543 +---+--------------+----------------+-----------------------------------------+
545 .. _figure_eventdev_pipeline_queue_test_generic:
547 .. figure:: img/eventdev_pipeline_queue_test_generic.*
549 .. _figure_eventdev_pipeline_queue_test_internal_port:
551 .. figure:: img/eventdev_pipeline_queue_test_internal_port.*
553 pipeline queue test operation.
555 The pipeline queue test configures the eventdev with Q queues and P ports,
556 where Q and P is a function of the number of workers, the number of producers
557 and number of stages as mentioned in :numref:`table_eventdev_pipeline_queue_test`.
559 The user can choose the number of workers and number of stages through the
560 ``--wlcores`` and the ``--stlist`` application command line arguments
563 The number of producers depends on the number of ethernet devices detected and
564 each ethernet device is configured as a event_eth_rx_adapter that acts as a
567 The producer(s) injects the events to eventdev based the first stage sched type
568 list requested by the user through ``--stlist`` the command line argument.
570 Based on the number of stages to process(selected through ``--stlist``),
571 The application forwards the event to next upstream queue and when it reaches
572 the last stage in the pipeline if the event type is ``atomic`` it is enqueued
573 onto ethdev Tx queue else to maintain ordering the event type is set to
574 ``atomic`` and enqueued onto the last stage queue.
576 If the ethdev and eventdev pair have ``RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT``
577 capability then the worker cores enqueue the packets to the eventdev directly
578 using ``rte_event_eth_tx_adapter_enqueue`` else the worker cores enqueue the
579 packet onto the ``SINGLE_LINK_QUEUE`` that is managed by the Tx adapter.
580 The Tx adapter dequeues the packet and transmits it.
582 On packet Tx, application increments the number events processed and print
583 periodically in one second to get the number of events processed in one
590 Supported application command line options are following::
605 * The ``--prod_type_ethdev`` is mandatory for running this test.
610 Example command to run pipeline queue test:
612 .. code-block:: console
614 sudo build/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \
615 --test=pipeline_queue --wlcore=1 --prod_type_ethdev --stlist=a
621 This is a pipeline test case that aims at testing the following with
622 ``all types queue`` eventdev scheme.
624 #. Measure the end-to-end performance of an event dev with a ethernet dev.
625 #. Maintain packet ordering from Rx to Tx.
627 .. _table_eventdev_pipeline_atq_test:
629 .. table:: Pipeline atq test eventdev configuration.
631 +---+--------------+----------------+-----------------------------------------+
632 | # | Items | Value | Comments |
634 +===+==============+================+=========================================+
635 | 1 | nb_queues | nb_producers + | Queues will be configured based on the |
636 | | | x | user requested sched type list(--stlist)|
637 | | | | where x = nb_producers in generic |
638 | | | | pipeline and 0 if all the ethdev |
639 | | | | being used have Internal port capability|
640 +---+--------------+----------------+-----------------------------------------+
641 | 2 | nb_producers | >= 1 | Producers will be configured based on |
642 | | | | the number of detected ethernet devices.|
643 | | | | Each ethdev will be configured as an Rx |
645 +---+--------------+----------------+-----------------------------------------+
646 | 3 | nb_workers | >= 1 | Selected through --wlcores command line |
648 +---+--------------+----------------+-----------------------------------------+
649 | 4 | nb_ports | nb_workers + | Workers use port 0 to port n. |
650 | | | nb_producers + | Producers use port n+1 to port n+m, |
651 | | | x | depending on the Rx adapter capability. |
652 | | | | x = nb_producers in generic pipeline and|
653 | | | | 0 if all the ethdev being used have |
654 | | | | Internal port capability. |
655 | | | | Consumers may use port n+m+1 to port n+o|
656 | | | | depending on the Tx adapter capability. |
657 +---+--------------+----------------+-----------------------------------------+
659 .. _figure_eventdev_pipeline_atq_test_generic:
661 .. figure:: img/eventdev_pipeline_atq_test_generic.*
663 .. _figure_eventdev_pipeline_atq_test_internal_port:
665 .. figure:: img/eventdev_pipeline_atq_test_internal_port.*
667 pipeline atq test operation.
669 The pipeline atq test configures the eventdev with Q queues and P ports,
670 where Q and P is a function of the number of workers, the number of producers
671 and number of stages as mentioned in :numref:`table_eventdev_pipeline_atq_test`.
673 The atq queue test functions as same as ``pipeline_queue`` test. The difference
674 is, It uses, ``all type queue scheme`` instead of separate queues for each
675 stage and thus reduces the number of queues required to realize the use case.
681 Supported application command line options are following::
696 * The ``--prod_type_ethdev`` is mandatory for running this test.
701 Example command to run pipeline queue test:
703 .. code-block:: console
705 sudo build/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \
706 --test=pipeline_atq --wlcore=1 --prod_type_ethdev --stlist=a