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