xref: /dpdk/doc/guides/sample_app_ug/eventdev_pipeline.rst (revision d629b7b5fe812f0040b83d27d2ada33b003aa918)
15630257fSFerruh Yigit..  SPDX-License-Identifier: BSD-3-Clause
25630257fSFerruh Yigit    Copyright(c) 2017 Intel Corporation.
36d239dd5SPavan Nikhilesh
46d239dd5SPavan NikhileshEventdev Pipeline Sample Application
56d239dd5SPavan Nikhilesh====================================
66d239dd5SPavan Nikhilesh
76d239dd5SPavan NikhileshThe eventdev pipeline sample application is a sample app that demonstrates
86d239dd5SPavan Nikhileshthe usage of the eventdev API using the software PMD. It shows how an
96d239dd5SPavan Nikhileshapplication can configure a pipeline and assign a set of worker cores to
106d239dd5SPavan Nikhileshperform the processing required.
116d239dd5SPavan Nikhilesh
126d239dd5SPavan NikhileshThe application has a range of command line arguments allowing it to be
136d239dd5SPavan Nikhileshconfigured for various numbers worker cores, stages,queue depths and cycles per
146d239dd5SPavan Nikhileshstage of work. This is useful for performance testing as well as quickly testing
156d239dd5SPavan Nikhilesha particular pipeline configuration.
166d239dd5SPavan Nikhilesh
176d239dd5SPavan Nikhilesh
186d239dd5SPavan NikhileshCompiling the Application
196d239dd5SPavan Nikhilesh-------------------------
206d239dd5SPavan Nikhilesh
216d239dd5SPavan NikhileshTo compile the sample application see :doc:`compiling`.
226d239dd5SPavan Nikhilesh
236d239dd5SPavan NikhileshThe application is located in the ``examples`` sub-directory.
246d239dd5SPavan Nikhilesh
256d239dd5SPavan Nikhilesh
266d239dd5SPavan Nikhilesh
276d239dd5SPavan NikhileshRunning the Application
286d239dd5SPavan Nikhilesh-----------------------
296d239dd5SPavan Nikhilesh
306d239dd5SPavan NikhileshThe application has a lot of command line options. This allows specification of
316d239dd5SPavan Nikhileshthe eventdev PMD to use, and a number of attributes of the processing pipeline
326d239dd5SPavan Nikhileshoptions.
336d239dd5SPavan Nikhilesh
346d239dd5SPavan NikhileshAn example eventdev pipeline running with the software eventdev PMD using
356d239dd5SPavan Nikhileshthese settings is shown below:
366d239dd5SPavan Nikhilesh
376d239dd5SPavan Nikhilesh * ``-r1``: core mask 0x1 for RX
386d239dd5SPavan Nikhilesh * ``-t1``: core mask 0x1 for TX
396d239dd5SPavan Nikhilesh * ``-e4``: core mask 0x4 for the software scheduler
406d239dd5SPavan Nikhilesh * ``-w FF00``: core mask for worker cores, 8 cores from 8th to 16th
416d239dd5SPavan Nikhilesh * ``-s4``: 4 atomic stages
426d239dd5SPavan Nikhilesh * ``-n0``: process infinite packets (run forever)
436d239dd5SPavan Nikhilesh * ``-c32``: worker dequeue depth of 32
446d239dd5SPavan Nikhilesh * ``-W1000``: do 1000 cycles of work per packet in each stage
456d239dd5SPavan Nikhilesh * ``-D``: dump statistics on exit
466d239dd5SPavan Nikhilesh
476d239dd5SPavan Nikhilesh.. code-block:: console
486d239dd5SPavan Nikhilesh
496d239dd5SPavan Nikhilesh    ./build/eventdev_pipeline --vdev event_sw0 -- -r1 -t1 -e4 -w FF00 -s4 -n0 -c32 -W1000 -D
506d239dd5SPavan Nikhilesh
516d239dd5SPavan NikhileshThe application has some sanity checking built-in, so if there is a function
52*d629b7b5SJohn McNamara(e.g.; the RX core) which doesn't have a cpu core mask assigned, the application
536d239dd5SPavan Nikhileshwill print an error message:
546d239dd5SPavan Nikhilesh
556d239dd5SPavan Nikhilesh.. code-block:: console
566d239dd5SPavan Nikhilesh
576d239dd5SPavan Nikhilesh  Core part of pipeline was not assigned any cores. This will stall the
586d239dd5SPavan Nikhilesh  pipeline, please check core masks (use -h for details on setting core masks):
596d239dd5SPavan Nikhilesh          rx: 0
606d239dd5SPavan Nikhilesh          tx: 1
616d239dd5SPavan Nikhilesh
626d239dd5SPavan NikhileshConfiguration of the eventdev is covered in detail in the programmers guide,
636d239dd5SPavan Nikhileshsee the Event Device Library section.
646d239dd5SPavan Nikhilesh
656d239dd5SPavan Nikhilesh
666d239dd5SPavan NikhileshObserving the Application
676d239dd5SPavan Nikhilesh-------------------------
686d239dd5SPavan Nikhilesh
696d239dd5SPavan NikhileshAt runtime the eventdev pipeline application prints out a summary of the
706d239dd5SPavan Nikhileshconfiguration, and some runtime statistics like packets per second. On exit the
716d239dd5SPavan Nikhileshworker statistics are printed, along with a full dump of the PMD statistics if
726d239dd5SPavan Nikhileshrequired. The following sections show sample output for each of the output
736d239dd5SPavan Nikhileshtypes.
746d239dd5SPavan Nikhilesh
756d239dd5SPavan NikhileshConfiguration
766d239dd5SPavan Nikhilesh~~~~~~~~~~~~~
776d239dd5SPavan Nikhilesh
786d239dd5SPavan NikhileshThis provides an overview of the pipeline,
796d239dd5SPavan Nikhileshscheduling type at each stage, and parameters to options such as how many
806d239dd5SPavan Nikhileshflows to use and what eventdev PMD is in use. See the following sample output
816d239dd5SPavan Nikhileshfor details:
826d239dd5SPavan Nikhilesh
836d239dd5SPavan Nikhilesh.. code-block:: console
846d239dd5SPavan Nikhilesh
856d239dd5SPavan Nikhilesh  Config:
866d239dd5SPavan Nikhilesh        ports: 2
876d239dd5SPavan Nikhilesh        workers: 8
886d239dd5SPavan Nikhilesh        packets: 0
896d239dd5SPavan Nikhilesh        priorities: 1
906d239dd5SPavan Nikhilesh        Queue-prio: 0
916d239dd5SPavan Nikhilesh        qid0 type: atomic
926d239dd5SPavan Nikhilesh        Cores available: 44
936d239dd5SPavan Nikhilesh        Cores used: 10
946d239dd5SPavan Nikhilesh        Eventdev 0: event_sw
956d239dd5SPavan Nikhilesh  Stages:
966d239dd5SPavan Nikhilesh        Stage 0, Type Atomic    Priority = 128
976d239dd5SPavan Nikhilesh        Stage 1, Type Atomic    Priority = 128
986d239dd5SPavan Nikhilesh        Stage 2, Type Atomic    Priority = 128
996d239dd5SPavan Nikhilesh        Stage 3, Type Atomic    Priority = 128
1006d239dd5SPavan Nikhilesh
1016d239dd5SPavan NikhileshRuntime
1026d239dd5SPavan Nikhilesh~~~~~~~
1036d239dd5SPavan Nikhilesh
1046d239dd5SPavan NikhileshAt runtime, the statistics of the consumer are printed, stating the number of
1056d239dd5SPavan Nikhileshpackets received, runtime in milliseconds, average mpps, and current mpps.
1066d239dd5SPavan Nikhilesh
1076d239dd5SPavan Nikhilesh.. code-block:: console
1086d239dd5SPavan Nikhilesh
1096d239dd5SPavan Nikhilesh  # consumer RX= xxxxxxx, time yyyy ms, avg z.zzz mpps [current w.www mpps]
1106d239dd5SPavan Nikhilesh
1116d239dd5SPavan NikhileshShutdown
1126d239dd5SPavan Nikhilesh~~~~~~~~
1136d239dd5SPavan Nikhilesh
1146d239dd5SPavan NikhileshAt shutdown, the application prints the number of packets received and
1156d239dd5SPavan Nikhileshtransmitted, and an overview of the distribution of work across worker cores.
1166d239dd5SPavan Nikhilesh
1176d239dd5SPavan Nikhilesh.. code-block:: console
1186d239dd5SPavan Nikhilesh
1196d239dd5SPavan Nikhilesh        Signal 2 received, preparing to exit...
1206d239dd5SPavan Nikhilesh          worker 12 thread done. RX=4966581 TX=4966581
1216d239dd5SPavan Nikhilesh          worker 13 thread done. RX=4963329 TX=4963329
1226d239dd5SPavan Nikhilesh          worker 14 thread done. RX=4953614 TX=4953614
1236d239dd5SPavan Nikhilesh          worker 0 thread done. RX=0 TX=0
1246d239dd5SPavan Nikhilesh          worker 11 thread done. RX=4970549 TX=4970549
1256d239dd5SPavan Nikhilesh          worker 10 thread done. RX=4986391 TX=4986391
1266d239dd5SPavan Nikhilesh          worker 9 thread done. RX=4970528 TX=4970528
1276d239dd5SPavan Nikhilesh          worker 15 thread done. RX=4974087 TX=4974087
1286d239dd5SPavan Nikhilesh          worker 8 thread done. RX=4979908 TX=4979908
1296d239dd5SPavan Nikhilesh          worker 2 thread done. RX=0 TX=0
1306d239dd5SPavan Nikhilesh
1316d239dd5SPavan Nikhilesh        Port Workload distribution:
1326d239dd5SPavan Nikhilesh        worker 0 :      12.5 % (4979876 pkts)
1336d239dd5SPavan Nikhilesh        worker 1 :      12.5 % (4970497 pkts)
1346d239dd5SPavan Nikhilesh        worker 2 :      12.5 % (4986359 pkts)
1356d239dd5SPavan Nikhilesh        worker 3 :      12.5 % (4970517 pkts)
1366d239dd5SPavan Nikhilesh        worker 4 :      12.5 % (4966566 pkts)
1376d239dd5SPavan Nikhilesh        worker 5 :      12.5 % (4963297 pkts)
1386d239dd5SPavan Nikhilesh        worker 6 :      12.5 % (4953598 pkts)
1396d239dd5SPavan Nikhilesh        worker 7 :      12.5 % (4974055 pkts)
1406d239dd5SPavan Nikhilesh
1416d239dd5SPavan NikhileshTo get a full dump of the state of the eventdev PMD, pass the ``-D`` flag to
1426d239dd5SPavan Nikhileshthis application. When the app is terminated using ``Ctrl+C``, the
1436d239dd5SPavan Nikhilesh``rte_event_dev_dump()`` function is called, resulting in a dump of the
1446d239dd5SPavan Nikhileshstatistics that the PMD provides. The statistics provided depend on the PMD
1456d239dd5SPavan Nikhileshused, see the Event Device Drivers section for a list of eventdev PMDs.
146