doc: announce ABI change for ring structure
[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
123 Eventdev Tests
124 --------------
125
126 ORDER_QUEUE Test
127 ~~~~~~~~~~~~~~~~
128
129 This is a functional test case that aims at testing the following:
130
131 #. Verify the ingress order maintenance.
132 #. Verify the exclusive(atomic) access to given atomic flow per eventdev port.
133
134 .. _table_eventdev_order_queue_test:
135
136 .. table:: Order queue test eventdev configuration.
137
138    +---+--------------+----------------+------------------------+
139    | # | Items        | Value          | Comments               |
140    |   |              |                |                        |
141    +===+==============+================+========================+
142    | 1 | nb_queues    | 2              | q0(ordered), q1(atomic)|
143    |   |              |                |                        |
144    +---+--------------+----------------+------------------------+
145    | 2 | nb_producers | 1              |                        |
146    |   |              |                |                        |
147    +---+--------------+----------------+------------------------+
148    | 3 | nb_workers   | >= 1           |                        |
149    |   |              |                |                        |
150    +---+--------------+----------------+------------------------+
151    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to  |
152    |   |              | 1              | port n-1. Producer uses|
153    |   |              |                | port n                 |
154    +---+--------------+----------------+------------------------+
155
156 .. _figure_eventdev_order_queue_test:
157
158 .. figure:: img/eventdev_order_queue_test.*
159
160    order queue test operation.
161
162 The order queue test configures the eventdev with two queues and an event
163 producer to inject the events to q0(ordered) queue. Both q0(ordered) and
164 q1(atomic) are linked to all the workers.
165
166 The event producer maintains a sequence number per flow and injects the events
167 to the ordered queue. The worker receives the events from ordered queue and
168 forwards to atomic queue. Since the events from an ordered queue can be
169 processed in parallel on the different workers, the ingress order of events
170 might have changed on the downstream atomic queue enqueue. On enqueue to the
171 atomic queue, the eventdev PMD driver reorders the event to the original
172 ingress order(i.e producer ingress order).
173
174 When the event is dequeued from the atomic queue by the worker, this test
175 verifies the expected sequence number of associated event per flow by comparing
176 the free running expected sequence number per flow.
177
178 Application options
179 ^^^^^^^^^^^^^^^^^^^
180
181 Supported application command line options are following::
182
183    --verbose
184    --dev
185    --test
186    --socket_id
187    --pool_sz
188    --plcores
189    --wlcores
190    --nb_flows
191    --nb_pkts
192    --worker_deq_depth
193
194 Example
195 ^^^^^^^
196
197 Example command to run order queue test:
198
199 .. code-block:: console
200
201    sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
202                 --test=order_queue --plcores 1 --wlcores 2,3
203
204
205 ORDER_ATQ Test
206 ~~~~~~~~~~~~~~
207
208 This test verifies the same aspects of ``order_queue`` test, the difference is
209 the number of queues used, this test operates on a single ``all types queue(atq)``
210 instead of two different queues for ordered and atomic.
211
212 .. _table_eventdev_order_atq_test:
213
214 .. table:: Order all types queue test eventdev configuration.
215
216    +---+--------------+----------------+------------------------+
217    | # | Items        | Value          | Comments               |
218    |   |              |                |                        |
219    +===+==============+================+========================+
220    | 1 | nb_queues    | 1              | q0(all types queue)    |
221    |   |              |                |                        |
222    +---+--------------+----------------+------------------------+
223    | 2 | nb_producers | 1              |                        |
224    |   |              |                |                        |
225    +---+--------------+----------------+------------------------+
226    | 3 | nb_workers   | >= 1           |                        |
227    |   |              |                |                        |
228    +---+--------------+----------------+------------------------+
229    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to  |
230    |   |              | 1              | port n-1.Producer uses |
231    |   |              |                | port n.                |
232    +---+--------------+----------------+------------------------+
233
234 .. _figure_eventdev_order_atq_test:
235
236 .. figure:: img/eventdev_order_atq_test.*
237
238    order all types queue test operation.
239
240 Application options
241 ^^^^^^^^^^^^^^^^^^^
242
243 Supported application command line options are following::
244
245    --verbose
246    --dev
247    --test
248    --socket_id
249    --pool_sz
250    --plcores
251    --wlcores
252    --nb_flows
253    --nb_pkts
254    --worker_deq_depth
255
256 Example
257 ^^^^^^^
258
259 Example command to run order ``all types queue`` test:
260
261 .. code-block:: console
262
263    sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
264                         --test=order_atq --plcores 1 --wlcores 2,3
265
266
267 PERF_QUEUE Test
268 ~~~~~~~~~~~~~~~
269
270 This is a performance test case that aims at testing the following:
271
272 #. Measure the number of events can be processed in a second.
273 #. Measure the latency to forward an event.
274
275 .. _table_eventdev_perf_queue_test:
276
277 .. table:: Perf queue test eventdev configuration.
278
279    +---+--------------+----------------+-----------------------------------------+
280    | # | Items        | Value          | Comments                                |
281    |   |              |                |                                         |
282    +===+==============+================+=========================================+
283    | 1 | nb_queues    | nb_producers * | Queues will be configured based on the  |
284    |   |              | nb_stages      | user requested sched type list(--stlist)|
285    +---+--------------+----------------+-----------------------------------------+
286    | 2 | nb_producers | >= 1           | Selected through --plcores command line |
287    |   |              |                | argument.                               |
288    +---+--------------+----------------+-----------------------------------------+
289    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
290    |   |              |                | argument                                |
291    +---+--------------+----------------+-----------------------------------------+
292    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n-1.         |
293    |   |              | nb_producers   | Producers use port n to port p          |
294    +---+--------------+----------------+-----------------------------------------+
295
296 .. _figure_eventdev_perf_queue_test:
297
298 .. figure:: img/eventdev_perf_queue_test.*
299
300    perf queue test operation.
301
302 The perf queue test configures the eventdev with Q queues and P ports, where
303 Q and P is a function of the number of workers, the number of producers and
304 number of stages as mentioned in :numref:`table_eventdev_perf_queue_test`.
305
306 The user can choose the number of workers, the number of producers and number of
307 stages through the ``--wlcores``, ``--plcores`` and the ``--stlist`` application
308 command line arguments respectively.
309
310 The producer(s) injects the events to eventdev based the first stage sched type
311 list requested by the user through ``--stlist`` the command line argument.
312
313 Based on the number of stages to process(selected through ``--stlist``),
314 The application forwards the event to next upstream queue and terminates when it
315 reaches the last stage in the pipeline. On event termination, application
316 increments the number events processed and print periodically in one second
317 to get the number of events processed in one second.
318
319 When ``--fwd_latency`` command line option selected, the application inserts
320 the timestamp in the event on the first stage and then on termination, it
321 updates the number of cycles to forward a packet. The application uses this
322 value to compute the average latency to a forward packet.
323
324 Application options
325 ^^^^^^^^^^^^^^^^^^^
326
327 Supported application command line options are following::
328
329         --verbose
330         --dev
331         --test
332         --socket_id
333         --pool_sz
334         --plcores
335         --wlcores
336         --stlist
337         --nb_flows
338         --nb_pkts
339         --worker_deq_depth
340         --fwd_latency
341         --queue_priority
342
343 Example
344 ^^^^^^^
345
346 Example command to run perf queue test:
347
348 .. code-block:: console
349
350    sudo build/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \
351         --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
352
353
354 PERF_ATQ Test
355 ~~~~~~~~~~~~~~~
356
357 This is a performance test case that aims at testing the following with
358 ``all types queue`` eventdev scheme.
359
360 #. Measure the number of events can be processed in a second.
361 #. Measure the latency to forward an event.
362
363 .. _table_eventdev_perf_atq_test:
364
365 .. table:: Perf all types queue test eventdev configuration.
366
367    +---+--------------+----------------+-----------------------------------------+
368    | # | Items        | Value          | Comments                                |
369    |   |              |                |                                         |
370    +===+==============+================+=========================================+
371    | 1 | nb_queues    | nb_producers   | Queues will be configured based on the  |
372    |   |              |                | user requested sched type list(--stlist)|
373    +---+--------------+----------------+-----------------------------------------+
374    | 2 | nb_producers | >= 1           | Selected through --plcores command line |
375    |   |              |                | argument.                               |
376    +---+--------------+----------------+-----------------------------------------+
377    | 3 | nb_workers   | >= 1           | Selected through --wlcores command line |
378    |   |              |                | argument                                |
379    +---+--------------+----------------+-----------------------------------------+
380    | 4 | nb_ports     | nb_workers +   | Workers use port 0 to port n-1.         |
381    |   |              | nb_producers   | Producers use port n to port p          |
382    +---+--------------+----------------+-----------------------------------------+
383
384 .. _figure_eventdev_perf_atq_test:
385
386 .. figure:: img/eventdev_perf_atq_test.*
387
388    perf all types queue test operation.
389
390
391 The ``all types queues(atq)`` perf test configures the eventdev with Q queues
392 and P ports, where Q and P is a function of the number of workers and number of
393 producers as mentioned in :numref:`table_eventdev_perf_atq_test`.
394
395
396 The atq queue test functions as same as ``perf_queue`` test. The difference
397 is, It uses, ``all type queue scheme`` instead of separate queues for each
398 stage and thus reduces the number of queues required to realize the use case
399 and enables flow pinning as the event does not move to the next queue.
400
401
402 Application options
403 ^^^^^^^^^^^^^^^^^^^
404
405 Supported application command line options are following::
406
407         --verbose
408         --dev
409         --test
410         --socket_id
411         --pool_sz
412         --plcores
413         --wlcores
414         --stlist
415         --nb_flows
416         --nb_pkts
417         --worker_deq_depth
418         --fwd_latency
419
420 Example
421 ^^^^^^^
422
423 Example command to run perf ``all types queue`` test:
424
425 .. code-block:: console
426
427    sudo build/app/dpdk-test-eventdev --vdev=event_octeontx -- \
428                 --test=perf_atq --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0