34b1c31835b01f8743ed8ac0086260dde8c55eb9
[deb_dpdk.git] / doc / guides / tools / testeventdev.rst
1 ..  BSD LICENSE
2     Copyright(c) 2017 Cavium, Inc. All rights reserved.
3     All rights reserved.
4
5     Redistribution and use in source and binary forms, with or without
6     modification, are permitted provided that the following conditions
7     are met:
8
9     * Redistributions of source code must retain the above copyright
10     notice, this list of conditions and the following disclaimer.
11     * Redistributions in binary form must reproduce the above copyright
12     notice, this list of conditions and the following disclaimer in
13     the documentation and/or other materials provided with the
14     distribution.
15     * Neither the name of Cavium, Inc nor the names of its
16     contributors may be used to endorse or promote products derived
17     from this software without specific prior written permission.
18
19     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22     A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23     OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31 dpdk-test-eventdev Application
32 ==============================
33
34 The ``dpdk-test-eventdev`` tool is a Data Plane Development Kit (DPDK)
35 application that allows exercising various eventdev use cases.
36 This application has a generic framework to add new eventdev based test cases to
37 verify functionality and measure the performance parameters of DPDK eventdev
38 devices.
39
40 Compiling the Application
41 -------------------------
42
43 **Build the application**
44
45 Execute the ``dpdk-setup.sh`` script to build the DPDK library together with the
46 ``dpdk-test-eventdev`` application.
47
48 Initially, the user must select a DPDK target to choose the correct target type
49 and compiler options to use when building the libraries.
50 The user must have all libraries, modules, updates and compilers installed
51 in the system prior to this,
52 as described in the earlier chapters in this Getting Started Guide.
53
54 Running the Application
55 -----------------------
56
57 The application has a number of command line options:
58
59 .. code-block:: console
60
61    dpdk-test-eventdev [EAL Options] -- [application options]
62
63 EAL Options
64 ~~~~~~~~~~~
65
66 The following are the EAL command-line options that can be used in conjunction
67 with the ``dpdk-test-eventdev`` application.
68 See the DPDK Getting Started Guides for more information on these options.
69
70 *   ``-c <COREMASK>`` or ``-l <CORELIST>``
71
72         Set the hexadecimal bitmask of the cores to run on. The corelist is a
73         list of cores to use.
74
75 *   ``--vdev <driver><id>``
76
77         Add a virtual eventdev device.
78
79 Application Options
80 ~~~~~~~~~~~~~~~~~~~
81
82 The following are the application command-line options:
83
84 * ``--verbose``
85
86         Set verbose level. Default is 1. Value > 1 displays more details.
87
88 * ``--dev <n>``
89
90         Set the device id of the event device.
91
92 * ``--test <name>``
93
94         Set test name, where ``name`` is one of the following::
95
96          order_queue
97          order_atq
98          perf_queue
99          perf_atq
100
101 * ``--socket_id <n>``
102
103         Set the socket id of the application resources.
104
105 * ``--pool-sz <n>``
106
107         Set the number of mbufs to be allocated from the mempool.
108
109 * ``--slcore <n>``
110
111         Set the scheduler lcore id.(Valid when eventdev is not RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED capable)
112
113 * ``--plcores <CORELIST>``
114
115         Set the list of cores to be used as producers.
116
117 * ``--wlcores <CORELIST>``
118
119         Set the list of cores to be used as workers.
120
121 * ``--stlist <type_list>``
122
123         Set the scheduled type of each stage where ``type_list`` size
124         determines the number of stages used in the test application.
125         Each type_list member can be one of the following::
126
127             P or p : Parallel schedule type
128             O or o : Ordered schedule type
129             A or a : Atomic schedule type
130
131         Application expects the ``type_list`` in comma separated form (i.e. ``--stlist o,a,a,a``)
132
133 * ``--nb_flows <n>``
134
135         Set the number of flows to produce.
136
137 * ``--nb_pkts <n>``
138
139         Set the number of packets to produce. 0 implies no limit.
140
141 * ``--worker_deq_depth <n>``
142
143         Set the dequeue depth of the worker.
144
145 * ``--fwd_latency``
146
147         Perform forward latency measurement.
148
149 * ``--queue_priority``
150
151         Enable queue priority.
152
153
154 Eventdev Tests
155 --------------
156
157 ORDER_QUEUE Test
158 ~~~~~~~~~~~~~~~~
159
160 This is a functional test case that aims at testing the following:
161
162 #. Verify the ingress order maintenance.
163 #. Verify the exclusive(atomic) access to given atomic flow per eventdev port.
164
165 .. _table_eventdev_order_queue_test:
166
167 .. table:: Order queue test eventdev configuration.
168
169    +---+--------------+----------------+------------------------+
170    | # | Items        | Value          | Comments               |
171    |   |              |                |                        |
172    +===+==============+================+========================+
173    | 1 | nb_queues    | 2              | q0(ordered), q1(atomic)|
174    |   |              |                |                        |
175    +---+--------------+----------------+------------------------+
176    | 2 | nb_producers | 1              |                        |
177    |   |              |                |                        |
178    +---+--------------+----------------+------------------------+
179    | 3 | nb_workers   | >= 1           |                        |
180    |   |              |                |                        |
181    +---+--------------+----------------+------------------------+
182    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to  |
183    |   |              | 1              | port n-1. Producer uses|
184    |   |              |                | port n                 |
185    +---+--------------+----------------+------------------------+
186
187 .. _figure_eventdev_order_queue_test:
188
189 .. figure:: img/eventdev_order_queue_test.*
190
191    order queue test operation.
192
193 The order queue test configures the eventdev with two queues and an event
194 producer to inject the events to q0(ordered) queue. Both q0(ordered) and
195 q1(atomic) are linked to all the workers.
196
197 The event producer maintains a sequence number per flow and injects the events
198 to the ordered queue. The worker receives the events from ordered queue and
199 forwards to atomic queue. Since the events from an ordered queue can be
200 processed in parallel on the different workers, the ingress order of events
201 might have changed on the downstream atomic queue enqueue. On enqueue to the
202 atomic queue, the eventdev PMD driver reorders the event to the original
203 ingress order(i.e producer ingress order).
204
205 When the event is dequeued from the atomic queue by the worker, this test
206 verifies the expected sequence number of associated event per flow by comparing
207 the free running expected sequence number per flow.
208
209 Application options
210 ^^^^^^^^^^^^^^^^^^^
211
212 Supported application command line options are following::
213
214    --verbose
215    --dev
216    --test
217    --socket_id
218    --pool_sz
219    --plcores
220    --wlcores
221    --nb_flows
222    --nb_pkts
223    --worker_deq_depth
224
225 Example
226 ^^^^^^^
227
228 Example command to run order queue test:
229
230 .. code-block:: console
231
232    sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
233                 --test=order_queue --plcores 1 --wlcores 2,3
234
235
236 ORDER_ATQ Test
237 ~~~~~~~~~~~~~~
238
239 This test verifies the same aspects of ``order_queue`` test, the difference is
240 the number of queues used, this test operates on a single ``all types queue(atq)``
241 instead of two different queues for ordered and atomic.
242
243 .. _table_eventdev_order_atq_test:
244
245 .. table:: Order all types queue test eventdev configuration.
246
247    +---+--------------+----------------+------------------------+
248    | # | Items        | Value          | Comments               |
249    |   |              |                |                        |
250    +===+==============+================+========================+
251    | 1 | nb_queues    | 1              | q0(all types queue)    |
252    |   |              |                |                        |
253    +---+--------------+----------------+------------------------+
254    | 2 | nb_producers | 1              |                        |
255    |   |              |                |                        |
256    +---+--------------+----------------+------------------------+
257    | 3 | nb_workers   | >= 1           |                        |
258    |   |              |                |                        |
259    +---+--------------+----------------+------------------------+
260    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to  |
261    |   |              | 1              | port n-1.Producer uses |
262    |   |              |                | port n.                |
263    +---+--------------+----------------+------------------------+
264
265 .. _figure_eventdev_order_atq_test:
266
267 .. figure:: img/eventdev_order_atq_test.*
268
269    order all types queue test operation.
270
271 Application options
272 ^^^^^^^^^^^^^^^^^^^
273
274 Supported application command line options are following::
275
276    --verbose
277    --dev
278    --test
279    --socket_id
280    --pool_sz
281    --plcores
282    --wlcores
283    --nb_flows
284    --nb_pkts
285    --worker_deq_depth
286
287 Example
288 ^^^^^^^
289
290 Example command to run order ``all types queue`` test:
291
292 .. code-block:: console
293
294    sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
295                         --test=order_atq --plcores 1 --wlcores 2,3
296
297
298 PERF_QUEUE Test
299 ~~~~~~~~~~~~~~~
300
301 This is a performance test case that aims at testing the following:
302
303 #. Measure the number of events can be processed in a second.
304 #. Measure the latency to forward an event.
305
306 .. _table_eventdev_perf_queue_test:
307
308 .. table:: Perf queue test eventdev configuration.
309
310    +---+--------------+----------------+-----------------------------------------+
311    | # | Items        | Value          | Comments                                |
312    |   |              |                |                                         |
313    +===+==============+================+=========================================+
314    | 1 | nb_queues    | nb_producers * | Queues will be configured based on the  |
315    |   |              | nb_stages      | user requested sched type list(--stlist)|
316    +---+--------------+----------------+-----------------------------------------+
317    | 2 | nb_producers | >= 1           | Selected through --plcores command line |
318    |   |              |                | argument.                               |
319    +---+--------------+----------------+-----------------------------------------+
320    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
321    |   |              |                | argument                                |
322    +---+--------------+----------------+-----------------------------------------+
323    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n-1.         |
324    |   |              | nb_producers   | Producers use port n to port p          |
325    +---+--------------+----------------+-----------------------------------------+
326
327 .. _figure_eventdev_perf_queue_test:
328
329 .. figure:: img/eventdev_perf_queue_test.*
330
331    perf queue test operation.
332
333 The perf queue test configures the eventdev with Q queues and P ports, where
334 Q and P is a function of the number of workers, the number of producers and
335 number of stages as mentioned in :numref:`table_eventdev_perf_queue_test`.
336
337 The user can choose the number of workers, the number of producers and number of
338 stages through the ``--wlcores``, ``--plcores`` and the ``--stlist`` application
339 command line arguments respectively.
340
341 The producer(s) injects the events to eventdev based the first stage sched type
342 list requested by the user through ``--stlist`` the command line argument.
343
344 Based on the number of stages to process(selected through ``--stlist``),
345 The application forwards the event to next upstream queue and terminates when it
346 reaches the last stage in the pipeline. On event termination, application
347 increments the number events processed and print periodically in one second
348 to get the number of events processed in one second.
349
350 When ``--fwd_latency`` command line option selected, the application inserts
351 the timestamp in the event on the first stage and then on termination, it
352 updates the number of cycles to forward a packet. The application uses this
353 value to compute the average latency to a forward packet.
354
355 Application options
356 ^^^^^^^^^^^^^^^^^^^
357
358 Supported application command line options are following::
359
360         --verbose
361         --dev
362         --test
363         --socket_id
364         --pool_sz
365         --slcore (Valid when eventdev is not RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED capable)
366         --plcores
367         --wlcores
368         --stlist
369         --nb_flows
370         --nb_pkts
371         --worker_deq_depth
372         --fwd_latency
373         --queue_priority
374
375 Example
376 ^^^^^^^
377
378 Example command to run perf queue test:
379
380 .. code-block:: console
381
382    sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
383         --test=perf_queue --slcore=1 --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
384
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         --slcore (Valid when eventdev is not RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED capable)
445         --plcores
446         --wlcores
447         --stlist
448         --nb_flows
449         --nb_pkts
450         --worker_deq_depth
451         --fwd_latency
452
453 Example
454 ^^^^^^^
455
456 Example command to run perf ``all types queue`` test:
457
458 .. code-block:: console
459
460    sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
461                 --test=perf_atq --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0