15630257fSFerruh Yigit.. SPDX-License-Identifier: BSD-3-Clause 25630257fSFerruh Yigit Copyright(c) 2010-2017 Intel Corporation. 3d0dff9baSBernard Iremonger 4bef33b0aSMarko KovacevicIntroduction to the DPDK Sample Applications 5bef33b0aSMarko Kovacevic============================================ 6d0dff9baSBernard Iremonger 7*8750576fSNandini PersadThe DPDK Sample Applications are small standalone applications that 8bef33b0aSMarko Kovacevicdemonstrate various features of DPDK. They can be considered as a cookbook of 9bef33b0aSMarko KovacevicDPDK features. Users interested in getting started with DPDK can take the 10bef33b0aSMarko Kovacevicapplications, try out the features, and then extend them to fit their needs. 11d0dff9baSBernard Iremonger 12d0dff9baSBernard Iremonger 133ee567cfSAnatoly BurakovRunning Sample Applications 143ee567cfSAnatoly Burakov--------------------------- 153ee567cfSAnatoly Burakov 163ee567cfSAnatoly BurakovSome sample applications may have their own command-line parameters described in 17*8750576fSNandini Persadtheir respective guides. However, they all also share the same EAL parameters. 18c41c100bSDekel PeledPlease refer to :doc:`EAL parameters (Linux) <../linux_gsg/linux_eal_parameters>` 19c41c100bSDekel Peledor :doc:`EAL parameters (FreeBSD) <../freebsd_gsg/freebsd_eal_parameters>` for 20c41c100bSDekel Peleda list of available EAL command-line options. 213ee567cfSAnatoly Burakov 223ee567cfSAnatoly Burakov 23bef33b0aSMarko KovacevicThe DPDK Sample Applications 24bef33b0aSMarko Kovacevic---------------------------- 25d0dff9baSBernard Iremonger 267eb115c0SCiara PowerThere are many sample applications available in the examples directory of DPDK. 27*8750576fSNandini PersadThese examples range from simple to reasonably complex, but most are designed 28bef33b0aSMarko Kovacevicto demonstrate one particular feature of DPDK. Some of the more interesting 29bef33b0aSMarko Kovacevicexamples are highlighted below. 30d0dff9baSBernard Iremonger 31d0dff9baSBernard Iremonger 32bef33b0aSMarko Kovacevic* :doc:`Hello World<hello_world>`: As with most introductions to a 33*8750576fSNandini Persad programming framework, a good place to start is with the Hello World 34bef33b0aSMarko Kovacevic application. The Hello World example sets up the DPDK Environment Abstraction 35bef33b0aSMarko Kovacevic Layer (EAL), and prints a simple "Hello World" message to each of the DPDK 36*8750576fSNandini Persad enabled cores. This application doesn't do any packet forwarding, but it is a 37bef33b0aSMarko Kovacevic good way to test if the DPDK environment is compiled and set up properly. 38d0dff9baSBernard Iremonger 39bef33b0aSMarko Kovacevic* :doc:`Basic Forwarding/Skeleton Application<skeleton>`: The Basic 40bef33b0aSMarko Kovacevic Forwarding/Skeleton contains the minimum amount of code required to enable 41bef33b0aSMarko Kovacevic basic packet forwarding with DPDK. This allows you to test if your network 42bef33b0aSMarko Kovacevic interfaces are working with DPDK. 43d0dff9baSBernard Iremonger 44bef33b0aSMarko Kovacevic* :doc:`Network Layer 2 forwarding<l2_forward_real_virtual>`: The Network Layer 2 45bef33b0aSMarko Kovacevic forwarding, or ``l2fwd`` application does forwarding based on Ethernet MAC 46bef33b0aSMarko Kovacevic addresses like a simple switch. 47bef33b0aSMarko Kovacevic 4814d7ea25SSunil Kumar Kori* :doc:`Network Layer 2 forwarding<l2_forward_event>`: The Network Layer 2 4914d7ea25SSunil Kumar Kori forwarding, or ``l2fwd-event`` application does forwarding based on Ethernet MAC 5014d7ea25SSunil Kumar Kori addresses like a simple switch. It demonstrates usage of poll and event mode 5114d7ea25SSunil Kumar Kori IO mechanism under a single application. 5214d7ea25SSunil Kumar Kori 53bef33b0aSMarko Kovacevic* :doc:`Network Layer 3 forwarding<l3_forward>`: The Network Layer3 54bef33b0aSMarko Kovacevic forwarding, or ``l3fwd`` application does forwarding based on Internet 55bef33b0aSMarko Kovacevic Protocol, IPv4 or IPv6 like a simple router. 56bef33b0aSMarko Kovacevic 57cafe1242SNithin Dabilpuram* :doc:`Network Layer 3 forwarding Graph<l3_forward_graph>`: The Network Layer3 58cafe1242SNithin Dabilpuram forwarding Graph, or ``l3fwd_graph`` application does forwarding based on IPv4 59cafe1242SNithin Dabilpuram like a simple router with DPDK Graph framework. 60cafe1242SNithin Dabilpuram 61bb4141dbSKevin Laatz* :doc:`Hardware packet copying<dma>`: The Hardware packet copying, 62bb4141dbSKevin Laatz or ``dmafwd`` application demonstrates how to use DMAdev library for 638301b047SMarcin Baran copying packets between two threads. 648301b047SMarcin Baran 65bef33b0aSMarko Kovacevic* :doc:`Packet Distributor<dist_app>`: The Packet Distributor 66bef33b0aSMarko Kovacevic demonstrates how to distribute packets arriving on an Rx port to different 67bef33b0aSMarko Kovacevic cores for processing and transmission. 68bef33b0aSMarko Kovacevic 69bef33b0aSMarko Kovacevic* :doc:`Multi-Process Application<multi_process>`: The 70bef33b0aSMarko Kovacevic multi-process application shows how two DPDK processes can work together using 71bef33b0aSMarko Kovacevic queues and memory pools to share information. 72bef33b0aSMarko Kovacevic 73bef33b0aSMarko Kovacevic* :doc:`RX/TX callbacks Application<rxtx_callbacks>`: The RX/TX 74bef33b0aSMarko Kovacevic callbacks sample application is a packet forwarding application that 75*8750576fSNandini Persad demonstrates the use of user-defined callbacks on received and transmitted 76bef33b0aSMarko Kovacevic packets. The application calculates the latency of a packet between RX 77bef33b0aSMarko Kovacevic (packet arrival) and TX (packet transmission) by adding callbacks to the RX 78bef33b0aSMarko Kovacevic and TX packet processing functions. 79bef33b0aSMarko Kovacevic 80d629b7b5SJohn McNamara* :doc:`IPsec Security Gateway<ipsec_secgw>`: The IPsec Security 81*8750576fSNandini Persad Gateway application is a minimal example of something closer to a real world 82bef33b0aSMarko Kovacevic example. This is also a good example of an application using the DPDK 83bef33b0aSMarko Kovacevic Cryptodev framework. 84bef33b0aSMarko Kovacevic 85bef33b0aSMarko Kovacevic* :doc:`Precision Time Protocol (PTP) client<ptpclient>`: The PTP 86bef33b0aSMarko Kovacevic client is another minimal implementation of a real world application. 87*8750576fSNandini Persad In this case, the application is a PTP client that communicates with a PTP 88b8d1d60fSStephen Hemminger time transmitter to synchronize time on a Network Interface Card (NIC) using the 89bef33b0aSMarko Kovacevic IEEE1588 protocol. 90bef33b0aSMarko Kovacevic 91bef33b0aSMarko Kovacevic* :doc:`Quality of Service (QoS) Scheduler<qos_scheduler>`: The QoS 92bef33b0aSMarko Kovacevic Scheduler application demonstrates the use of DPDK to provide QoS scheduling. 93bef33b0aSMarko Kovacevic 94bef33b0aSMarko KovacevicThere are many more examples shown in the following chapters. Each of the 95bef33b0aSMarko Kovacevicdocumented sample applications show how to compile, configure and run the 96*8750576fSNandini Persadapplication, as well as explaining the main functionality of the code. 97