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.
160 Global dequeue timeout for all the event ports if the provided dequeue
161 timeout is out of the supported range of event device it will be
162 adjusted to the highest/lowest supported dequeue timeout supported.
171 This is a functional test case that aims at testing the following:
173 #. Verify the ingress order maintenance.
174 #. Verify the exclusive(atomic) access to given atomic flow per eventdev port.
176 .. _table_eventdev_order_queue_test:
178 .. table:: Order queue test eventdev configuration.
180 +---+--------------+----------------+------------------------+
181 | # | Items | Value | Comments |
183 +===+==============+================+========================+
184 | 1 | nb_queues | 2 | q0(ordered), q1(atomic)|
186 +---+--------------+----------------+------------------------+
187 | 2 | nb_producers | 1 | |
189 +---+--------------+----------------+------------------------+
190 | 3 | nb_workers | >= 1 | |
192 +---+--------------+----------------+------------------------+
193 | 4 | nb_ports | nb_workers + | Workers use port 0 to |
194 | | | 1 | port n-1. Producer uses|
196 +---+--------------+----------------+------------------------+
198 .. _figure_eventdev_order_queue_test:
200 .. figure:: img/eventdev_order_queue_test.*
202 order queue test operation.
204 The order queue test configures the eventdev with two queues and an event
205 producer to inject the events to q0(ordered) queue. Both q0(ordered) and
206 q1(atomic) are linked to all the workers.
208 The event producer maintains a sequence number per flow and injects the events
209 to the ordered queue. The worker receives the events from ordered queue and
210 forwards to atomic queue. Since the events from an ordered queue can be
211 processed in parallel on the different workers, the ingress order of events
212 might have changed on the downstream atomic queue enqueue. On enqueue to the
213 atomic queue, the eventdev PMD driver reorders the event to the original
214 ingress order(i.e producer ingress order).
216 When the event is dequeued from the atomic queue by the worker, this test
217 verifies the expected sequence number of associated event per flow by comparing
218 the free running expected sequence number per flow.
223 Supported application command line options are following::
240 Example command to run order queue test:
242 .. code-block:: console
244 sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
245 --test=order_queue --plcores 1 --wlcores 2,3
251 This test verifies the same aspects of ``order_queue`` test, the difference is
252 the number of queues used, this test operates on a single ``all types queue(atq)``
253 instead of two different queues for ordered and atomic.
255 .. _table_eventdev_order_atq_test:
257 .. table:: Order all types queue test eventdev configuration.
259 +---+--------------+----------------+------------------------+
260 | # | Items | Value | Comments |
262 +===+==============+================+========================+
263 | 1 | nb_queues | 1 | q0(all types queue) |
265 +---+--------------+----------------+------------------------+
266 | 2 | nb_producers | 1 | |
268 +---+--------------+----------------+------------------------+
269 | 3 | nb_workers | >= 1 | |
271 +---+--------------+----------------+------------------------+
272 | 4 | nb_ports | nb_workers + | Workers use port 0 to |
273 | | | 1 | port n-1.Producer uses |
275 +---+--------------+----------------+------------------------+
277 .. _figure_eventdev_order_atq_test:
279 .. figure:: img/eventdev_order_atq_test.*
281 order all types queue test operation.
286 Supported application command line options are following::
303 Example command to run order ``all types queue`` test:
305 .. code-block:: console
307 sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
308 --test=order_atq --plcores 1 --wlcores 2,3
314 This is a performance test case that aims at testing the following:
316 #. Measure the number of events can be processed in a second.
317 #. Measure the latency to forward an event.
319 .. _table_eventdev_perf_queue_test:
321 .. table:: Perf queue test eventdev configuration.
323 +---+--------------+----------------+-----------------------------------------+
324 | # | Items | Value | Comments |
326 +===+==============+================+=========================================+
327 | 1 | nb_queues | nb_producers * | Queues will be configured based on the |
328 | | | nb_stages | user requested sched type list(--stlist)|
329 +---+--------------+----------------+-----------------------------------------+
330 | 2 | nb_producers | >= 1 | Selected through --plcores command line |
332 +---+--------------+----------------+-----------------------------------------+
333 | 3 | nb_workers | >= 1 | Selected through --wlcores command line |
335 +---+--------------+----------------+-----------------------------------------+
336 | 4 | nb_ports | nb_workers + | Workers use port 0 to port n-1. |
337 | | | nb_producers | Producers use port n to port p |
338 +---+--------------+----------------+-----------------------------------------+
340 .. _figure_eventdev_perf_queue_test:
342 .. figure:: img/eventdev_perf_queue_test.*
344 perf queue test operation.
346 The perf queue test configures the eventdev with Q queues and P ports, where
347 Q and P is a function of the number of workers, the number of producers and
348 number of stages as mentioned in :numref:`table_eventdev_perf_queue_test`.
350 The user can choose the number of workers, the number of producers and number of
351 stages through the ``--wlcores``, ``--plcores`` and the ``--stlist`` application
352 command line arguments respectively.
354 The producer(s) injects the events to eventdev based the first stage sched type
355 list requested by the user through ``--stlist`` the command line argument.
357 Based on the number of stages to process(selected through ``--stlist``),
358 The application forwards the event to next upstream queue and terminates when it
359 reaches the last stage in the pipeline. On event termination, application
360 increments the number events processed and print periodically in one second
361 to get the number of events processed in one second.
363 When ``--fwd_latency`` command line option selected, the application inserts
364 the timestamp in the event on the first stage and then on termination, it
365 updates the number of cycles to forward a packet. The application uses this
366 value to compute the average latency to a forward packet.
368 When ``--prod_type_ethdev`` command line option is selected, the application
369 uses the probed ethernet devices as producers by configuring them as Rx
370 adapters instead of using synthetic producers.
375 Supported application command line options are following::
391 --prod_type_timerdev_burst
403 Example command to run perf queue test:
405 .. code-block:: console
407 sudo build/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \
408 --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
410 Example command to run perf queue test with ethernet ports:
412 .. code-block:: console
414 sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
415 --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --prod_type_ethdev
417 Example command to run perf queue test with event timer adapter:
419 .. code-block:: console
421 sudo build/app/dpdk-test-eventdev --vdev="event_octeontx" -- \
422 --wlcores 4 --plcores 12 --test perf_queue --stlist=a \
423 --prod_type_timerdev --fwd_latency
428 This is a performance test case that aims at testing the following with
429 ``all types queue`` eventdev scheme.
431 #. Measure the number of events can be processed in a second.
432 #. Measure the latency to forward an event.
434 .. _table_eventdev_perf_atq_test:
436 .. table:: Perf all types queue test eventdev configuration.
438 +---+--------------+----------------+-----------------------------------------+
439 | # | Items | Value | Comments |
441 +===+==============+================+=========================================+
442 | 1 | nb_queues | nb_producers | Queues will be configured based on the |
443 | | | | user requested sched type list(--stlist)|
444 +---+--------------+----------------+-----------------------------------------+
445 | 2 | nb_producers | >= 1 | Selected through --plcores command line |
447 +---+--------------+----------------+-----------------------------------------+
448 | 3 | nb_workers | >= 1 | Selected through --wlcores command line |
450 +---+--------------+----------------+-----------------------------------------+
451 | 4 | nb_ports | nb_workers + | Workers use port 0 to port n-1. |
452 | | | nb_producers | Producers use port n to port p |
453 +---+--------------+----------------+-----------------------------------------+
455 .. _figure_eventdev_perf_atq_test:
457 .. figure:: img/eventdev_perf_atq_test.*
459 perf all types queue test operation.
462 The ``all types queues(atq)`` perf test configures the eventdev with Q queues
463 and P ports, where Q and P is a function of the number of workers and number of
464 producers as mentioned in :numref:`table_eventdev_perf_atq_test`.
467 The atq queue test functions as same as ``perf_queue`` test. The difference
468 is, It uses, ``all type queue scheme`` instead of separate queues for each
469 stage and thus reduces the number of queues required to realize the use case
470 and enables flow pinning as the event does not move to the next queue.
476 Supported application command line options are following::
491 --prod_type_timerdev_burst
503 Example command to run perf ``all types queue`` test:
505 .. code-block:: console
507 sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
508 --test=perf_atq --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
510 Example command to run perf ``all types queue`` test with event timer adapter:
512 .. code-block:: console
514 sudo build/app/dpdk-test-eventdev --vdev="event_octeontx" -- \
515 --wlcores 4 --plcores 12 --test perf_atq --verbose 20 \
516 --stlist=a --prod_type_timerdev --fwd_latency
522 This is a pipeline test case that aims at testing the following:
524 #. Measure the end-to-end performance of an event dev with a ethernet dev.
525 #. Maintain packet ordering from Rx to Tx.
527 .. _table_eventdev_pipeline_queue_test:
529 .. table:: Pipeline queue test eventdev configuration.
531 +---+--------------+----------------+-----------------------------------------+
532 | # | Items | Value | Comments |
534 +===+==============+================+=========================================+
535 | 1 | nb_queues | (nb_producers | Queues will be configured based on the |
536 | | | * nb_stages) + | user requested sched type list(--stlist)|
537 | | | nb_producers | At the last stage of the schedule list |
538 | | | | the event is enqueued onto per port |
539 | | | | unique queue which is then Transmitted. |
540 +---+--------------+----------------+-----------------------------------------+
541 | 2 | nb_producers | >= 1 | Producers will be configured based on |
542 | | | | the number of detected ethernet devices.|
543 | | | | Each ethdev will be configured as an Rx |
545 +---+--------------+----------------+-----------------------------------------+
546 | 3 | nb_workers | >= 1 | Selected through --wlcores command line |
548 +---+--------------+----------------+-----------------------------------------+
549 | 4 | nb_ports | nb_workers + | Workers use port 0 to port n. |
550 | | | (nb_produces * | Producers use port n+1 to port n+m, |
551 | | | 2) | depending on the Rx adapter capability. |
552 | | | | Consumers use port n+m+1 to port n+o |
553 | | | | depending on the Tx adapter capability. |
554 +---+--------------+----------------+-----------------------------------------+
556 .. _figure_eventdev_pipeline_queue_test_generic:
558 .. figure:: img/eventdev_pipeline_queue_test_generic.*
560 .. _figure_eventdev_pipeline_queue_test_internal_port:
562 .. figure:: img/eventdev_pipeline_queue_test_internal_port.*
564 pipeline queue test operation.
566 The pipeline queue test configures the eventdev with Q queues and P ports,
567 where Q and P is a function of the number of workers, the number of producers
568 and number of stages as mentioned in :numref:`table_eventdev_pipeline_queue_test`.
570 The user can choose the number of workers and number of stages through the
571 ``--wlcores`` and the ``--stlist`` application command line arguments
574 The number of producers depends on the number of ethernet devices detected and
575 each ethernet device is configured as a event_eth_rx_adapter that acts as a
578 The producer(s) injects the events to eventdev based the first stage sched type
579 list requested by the user through ``--stlist`` the command line argument.
581 Based on the number of stages to process(selected through ``--stlist``),
582 The application forwards the event to next upstream queue and when it reaches
583 the last stage in the pipeline if the event type is ``atomic`` it is enqueued
584 onto ethdev Tx queue else to maintain ordering the event type is set to
585 ``atomic`` and enqueued onto the last stage queue.
587 If the ethdev and eventdev pair have ``RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT``
588 capability then the worker cores enqueue the packets to the eventdev directly
589 using ``rte_event_eth_tx_adapter_enqueue`` else the worker cores enqueue the
590 packet onto the ``SINGLE_LINK_QUEUE`` that is managed by the Tx adapter.
591 The Tx adapter dequeues the packet and transmits it.
593 On packet Tx, application increments the number events processed and print
594 periodically in one second to get the number of events processed in one
601 Supported application command line options are following::
617 * The ``--prod_type_ethdev`` is mandatory for running this test.
622 Example command to run pipeline queue test:
624 .. code-block:: console
626 sudo build/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \
627 --test=pipeline_queue --wlcore=1 --prod_type_ethdev --stlist=a
633 This is a pipeline test case that aims at testing the following with
634 ``all types queue`` eventdev scheme.
636 #. Measure the end-to-end performance of an event dev with a ethernet dev.
637 #. Maintain packet ordering from Rx to Tx.
639 .. _table_eventdev_pipeline_atq_test:
641 .. table:: Pipeline atq test eventdev configuration.
643 +---+--------------+----------------+-----------------------------------------+
644 | # | Items | Value | Comments |
646 +===+==============+================+=========================================+
647 | 1 | nb_queues | nb_producers + | Queues will be configured based on the |
648 | | | x | user requested sched type list(--stlist)|
649 | | | | where x = nb_producers in generic |
650 | | | | pipeline and 0 if all the ethdev |
651 | | | | being used have Internal port capability|
652 +---+--------------+----------------+-----------------------------------------+
653 | 2 | nb_producers | >= 1 | Producers will be configured based on |
654 | | | | the number of detected ethernet devices.|
655 | | | | Each ethdev will be configured as an Rx |
657 +---+--------------+----------------+-----------------------------------------+
658 | 3 | nb_workers | >= 1 | Selected through --wlcores command line |
660 +---+--------------+----------------+-----------------------------------------+
661 | 4 | nb_ports | nb_workers + | Workers use port 0 to port n. |
662 | | | nb_producers + | Producers use port n+1 to port n+m, |
663 | | | x | depending on the Rx adapter capability. |
664 | | | | x = nb_producers in generic pipeline and|
665 | | | | 0 if all the ethdev being used have |
666 | | | | Internal port capability. |
667 | | | | Consumers may use port n+m+1 to port n+o|
668 | | | | depending on the Tx adapter capability. |
669 +---+--------------+----------------+-----------------------------------------+
671 .. _figure_eventdev_pipeline_atq_test_generic:
673 .. figure:: img/eventdev_pipeline_atq_test_generic.*
675 .. _figure_eventdev_pipeline_atq_test_internal_port:
677 .. figure:: img/eventdev_pipeline_atq_test_internal_port.*
679 pipeline atq test operation.
681 The pipeline atq test configures the eventdev with Q queues and P ports,
682 where Q and P is a function of the number of workers, the number of producers
683 and number of stages as mentioned in :numref:`table_eventdev_pipeline_atq_test`.
685 The atq queue test functions as same as ``pipeline_queue`` test. The difference
686 is, It uses, ``all type queue scheme`` instead of separate queues for each
687 stage and thus reduces the number of queues required to realize the use case.
693 Supported application command line options are following::
709 * The ``--prod_type_ethdev`` is mandatory for running this test.
714 Example command to run pipeline queue test:
716 .. code-block:: console
718 sudo build/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \
719 --test=pipeline_atq --wlcore=1 --prod_type_ethdev --stlist=a