New upstream version 18.08
[deb_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  * ``--timer_tick_nsec``
135
136         Used to dictate number of nano seconds between bucket traversal of the
137         event timer adapter. Refer `rte_event_timer_adapter_conf`.
138
139  * ``--max_tmo_nsec``
140
141         Used to configure event timer adapter max arm timeout in nano seconds.
142
143  * ``--expiry_nsec``
144
145         Dictate the number of nano seconds after which the event timer expires.
146
147  * ``--nb_timers``
148
149         Number of event timers each producer core will generate.
150
151  * ``--nb_timer_adptrs``
152
153         Number of event timer adapters to be used. Each adapter is used in
154         round robin manner by the producer cores.
155
156 Eventdev Tests
157 --------------
158
159 ORDER_QUEUE Test
160 ~~~~~~~~~~~~~~~~
161
162 This is a functional test case that aims at testing the following:
163
164 #. Verify the ingress order maintenance.
165 #. Verify the exclusive(atomic) access to given atomic flow per eventdev port.
166
167 .. _table_eventdev_order_queue_test:
168
169 .. table:: Order queue test eventdev configuration.
170
171    +---+--------------+----------------+------------------------+
172    | # | Items        | Value          | Comments               |
173    |   |              |                |                        |
174    +===+==============+================+========================+
175    | 1 | nb_queues    | 2              | q0(ordered), q1(atomic)|
176    |   |              |                |                        |
177    +---+--------------+----------------+------------------------+
178    | 2 | nb_producers | 1              |                        |
179    |   |              |                |                        |
180    +---+--------------+----------------+------------------------+
181    | 3 | nb_workers   | >= 1           |                        |
182    |   |              |                |                        |
183    +---+--------------+----------------+------------------------+
184    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to  |
185    |   |              | 1              | port n-1. Producer uses|
186    |   |              |                | port n                 |
187    +---+--------------+----------------+------------------------+
188
189 .. _figure_eventdev_order_queue_test:
190
191 .. figure:: img/eventdev_order_queue_test.*
192
193    order queue test operation.
194
195 The order queue test configures the eventdev with two queues and an event
196 producer to inject the events to q0(ordered) queue. Both q0(ordered) and
197 q1(atomic) are linked to all the workers.
198
199 The event producer maintains a sequence number per flow and injects the events
200 to the ordered queue. The worker receives the events from ordered queue and
201 forwards to atomic queue. Since the events from an ordered queue can be
202 processed in parallel on the different workers, the ingress order of events
203 might have changed on the downstream atomic queue enqueue. On enqueue to the
204 atomic queue, the eventdev PMD driver reorders the event to the original
205 ingress order(i.e producer ingress order).
206
207 When the event is dequeued from the atomic queue by the worker, this test
208 verifies the expected sequence number of associated event per flow by comparing
209 the free running expected sequence number per flow.
210
211 Application options
212 ^^^^^^^^^^^^^^^^^^^
213
214 Supported application command line options are following::
215
216    --verbose
217    --dev
218    --test
219    --socket_id
220    --pool_sz
221    --plcores
222    --wlcores
223    --nb_flows
224    --nb_pkts
225    --worker_deq_depth
226
227 Example
228 ^^^^^^^
229
230 Example command to run order queue test:
231
232 .. code-block:: console
233
234    sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
235                 --test=order_queue --plcores 1 --wlcores 2,3
236
237
238 ORDER_ATQ Test
239 ~~~~~~~~~~~~~~
240
241 This test verifies the same aspects of ``order_queue`` test, the difference is
242 the number of queues used, this test operates on a single ``all types queue(atq)``
243 instead of two different queues for ordered and atomic.
244
245 .. _table_eventdev_order_atq_test:
246
247 .. table:: Order all types queue test eventdev configuration.
248
249    +---+--------------+----------------+------------------------+
250    | # | Items        | Value          | Comments               |
251    |   |              |                |                        |
252    +===+==============+================+========================+
253    | 1 | nb_queues    | 1              | q0(all types queue)    |
254    |   |              |                |                        |
255    +---+--------------+----------------+------------------------+
256    | 2 | nb_producers | 1              |                        |
257    |   |              |                |                        |
258    +---+--------------+----------------+------------------------+
259    | 3 | nb_workers   | >= 1           |                        |
260    |   |              |                |                        |
261    +---+--------------+----------------+------------------------+
262    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to  |
263    |   |              | 1              | port n-1.Producer uses |
264    |   |              |                | port n.                |
265    +---+--------------+----------------+------------------------+
266
267 .. _figure_eventdev_order_atq_test:
268
269 .. figure:: img/eventdev_order_atq_test.*
270
271    order all types queue test operation.
272
273 Application options
274 ^^^^^^^^^^^^^^^^^^^
275
276 Supported application command line options are following::
277
278    --verbose
279    --dev
280    --test
281    --socket_id
282    --pool_sz
283    --plcores
284    --wlcores
285    --nb_flows
286    --nb_pkts
287    --worker_deq_depth
288
289 Example
290 ^^^^^^^
291
292 Example command to run order ``all types queue`` test:
293
294 .. code-block:: console
295
296    sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
297                         --test=order_atq --plcores 1 --wlcores 2,3
298
299
300 PERF_QUEUE Test
301 ~~~~~~~~~~~~~~~
302
303 This is a performance test case that aims at testing the following:
304
305 #. Measure the number of events can be processed in a second.
306 #. Measure the latency to forward an event.
307
308 .. _table_eventdev_perf_queue_test:
309
310 .. table:: Perf queue test eventdev configuration.
311
312    +---+--------------+----------------+-----------------------------------------+
313    | # | Items        | Value          | Comments                                |
314    |   |              |                |                                         |
315    +===+==============+================+=========================================+
316    | 1 | nb_queues    | nb_producers * | Queues will be configured based on the  |
317    |   |              | nb_stages      | user requested sched type list(--stlist)|
318    +---+--------------+----------------+-----------------------------------------+
319    | 2 | nb_producers | >= 1           | Selected through --plcores command line |
320    |   |              |                | argument.                               |
321    +---+--------------+----------------+-----------------------------------------+
322    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
323    |   |              |                | argument                                |
324    +---+--------------+----------------+-----------------------------------------+
325    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n-1.         |
326    |   |              | nb_producers   | Producers use port n to port p          |
327    +---+--------------+----------------+-----------------------------------------+
328
329 .. _figure_eventdev_perf_queue_test:
330
331 .. figure:: img/eventdev_perf_queue_test.*
332
333    perf queue test operation.
334
335 The perf queue test configures the eventdev with Q queues and P ports, where
336 Q and P is a function of the number of workers, the number of producers and
337 number of stages as mentioned in :numref:`table_eventdev_perf_queue_test`.
338
339 The user can choose the number of workers, the number of producers and number of
340 stages through the ``--wlcores``, ``--plcores`` and the ``--stlist`` application
341 command line arguments respectively.
342
343 The producer(s) injects the events to eventdev based the first stage sched type
344 list requested by the user through ``--stlist`` the command line argument.
345
346 Based on the number of stages to process(selected through ``--stlist``),
347 The application forwards the event to next upstream queue and terminates when it
348 reaches the last stage in the pipeline. On event termination, application
349 increments the number events processed and print periodically in one second
350 to get the number of events processed in one second.
351
352 When ``--fwd_latency`` command line option selected, the application inserts
353 the timestamp in the event on the first stage and then on termination, it
354 updates the number of cycles to forward a packet. The application uses this
355 value to compute the average latency to a forward packet.
356
357 When ``--prod_type_ethdev`` command line option is selected, the application
358 uses the probed ethernet devices as producers by configuring them as Rx
359 adapters instead of using synthetic producers.
360
361 Application options
362 ^^^^^^^^^^^^^^^^^^^
363
364 Supported application command line options are following::
365
366         --verbose
367         --dev
368         --test
369         --socket_id
370         --pool_sz
371         --plcores
372         --wlcores
373         --stlist
374         --nb_flows
375         --nb_pkts
376         --worker_deq_depth
377         --fwd_latency
378         --queue_priority
379         --prod_type_ethdev
380         --prod_type_timerdev_burst
381         --prod_type_timerdev
382         --timer_tick_nsec
383         --max_tmo_nsec
384         --expiry_nsec
385         --nb_timers
386         --nb_timer_adptrs
387
388 Example
389 ^^^^^^^
390
391 Example command to run perf queue test:
392
393 .. code-block:: console
394
395    sudo build/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \
396         --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
397
398 Example command to run perf queue test with ethernet ports:
399
400 .. code-block:: console
401
402    sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
403         --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --prod_type_ethdev
404
405 Example command to run perf queue test with event timer adapter:
406
407 .. code-block:: console
408
409    sudo  build/app/dpdk-test-eventdev --vdev="event_octeontx" -- \
410                 --wlcores 4 --plcores 12 --test perf_queue --stlist=a \
411                 --prod_type_timerdev --fwd_latency
412
413 PERF_ATQ Test
414 ~~~~~~~~~~~~~~~
415
416 This is a performance test case that aims at testing the following with
417 ``all types queue`` eventdev scheme.
418
419 #. Measure the number of events can be processed in a second.
420 #. Measure the latency to forward an event.
421
422 .. _table_eventdev_perf_atq_test:
423
424 .. table:: Perf all types queue test eventdev configuration.
425
426    +---+--------------+----------------+-----------------------------------------+
427    | # | Items        | Value          | Comments                                |
428    |   |              |                |                                         |
429    +===+==============+================+=========================================+
430    | 1 | nb_queues    | nb_producers   | Queues will be configured based on the  |
431    |   |              |                | user requested sched type list(--stlist)|
432    +---+--------------+----------------+-----------------------------------------+
433    | 2 | nb_producers | >= 1           | Selected through --plcores command line |
434    |   |              |                | argument.                               |
435    +---+--------------+----------------+-----------------------------------------+
436    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
437    |   |              |                | argument                                |
438    +---+--------------+----------------+-----------------------------------------+
439    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n-1.         |
440    |   |              | nb_producers   | Producers use port n to port p          |
441    +---+--------------+----------------+-----------------------------------------+
442
443 .. _figure_eventdev_perf_atq_test:
444
445 .. figure:: img/eventdev_perf_atq_test.*
446
447    perf all types queue test operation.
448
449
450 The ``all types queues(atq)`` perf test configures the eventdev with Q queues
451 and P ports, where Q and P is a function of the number of workers and number of
452 producers as mentioned in :numref:`table_eventdev_perf_atq_test`.
453
454
455 The atq queue test functions as same as ``perf_queue`` test. The difference
456 is, It uses, ``all type queue scheme`` instead of separate queues for each
457 stage and thus reduces the number of queues required to realize the use case
458 and enables flow pinning as the event does not move to the next queue.
459
460
461 Application options
462 ^^^^^^^^^^^^^^^^^^^
463
464 Supported application command line options are following::
465
466         --verbose
467         --dev
468         --test
469         --socket_id
470         --pool_sz
471         --plcores
472         --wlcores
473         --stlist
474         --nb_flows
475         --nb_pkts
476         --worker_deq_depth
477         --fwd_latency
478         --prod_type_ethdev
479         --prod_type_timerdev_burst
480         --prod_type_timerdev
481         --timer_tick_nsec
482         --max_tmo_nsec
483         --expiry_nsec
484         --nb_timers
485         --nb_timer_adptrs
486
487 Example
488 ^^^^^^^
489
490 Example command to run perf ``all types queue`` test:
491
492 .. code-block:: console
493
494    sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
495                 --test=perf_atq --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
496
497 Example command to run perf ``all types queue`` test with event timer adapter:
498
499 .. code-block:: console
500
501    sudo  build/app/dpdk-test-eventdev --vdev="event_octeontx" -- \
502                 --wlcores 4 --plcores 12 --test perf_atq --verbose 20 \
503                 --stlist=a --prod_type_timerdev --fwd_latency
504
505
506 PIPELINE_QUEUE Test
507 ~~~~~~~~~~~~~~~~~~~
508
509 This is a pipeline test case that aims at testing the following:
510
511 #. Measure the end-to-end performance of an event dev with a ethernet dev.
512 #. Maintain packet ordering from Rx to Tx.
513
514 .. _table_eventdev_pipeline_queue_test:
515
516 .. table:: Pipeline queue test eventdev configuration.
517
518    +---+--------------+----------------+-----------------------------------------+
519    | # | Items        | Value          | Comments                                |
520    |   |              |                |                                         |
521    +===+==============+================+=========================================+
522    | 1 | nb_queues    | (nb_producers  | Queues will be configured based on the  |
523    |   |              | * nb_stages) + | user requested sched type list(--stlist)|
524    |   |              | x              | Here value of x is 1 in generic pipeline|
525    |   |              |                | and nb_producers in lockfree pipeline   |
526    +---+--------------+----------------+-----------------------------------------+
527    | 2 | nb_producers | >= 1           | Producers will be configured based on   |
528    |   |              |                | the number of detected ethernet devices.|
529    |   |              |                | Each ethdev will be configured as an Rx |
530    |   |              |                | adapter.                                |
531    +---+--------------+----------------+-----------------------------------------+
532    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
533    |   |              |                | argument                                |
534    +---+--------------+----------------+-----------------------------------------+
535    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n.           |
536    |   |              | nb_producers   | Producers use port n+1 to port n+m,     |
537    |   |              |                | depending on the Rx adapter capability. |
538    +---+--------------+----------------+-----------------------------------------+
539
540 .. _figure_eventdev_pipeline_queue_test_generic:
541
542 .. figure:: img/eventdev_pipeline_queue_test_generic.*
543
544 .. _figure_eventdev_pipeline_queue_test_lockfree:
545
546 .. figure:: img/eventdev_pipeline_queue_test_lockfree.*
547
548    pipeline queue test operation.
549
550 The pipeline queue test configures the eventdev with Q queues and P ports,
551 where Q and P is a function of the number of workers, the number of producers
552 and number of stages as mentioned in :numref:`table_eventdev_pipeline_queue_test`.
553
554 The user can choose the number of workers and number of stages through the
555 ``--wlcores`` and the ``--stlist`` application command line arguments
556 respectively.
557
558 The number of producers depends on the number of ethernet devices detected and
559 each ethernet device is configured as a event_eth_rx_adapter that acts as a
560 producer.
561
562 The producer(s) injects the events to eventdev based the first stage sched type
563 list requested by the user through ``--stlist`` the command line argument.
564
565 Based on the number of stages to process(selected through ``--stlist``),
566 The application forwards the event to next upstream queue and when it reaches
567 the last stage in the pipeline if the event type is ``atomic`` it is enqueued
568 onto ethdev Tx queue else to maintain ordering the event type is set to
569 ``atomic`` and enqueued onto the last stage queue.
570
571 If the ethernet has ``DEV_TX_OFFLOAD_MT_LOCKFREE`` capability then the worker
572 cores transmit the packets directly. Else the worker cores enqueue the packet
573 onto the ``SINGLE_LINK_QUEUE`` that is managed by a Tx service. The Tx service
574 dequeues the packet and transmits it.
575
576 On packet Tx, application increments the number events processed and print
577 periodically in one second to get the number of events processed in one
578 second.
579
580
581 Application options
582 ^^^^^^^^^^^^^^^^^^^
583
584 Supported application command line options are following::
585
586         --verbose
587         --dev
588         --test
589         --socket_id
590         --pool_sz
591         --wlcores
592         --stlist
593         --worker_deq_depth
594         --prod_type_ethdev
595
596
597 .. Note::
598
599     * The ``--prod_type_ethdev`` is mandatory for running this test.
600
601 Example
602 ^^^^^^^
603
604 Example command to run pipeline queue test:
605
606 .. code-block:: console
607
608     sudo build/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \
609         --test=pipeline_queue --wlcore=1 --prod_type_ethdev --stlist=a
610
611
612 PIPELINE_ATQ Test
613 ~~~~~~~~~~~~~~~~~~~
614
615 This is a pipeline test case that aims at testing the following with
616 ``all types queue`` eventdev scheme.
617
618 #. Measure the end-to-end performance of an event dev with a ethernet dev.
619 #. Maintain packet ordering from Rx to Tx.
620
621 .. _table_eventdev_pipeline_atq_test:
622
623 .. table:: Pipeline atq test eventdev configuration.
624
625    +---+--------------+----------------+-----------------------------------------+
626    | # | Items        | Value          | Comments                                |
627    |   |              |                |                                         |
628    +===+==============+================+=========================================+
629    | 1 | nb_queues    | nb_producers + | Queues will be configured based on the  |
630    |   |              | x              | user requested sched type list(--stlist)|
631    |   |              |                | where x = 1 in generic pipeline and 0   |
632    |   |              |                | in lockfree pipeline                    |
633    +---+--------------+----------------+-----------------------------------------+
634    | 2 | nb_producers | >= 1           | Producers will be configured based on   |
635    |   |              |                | the number of detected ethernet devices.|
636    |   |              |                | Each ethdev will be configured as an Rx |
637    |   |              |                | adapter.                                |
638    +---+--------------+----------------+-----------------------------------------+
639    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
640    |   |              |                | argument                                |
641    +---+--------------+----------------+-----------------------------------------+
642    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n.           |
643    |   |              | nb_producers   | Producers use port n+1 to port n+m,     |
644    |   |              |                | depending on the Rx adapter capability. |
645    +---+--------------+----------------+-----------------------------------------+
646
647 .. _figure_eventdev_pipeline_atq_test_generic:
648
649 .. figure:: img/eventdev_pipeline_atq_test_generic.*
650
651 .. _figure_eventdev_pipeline_atq_test_lockfree:
652
653 .. figure:: img/eventdev_pipeline_atq_test_lockfree.*
654
655    pipeline atq test operation.
656
657 The pipeline atq test configures the eventdev with Q queues and P ports,
658 where Q and P is a function of the number of workers, the number of producers
659 and number of stages as mentioned in :numref:`table_eventdev_pipeline_atq_test`.
660
661 The atq queue test functions as same as ``pipeline_queue`` test. The difference
662 is, It uses, ``all type queue scheme`` instead of separate queues for each
663 stage and thus reduces the number of queues required to realize the use case.
664
665
666 Application options
667 ^^^^^^^^^^^^^^^^^^^
668
669 Supported application command line options are following::
670
671         --verbose
672         --dev
673         --test
674         --socket_id
675         --pool_sz
676         --wlcores
677         --stlist
678         --worker_deq_depth
679         --prod_type_ethdev
680
681
682 .. Note::
683
684     * The ``--prod_type_ethdev`` is mandatory for running this test.
685
686 Example
687 ^^^^^^^
688
689 Example command to run pipeline queue test:
690
691 .. code-block:: console
692
693     sudo build/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \
694         --test=pipeline_atq --wlcore=1 --prod_type_ethdev --stlist=a