xref: /dpdk/doc/guides/sample_app_ug/eventdev_pipeline.rst (revision 3d15913432f12a2abcaa00122502eb944feeeb29)
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
37*3d159134SFeifei Wang * ``-l 0,2,8-15``: lcore to use
386d239dd5SPavan Nikhilesh * ``-r1``: core mask 0x1 for RX
396d239dd5SPavan Nikhilesh * ``-t1``: core mask 0x1 for TX
406d239dd5SPavan Nikhilesh * ``-e4``: core mask 0x4 for the software scheduler
416d239dd5SPavan Nikhilesh * ``-w FF00``: core mask for worker cores, 8 cores from 8th to 16th
426d239dd5SPavan Nikhilesh * ``-s4``: 4 atomic stages
436d239dd5SPavan Nikhilesh * ``-n0``: process infinite packets (run forever)
446d239dd5SPavan Nikhilesh * ``-c32``: worker dequeue depth of 32
456d239dd5SPavan Nikhilesh * ``-W1000``: do 1000 cycles of work per packet in each stage
466d239dd5SPavan Nikhilesh * ``-D``: dump statistics on exit
476d239dd5SPavan Nikhilesh
486d239dd5SPavan Nikhilesh.. code-block:: console
496d239dd5SPavan Nikhilesh
50*3d159134SFeifei Wang    ./<build_dir>/examples/dpdk-eventdev_pipeline -l 0,2,8-15 --vdev event_sw0 \
51*3d159134SFeifei Wang    -- -r1 -t1 -e4 -w FF00 -s4 -n0 -c32 -W1000 -D
526d239dd5SPavan Nikhilesh
536d239dd5SPavan NikhileshThe application has some sanity checking built-in, so if there is a function
54d629b7b5SJohn McNamara(e.g.; the RX core) which doesn't have a cpu core mask assigned, the application
556d239dd5SPavan Nikhileshwill print an error message:
566d239dd5SPavan Nikhilesh
576d239dd5SPavan Nikhilesh.. code-block:: console
586d239dd5SPavan Nikhilesh
596d239dd5SPavan Nikhilesh  Core part of pipeline was not assigned any cores. This will stall the
606d239dd5SPavan Nikhilesh  pipeline, please check core masks (use -h for details on setting core masks):
616d239dd5SPavan Nikhilesh          rx: 0
626d239dd5SPavan Nikhilesh          tx: 1
636d239dd5SPavan Nikhilesh
646d239dd5SPavan NikhileshConfiguration of the eventdev is covered in detail in the programmers guide,
656d239dd5SPavan Nikhileshsee the Event Device Library section.
666d239dd5SPavan Nikhilesh
676d239dd5SPavan Nikhilesh
686d239dd5SPavan NikhileshObserving the Application
696d239dd5SPavan Nikhilesh-------------------------
706d239dd5SPavan Nikhilesh
716d239dd5SPavan NikhileshAt runtime the eventdev pipeline application prints out a summary of the
726d239dd5SPavan Nikhileshconfiguration, and some runtime statistics like packets per second. On exit the
736d239dd5SPavan Nikhileshworker statistics are printed, along with a full dump of the PMD statistics if
746d239dd5SPavan Nikhileshrequired. The following sections show sample output for each of the output
756d239dd5SPavan Nikhileshtypes.
766d239dd5SPavan Nikhilesh
776d239dd5SPavan NikhileshConfiguration
786d239dd5SPavan Nikhilesh~~~~~~~~~~~~~
796d239dd5SPavan Nikhilesh
806d239dd5SPavan NikhileshThis provides an overview of the pipeline,
816d239dd5SPavan Nikhileshscheduling type at each stage, and parameters to options such as how many
826d239dd5SPavan Nikhileshflows to use and what eventdev PMD is in use. See the following sample output
836d239dd5SPavan Nikhileshfor details:
846d239dd5SPavan Nikhilesh
856d239dd5SPavan Nikhilesh.. code-block:: console
866d239dd5SPavan Nikhilesh
876d239dd5SPavan Nikhilesh  Config:
886d239dd5SPavan Nikhilesh        ports: 2
896d239dd5SPavan Nikhilesh        workers: 8
906d239dd5SPavan Nikhilesh        packets: 0
916d239dd5SPavan Nikhilesh        priorities: 1
926d239dd5SPavan Nikhilesh        Queue-prio: 0
936d239dd5SPavan Nikhilesh        qid0 type: atomic
946d239dd5SPavan Nikhilesh        Cores available: 44
956d239dd5SPavan Nikhilesh        Cores used: 10
966d239dd5SPavan Nikhilesh        Eventdev 0: event_sw
976d239dd5SPavan Nikhilesh  Stages:
986d239dd5SPavan Nikhilesh        Stage 0, Type Atomic    Priority = 128
996d239dd5SPavan Nikhilesh        Stage 1, Type Atomic    Priority = 128
1006d239dd5SPavan Nikhilesh        Stage 2, Type Atomic    Priority = 128
1016d239dd5SPavan Nikhilesh        Stage 3, Type Atomic    Priority = 128
1026d239dd5SPavan Nikhilesh
1036d239dd5SPavan NikhileshRuntime
1046d239dd5SPavan Nikhilesh~~~~~~~
1056d239dd5SPavan Nikhilesh
1066d239dd5SPavan NikhileshAt runtime, the statistics of the consumer are printed, stating the number of
1076d239dd5SPavan Nikhileshpackets received, runtime in milliseconds, average mpps, and current mpps.
1086d239dd5SPavan Nikhilesh
1096d239dd5SPavan Nikhilesh.. code-block:: console
1106d239dd5SPavan Nikhilesh
1116d239dd5SPavan Nikhilesh  # consumer RX= xxxxxxx, time yyyy ms, avg z.zzz mpps [current w.www mpps]
1126d239dd5SPavan Nikhilesh
1136d239dd5SPavan NikhileshShutdown
1146d239dd5SPavan Nikhilesh~~~~~~~~
1156d239dd5SPavan Nikhilesh
1166d239dd5SPavan NikhileshAt shutdown, the application prints the number of packets received and
1176d239dd5SPavan Nikhileshtransmitted, and an overview of the distribution of work across worker cores.
1186d239dd5SPavan Nikhilesh
1196d239dd5SPavan Nikhilesh.. code-block:: console
1206d239dd5SPavan Nikhilesh
1216d239dd5SPavan Nikhilesh        Signal 2 received, preparing to exit...
1226d239dd5SPavan Nikhilesh          worker 12 thread done. RX=4966581 TX=4966581
1236d239dd5SPavan Nikhilesh          worker 13 thread done. RX=4963329 TX=4963329
1246d239dd5SPavan Nikhilesh          worker 14 thread done. RX=4953614 TX=4953614
1256d239dd5SPavan Nikhilesh          worker 0 thread done. RX=0 TX=0
1266d239dd5SPavan Nikhilesh          worker 11 thread done. RX=4970549 TX=4970549
1276d239dd5SPavan Nikhilesh          worker 10 thread done. RX=4986391 TX=4986391
1286d239dd5SPavan Nikhilesh          worker 9 thread done. RX=4970528 TX=4970528
1296d239dd5SPavan Nikhilesh          worker 15 thread done. RX=4974087 TX=4974087
1306d239dd5SPavan Nikhilesh          worker 8 thread done. RX=4979908 TX=4979908
1316d239dd5SPavan Nikhilesh          worker 2 thread done. RX=0 TX=0
1326d239dd5SPavan Nikhilesh
1336d239dd5SPavan Nikhilesh        Port Workload distribution:
1346d239dd5SPavan Nikhilesh        worker 0 :      12.5 % (4979876 pkts)
1356d239dd5SPavan Nikhilesh        worker 1 :      12.5 % (4970497 pkts)
1366d239dd5SPavan Nikhilesh        worker 2 :      12.5 % (4986359 pkts)
1376d239dd5SPavan Nikhilesh        worker 3 :      12.5 % (4970517 pkts)
1386d239dd5SPavan Nikhilesh        worker 4 :      12.5 % (4966566 pkts)
1396d239dd5SPavan Nikhilesh        worker 5 :      12.5 % (4963297 pkts)
1406d239dd5SPavan Nikhilesh        worker 6 :      12.5 % (4953598 pkts)
1416d239dd5SPavan Nikhilesh        worker 7 :      12.5 % (4974055 pkts)
1426d239dd5SPavan Nikhilesh
1436d239dd5SPavan NikhileshTo get a full dump of the state of the eventdev PMD, pass the ``-D`` flag to
1446d239dd5SPavan Nikhileshthis application. When the app is terminated using ``Ctrl+C``, the
1456d239dd5SPavan Nikhilesh``rte_event_dev_dump()`` function is called, resulting in a dump of the
1466d239dd5SPavan Nikhileshstatistics that the PMD provides. The statistics provided depend on the PMD
1476d239dd5SPavan Nikhileshused, see the Event Device Drivers section for a list of eventdev PMDs.
148