156702cdb493714c61e705b48eb7dfdbc8f0ecfd
[dpdk.git] / doc / guides / tools / testeventdev.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2017 Cavium, Inc
3
4 dpdk-test-eventdev Application
5 ==============================
6
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
11 devices.
12
13 Compiling the Application
14 -------------------------
15
16 **Build the application**
17
18 Execute the ``dpdk-setup.sh`` script to build the DPDK library together with the
19 ``dpdk-test-eventdev`` application.
20
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.
26
27 Running the Application
28 -----------------------
29
30 The application has a number of command line options:
31
32 .. code-block:: console
33
34    dpdk-test-eventdev [EAL Options] -- [application options]
35
36 EAL Options
37 ~~~~~~~~~~~
38
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.
42
43 *   ``-c <COREMASK>`` or ``-l <CORELIST>``
44
45         Set the hexadecimal bitmask of the cores to run on. The corelist is a
46         list of cores to use.
47
48 *   ``--vdev <driver><id>``
49
50         Add a virtual eventdev device.
51
52 Application Options
53 ~~~~~~~~~~~~~~~~~~~
54
55 The following are the application command-line options:
56
57 * ``--verbose``
58
59         Set verbose level. Default is 1. Value > 1 displays more details.
60
61 * ``--dev <n>``
62
63         Set the device id of the event device.
64
65 * ``--test <name>``
66
67         Set test name, where ``name`` is one of the following::
68
69          order_queue
70          order_atq
71          perf_queue
72          perf_atq
73
74 * ``--socket_id <n>``
75
76         Set the socket id of the application resources.
77
78 * ``--pool-sz <n>``
79
80         Set the number of mbufs to be allocated from the mempool.
81
82 * ``--plcores <CORELIST>``
83
84         Set the list of cores to be used as producers.
85
86 * ``--wlcores <CORELIST>``
87
88         Set the list of cores to be used as workers.
89
90 * ``--stlist <type_list>``
91
92         Set the scheduled type of each stage where ``type_list`` size
93         determines the number of stages used in the test application.
94         Each type_list member can be one of the following::
95
96             P or p : Parallel schedule type
97             O or o : Ordered schedule type
98             A or a : Atomic schedule type
99
100         Application expects the ``type_list`` in comma separated form (i.e. ``--stlist o,a,a,a``)
101
102 * ``--nb_flows <n>``
103
104         Set the number of flows to produce.
105
106 * ``--nb_pkts <n>``
107
108         Set the number of packets to produce. 0 implies no limit.
109
110 * ``--worker_deq_depth <n>``
111
112         Set the dequeue depth of the worker.
113
114 * ``--fwd_latency``
115
116         Perform forward latency measurement.
117
118 * ``--queue_priority``
119
120         Enable queue priority.
121
122 * ``--prod_type_ethdev``
123
124         Use ethernet device as producer.
125
126 * ``--prod_type_timerdev``
127
128         Use event timer adapter as producer.
129
130  * ``--prod_type_timerdev_burst``
131
132         Use burst mode event timer adapter as producer.
133
134 Eventdev Tests
135 --------------
136
137 ORDER_QUEUE Test
138 ~~~~~~~~~~~~~~~~
139
140 This is a functional test case that aims at testing the following:
141
142 #. Verify the ingress order maintenance.
143 #. Verify the exclusive(atomic) access to given atomic flow per eventdev port.
144
145 .. _table_eventdev_order_queue_test:
146
147 .. table:: Order queue test eventdev configuration.
148
149    +---+--------------+----------------+------------------------+
150    | # | Items        | Value          | Comments               |
151    |   |              |                |                        |
152    +===+==============+================+========================+
153    | 1 | nb_queues    | 2              | q0(ordered), q1(atomic)|
154    |   |              |                |                        |
155    +---+--------------+----------------+------------------------+
156    | 2 | nb_producers | 1              |                        |
157    |   |              |                |                        |
158    +---+--------------+----------------+------------------------+
159    | 3 | nb_workers   | >= 1           |                        |
160    |   |              |                |                        |
161    +---+--------------+----------------+------------------------+
162    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to  |
163    |   |              | 1              | port n-1. Producer uses|
164    |   |              |                | port n                 |
165    +---+--------------+----------------+------------------------+
166
167 .. _figure_eventdev_order_queue_test:
168
169 .. figure:: img/eventdev_order_queue_test.*
170
171    order queue test operation.
172
173 The order queue test configures the eventdev with two queues and an event
174 producer to inject the events to q0(ordered) queue. Both q0(ordered) and
175 q1(atomic) are linked to all the workers.
176
177 The event producer maintains a sequence number per flow and injects the events
178 to the ordered queue. The worker receives the events from ordered queue and
179 forwards to atomic queue. Since the events from an ordered queue can be
180 processed in parallel on the different workers, the ingress order of events
181 might have changed on the downstream atomic queue enqueue. On enqueue to the
182 atomic queue, the eventdev PMD driver reorders the event to the original
183 ingress order(i.e producer ingress order).
184
185 When the event is dequeued from the atomic queue by the worker, this test
186 verifies the expected sequence number of associated event per flow by comparing
187 the free running expected sequence number per flow.
188
189 Application options
190 ^^^^^^^^^^^^^^^^^^^
191
192 Supported application command line options are following::
193
194    --verbose
195    --dev
196    --test
197    --socket_id
198    --pool_sz
199    --plcores
200    --wlcores
201    --nb_flows
202    --nb_pkts
203    --worker_deq_depth
204
205 Example
206 ^^^^^^^
207
208 Example command to run order queue test:
209
210 .. code-block:: console
211
212    sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
213                 --test=order_queue --plcores 1 --wlcores 2,3
214
215
216 ORDER_ATQ Test
217 ~~~~~~~~~~~~~~
218
219 This test verifies the same aspects of ``order_queue`` test, the difference is
220 the number of queues used, this test operates on a single ``all types queue(atq)``
221 instead of two different queues for ordered and atomic.
222
223 .. _table_eventdev_order_atq_test:
224
225 .. table:: Order all types queue test eventdev configuration.
226
227    +---+--------------+----------------+------------------------+
228    | # | Items        | Value          | Comments               |
229    |   |              |                |                        |
230    +===+==============+================+========================+
231    | 1 | nb_queues    | 1              | q0(all types queue)    |
232    |   |              |                |                        |
233    +---+--------------+----------------+------------------------+
234    | 2 | nb_producers | 1              |                        |
235    |   |              |                |                        |
236    +---+--------------+----------------+------------------------+
237    | 3 | nb_workers   | >= 1           |                        |
238    |   |              |                |                        |
239    +---+--------------+----------------+------------------------+
240    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to  |
241    |   |              | 1              | port n-1.Producer uses |
242    |   |              |                | port n.                |
243    +---+--------------+----------------+------------------------+
244
245 .. _figure_eventdev_order_atq_test:
246
247 .. figure:: img/eventdev_order_atq_test.*
248
249    order all types queue test operation.
250
251 Application options
252 ^^^^^^^^^^^^^^^^^^^
253
254 Supported application command line options are following::
255
256    --verbose
257    --dev
258    --test
259    --socket_id
260    --pool_sz
261    --plcores
262    --wlcores
263    --nb_flows
264    --nb_pkts
265    --worker_deq_depth
266
267 Example
268 ^^^^^^^
269
270 Example command to run order ``all types queue`` test:
271
272 .. code-block:: console
273
274    sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
275                         --test=order_atq --plcores 1 --wlcores 2,3
276
277
278 PERF_QUEUE Test
279 ~~~~~~~~~~~~~~~
280
281 This is a performance test case that aims at testing the following:
282
283 #. Measure the number of events can be processed in a second.
284 #. Measure the latency to forward an event.
285
286 .. _table_eventdev_perf_queue_test:
287
288 .. table:: Perf queue test eventdev configuration.
289
290    +---+--------------+----------------+-----------------------------------------+
291    | # | Items        | Value          | Comments                                |
292    |   |              |                |                                         |
293    +===+==============+================+=========================================+
294    | 1 | nb_queues    | nb_producers * | Queues will be configured based on the  |
295    |   |              | nb_stages      | user requested sched type list(--stlist)|
296    +---+--------------+----------------+-----------------------------------------+
297    | 2 | nb_producers | >= 1           | Selected through --plcores command line |
298    |   |              |                | argument.                               |
299    +---+--------------+----------------+-----------------------------------------+
300    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
301    |   |              |                | argument                                |
302    +---+--------------+----------------+-----------------------------------------+
303    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n-1.         |
304    |   |              | nb_producers   | Producers use port n to port p          |
305    +---+--------------+----------------+-----------------------------------------+
306
307 .. _figure_eventdev_perf_queue_test:
308
309 .. figure:: img/eventdev_perf_queue_test.*
310
311    perf queue test operation.
312
313 The perf queue test configures the eventdev with Q queues and P ports, where
314 Q and P is a function of the number of workers, the number of producers and
315 number of stages as mentioned in :numref:`table_eventdev_perf_queue_test`.
316
317 The user can choose the number of workers, the number of producers and number of
318 stages through the ``--wlcores``, ``--plcores`` and the ``--stlist`` application
319 command line arguments respectively.
320
321 The producer(s) injects the events to eventdev based the first stage sched type
322 list requested by the user through ``--stlist`` the command line argument.
323
324 Based on the number of stages to process(selected through ``--stlist``),
325 The application forwards the event to next upstream queue and terminates when it
326 reaches the last stage in the pipeline. On event termination, application
327 increments the number events processed and print periodically in one second
328 to get the number of events processed in one second.
329
330 When ``--fwd_latency`` command line option selected, the application inserts
331 the timestamp in the event on the first stage and then on termination, it
332 updates the number of cycles to forward a packet. The application uses this
333 value to compute the average latency to a forward packet.
334
335 When ``--prod_type_ethdev`` command line option is selected, the application
336 uses the probed ethernet devices as producers by configuring them as Rx
337 adapters instead of using synthetic producers.
338
339 Application options
340 ^^^^^^^^^^^^^^^^^^^
341
342 Supported application command line options are following::
343
344         --verbose
345         --dev
346         --test
347         --socket_id
348         --pool_sz
349         --plcores
350         --wlcores
351         --stlist
352         --nb_flows
353         --nb_pkts
354         --worker_deq_depth
355         --fwd_latency
356         --queue_priority
357         --prod_type_ethdev
358         --prod_type_timerdev_burst
359         --prod_type_timerdev
360
361 Example
362 ^^^^^^^
363
364 Example command to run perf queue test:
365
366 .. code-block:: console
367
368    sudo build/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \
369         --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
370
371 Example command to run perf queue test with ethernet ports:
372
373 .. code-block:: console
374
375    sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
376         --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --prod_type_ethdev
377
378 Example command to run perf queue test with event timer adapter:
379
380 .. code-block:: console
381
382    sudo  build/app/dpdk-test-eventdev --vdev="event_octeontx" -- \
383                 --wlcores 4 --plcores 12 --test perf_queue --stlist=a \
384                 --prod_type_timerdev --fwd_latency
385
386 PERF_ATQ Test
387 ~~~~~~~~~~~~~~~
388
389 This is a performance test case that aims at testing the following with
390 ``all types queue`` eventdev scheme.
391
392 #. Measure the number of events can be processed in a second.
393 #. Measure the latency to forward an event.
394
395 .. _table_eventdev_perf_atq_test:
396
397 .. table:: Perf all types queue test eventdev configuration.
398
399    +---+--------------+----------------+-----------------------------------------+
400    | # | Items        | Value          | Comments                                |
401    |   |              |                |                                         |
402    +===+==============+================+=========================================+
403    | 1 | nb_queues    | nb_producers   | Queues will be configured based on the  |
404    |   |              |                | user requested sched type list(--stlist)|
405    +---+--------------+----------------+-----------------------------------------+
406    | 2 | nb_producers | >= 1           | Selected through --plcores command line |
407    |   |              |                | argument.                               |
408    +---+--------------+----------------+-----------------------------------------+
409    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
410    |   |              |                | argument                                |
411    +---+--------------+----------------+-----------------------------------------+
412    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n-1.         |
413    |   |              | nb_producers   | Producers use port n to port p          |
414    +---+--------------+----------------+-----------------------------------------+
415
416 .. _figure_eventdev_perf_atq_test:
417
418 .. figure:: img/eventdev_perf_atq_test.*
419
420    perf all types queue test operation.
421
422
423 The ``all types queues(atq)`` perf test configures the eventdev with Q queues
424 and P ports, where Q and P is a function of the number of workers and number of
425 producers as mentioned in :numref:`table_eventdev_perf_atq_test`.
426
427
428 The atq queue test functions as same as ``perf_queue`` test. The difference
429 is, It uses, ``all type queue scheme`` instead of separate queues for each
430 stage and thus reduces the number of queues required to realize the use case
431 and enables flow pinning as the event does not move to the next queue.
432
433
434 Application options
435 ^^^^^^^^^^^^^^^^^^^
436
437 Supported application command line options are following::
438
439         --verbose
440         --dev
441         --test
442         --socket_id
443         --pool_sz
444         --plcores
445         --wlcores
446         --stlist
447         --nb_flows
448         --nb_pkts
449         --worker_deq_depth
450         --fwd_latency
451         --prod_type_ethdev
452         --prod_type_timerdev_burst
453         --prod_type_timerdev
454
455 Example
456 ^^^^^^^
457
458 Example command to run perf ``all types queue`` test:
459
460 .. code-block:: console
461
462    sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
463                 --test=perf_atq --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
464
465 Example command to run perf ``all types queue`` test with event timer adapter:
466
467 .. code-block:: console
468
469    sudo  build/app/dpdk-test-eventdev --vdev="event_octeontx" -- \
470                 --wlcores 4 --plcores 12 --test perf_atq --verbose 20 \
471                 --stlist=a --prod_type_timerdev --fwd_latency
472
473
474 PIPELINE_QUEUE Test
475 ~~~~~~~~~~~~~~~~~~~
476
477 This is a pipeline test case that aims at testing the following:
478
479 #. Measure the end-to-end performance of an event dev with a ethernet dev.
480 #. Maintain packet ordering from Rx to Tx.
481
482 .. _table_eventdev_pipeline_queue_test:
483
484 .. table:: Pipeline queue test eventdev configuration.
485
486    +---+--------------+----------------+-----------------------------------------+
487    | # | Items        | Value          | Comments                                |
488    |   |              |                |                                         |
489    +===+==============+================+=========================================+
490    | 1 | nb_queues    | (nb_producers  | Queues will be configured based on the  |
491    |   |              | * nb_stages) + | user requested sched type list(--stlist)|
492    |   |              | x              | Here value of x is 1 in generic pipeline|
493    |   |              |                | and nb_producers in lockfree pipeline   |
494    +---+--------------+----------------+-----------------------------------------+
495    | 2 | nb_producers | >= 1           | Producers will be configured based on   |
496    |   |              |                | the number of detected ethernet devices.|
497    |   |              |                | Each ethdev will be configured as an Rx |
498    |   |              |                | adapter.                                |
499    +---+--------------+----------------+-----------------------------------------+
500    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
501    |   |              |                | argument                                |
502    +---+--------------+----------------+-----------------------------------------+
503    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n.           |
504    |   |              | nb_producers   | Producers use port n+1 to port n+m,     |
505    |   |              |                | depending on the Rx adapter capability. |
506    +---+--------------+----------------+-----------------------------------------+
507
508 .. _figure_eventdev_pipeline_queue_test_generic:
509
510 .. figure:: img/eventdev_pipeline_queue_test_generic.*
511
512 .. _figure_eventdev_pipeline_queue_test_lockfree:
513
514 .. figure:: img/eventdev_pipeline_queue_test_lockfree.*
515
516    pipeline queue test operation.
517
518 The pipeline queue test configures the eventdev with Q queues and P ports,
519 where Q and P is a function of the number of workers, the number of producers
520 and number of stages as mentioned in :numref:`table_eventdev_pipeline_queue_test`.
521
522 The user can choose the number of workers and number of stages through the
523 ``--wlcores`` and the ``--stlist`` application command line arguments
524 respectively.
525
526 The number of producers depends on the number of ethernet devices detected and
527 each ethernet device is configured as a event_eth_rx_adapter that acts as a
528 producer.
529
530 The producer(s) injects the events to eventdev based the first stage sched type
531 list requested by the user through ``--stlist`` the command line argument.
532
533 Based on the number of stages to process(selected through ``--stlist``),
534 The application forwards the event to next upstream queue and when it reaches
535 the last stage in the pipeline if the event type is ``atomic`` it is enqueued
536 onto ethdev Tx queue else to maintain ordering the event type is set to
537 ``atomic`` and enqueued onto the last stage queue.
538
539 If the ethernet has ``DEV_TX_OFFLOAD_MT_LOCKFREE`` capability then the worker
540 cores transmit the packets directly. Else the worker cores enqueue the packet
541 onto the ``SINGLE_LINK_QUEUE`` that is managed by a Tx service. The Tx service
542 dequeues the packet and transmits it.
543
544 On packet Tx, application increments the number events processed and print
545 periodically in one second to get the number of events processed in one
546 second.
547
548
549 Application options
550 ^^^^^^^^^^^^^^^^^^^
551
552 Supported application command line options are following::
553
554         --verbose
555         --dev
556         --test
557         --socket_id
558         --pool_sz
559         --wlcores
560         --stlist
561         --worker_deq_depth
562         --prod_type_ethdev
563
564
565 .. Note::
566
567     * The ``--prod_type_ethdev`` is mandatory for running this test.
568
569 Example
570 ^^^^^^^
571
572 Example command to run pipeline queue test:
573
574 .. code-block:: console
575
576     sudo build/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \
577         --test=pipeline_queue --wlcore=1 --prod_type_ethdev --stlist=a
578
579
580 PIPELINE_ATQ Test
581 ~~~~~~~~~~~~~~~~~~~
582
583 This is a pipeline test case that aims at testing the following with
584 ``all types queue`` eventdev scheme.
585
586 #. Measure the end-to-end performance of an event dev with a ethernet dev.
587 #. Maintain packet ordering from Rx to Tx.
588
589 .. _table_eventdev_pipeline_atq_test:
590
591 .. table:: Pipeline atq test eventdev configuration.
592
593    +---+--------------+----------------+-----------------------------------------+
594    | # | Items        | Value          | Comments                                |
595    |   |              |                |                                         |
596    +===+==============+================+=========================================+
597    | 1 | nb_queues    | nb_producers + | Queues will be configured based on the  |
598    |   |              | x              | user requested sched type list(--stlist)|
599    |   |              |                | where x = 1 in generic pipeline and 0   |
600    |   |              |                | in lockfree pipeline                    |
601    +---+--------------+----------------+-----------------------------------------+
602    | 2 | nb_producers | >= 1           | Producers will be configured based on   |
603    |   |              |                | the number of detected ethernet devices.|
604    |   |              |                | Each ethdev will be configured as an Rx |
605    |   |              |                | adapter.                                |
606    +---+--------------+----------------+-----------------------------------------+
607    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
608    |   |              |                | argument                                |
609    +---+--------------+----------------+-----------------------------------------+
610    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n.           |
611    |   |              | nb_producers   | Producers use port n+1 to port n+m,     |
612    |   |              |                | depending on the Rx adapter capability. |
613    +---+--------------+----------------+-----------------------------------------+
614
615 .. _figure_eventdev_pipeline_atq_test_generic:
616
617 .. figure:: img/eventdev_pipeline_atq_test_generic.*
618
619 .. _figure_eventdev_pipeline_atq_test_lockfree:
620
621 .. figure:: img/eventdev_pipeline_atq_test_lockfree.*
622
623    pipeline atq test operation.
624
625 The pipeline atq test configures the eventdev with Q queues and P ports,
626 where Q and P is a function of the number of workers, the number of producers
627 and number of stages as mentioned in :numref:`table_eventdev_pipeline_atq_test`.
628
629 The atq queue test functions as same as ``pipeline_queue`` test. The difference
630 is, It uses, ``all type queue scheme`` instead of separate queues for each
631 stage and thus reduces the number of queues required to realize the use case.
632
633
634 Application options
635 ^^^^^^^^^^^^^^^^^^^
636
637 Supported application command line options are following::
638
639         --verbose
640         --dev
641         --test
642         --socket_id
643         --pool_sz
644         --wlcores
645         --stlist
646         --worker_deq_depth
647         --prod_type_ethdev
648
649
650 .. Note::
651
652     * The ``--prod_type_ethdev`` is mandatory for running this test.
653
654 Example
655 ^^^^^^^
656
657 Example command to run pipeline queue test:
658
659 .. code-block:: console
660
661     sudo build/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \
662         --test=pipeline_atq --wlcore=1 --prod_type_ethdev --stlist=a