1d0dff9baSBernard Iremonger.. BSD LICENSE 2*bef33b0aSMarko Kovacevic Copyright(c) 2010-2017 Intel Corporation. All rights reserved. 3d0dff9baSBernard Iremonger All rights reserved. 4d0dff9baSBernard Iremonger 5d0dff9baSBernard Iremonger Redistribution and use in source and binary forms, with or without 6d0dff9baSBernard Iremonger modification, are permitted provided that the following conditions 7d0dff9baSBernard Iremonger are met: 8d0dff9baSBernard Iremonger 9d0dff9baSBernard Iremonger * Redistributions of source code must retain the above copyright 10d0dff9baSBernard Iremonger notice, this list of conditions and the following disclaimer. 11d0dff9baSBernard Iremonger * Redistributions in binary form must reproduce the above copyright 12d0dff9baSBernard Iremonger notice, this list of conditions and the following disclaimer in 13d0dff9baSBernard Iremonger the documentation and/or other materials provided with the 14d0dff9baSBernard Iremonger distribution. 15d0dff9baSBernard Iremonger * Neither the name of Intel Corporation nor the names of its 16d0dff9baSBernard Iremonger contributors may be used to endorse or promote products derived 17d0dff9baSBernard Iremonger from this software without specific prior written permission. 18d0dff9baSBernard Iremonger 19d0dff9baSBernard Iremonger THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20d0dff9baSBernard Iremonger "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21d0dff9baSBernard Iremonger LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22d0dff9baSBernard Iremonger A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23d0dff9baSBernard Iremonger OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24d0dff9baSBernard Iremonger SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25d0dff9baSBernard Iremonger LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26d0dff9baSBernard Iremonger DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27d0dff9baSBernard Iremonger THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28d0dff9baSBernard Iremonger (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29d0dff9baSBernard Iremonger OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30d0dff9baSBernard Iremonger 31*bef33b0aSMarko KovacevicIntroduction to the DPDK Sample Applications 32*bef33b0aSMarko Kovacevic============================================ 33d0dff9baSBernard Iremonger 34*bef33b0aSMarko KovacevicThe DPDK Sample Applications are small standalone applications which 35*bef33b0aSMarko Kovacevicdemonstrate various features of DPDK. They can be considered as a cookbook of 36*bef33b0aSMarko KovacevicDPDK features. Users interested in getting started with DPDK can take the 37*bef33b0aSMarko Kovacevicapplications, try out the features, and then extend them to fit their needs. 38d0dff9baSBernard Iremonger 39d0dff9baSBernard Iremonger 40*bef33b0aSMarko KovacevicThe DPDK Sample Applications 41*bef33b0aSMarko Kovacevic---------------------------- 42d0dff9baSBernard Iremonger 43*bef33b0aSMarko KovacevicTable :numref:`table_sample_apps` shows a list of some of the main sample 44*bef33b0aSMarko Kovacevicapplications that are available in the examples directory of DPDK: 45d0dff9baSBernard Iremonger 46*bef33b0aSMarko Kovacevic .. _table_sample_apps: 47d0dff9baSBernard Iremonger 48*bef33b0aSMarko Kovacevic .. table:: **Some of the DPDK Sample applications** 49d0dff9baSBernard Iremonger 50*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 51*bef33b0aSMarko Kovacevic | Bonding | Netmap Compatibility | 52*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 53*bef33b0aSMarko Kovacevic | Command Line | Packet Ordering | 54*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 55*bef33b0aSMarko Kovacevic | Distributor | Performance Thread | 56*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 57*bef33b0aSMarko Kovacevic | Ethtool | Precision Time Protocol (PTP) Client | 58*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 59*bef33b0aSMarko Kovacevic | Exception Path | Quality of Service (QoS) Metering | 60*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 61*bef33b0aSMarko Kovacevic | Hello World | QoS Scheduler | 62*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 63*bef33b0aSMarko Kovacevic | Internet Protocol (IP) Fragmentation | Quota and Watermark | 64*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 65*bef33b0aSMarko Kovacevic | IP Pipeline | RX/TX Callbacks | 66*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 67*bef33b0aSMarko Kovacevic | IP Reassembly | Server node EFD | 68*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 69*bef33b0aSMarko Kovacevic | IPsec Security Gateway | Basic Forwarding/Skeleton App | 70*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 71*bef33b0aSMarko Kovacevic | IPv4 multicast | Tunnel End Point (TEP) termination | 72*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 73*bef33b0aSMarko Kovacevic | Kernel NIC Interface | Timer | 74*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 75*bef33b0aSMarko Kovacevic | Network Layer 2 Forwarding + variants | Vhost | 76*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 77*bef33b0aSMarko Kovacevic | Network Layer 3 Forwarding + variants | Vhost Xen | 78*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 79*bef33b0aSMarko Kovacevic | Link Status Interrupt | VMDQ Forwarding | 80*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 81*bef33b0aSMarko Kovacevic | Load Balancer | VMDQ and DCB Forwarding | 82*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 83*bef33b0aSMarko Kovacevic | Multi-process | VM Power Management | 84*bef33b0aSMarko Kovacevic +---------------------------------------+--------------------------------------+ 85d0dff9baSBernard Iremonger 86*bef33b0aSMarko KovacevicThese examples range from simple to reasonably complex but most are designed 87*bef33b0aSMarko Kovacevicto demonstrate one particular feature of DPDK. Some of the more interesting 88*bef33b0aSMarko Kovacevicexamples are highlighted below. 89d0dff9baSBernard Iremonger 90d0dff9baSBernard Iremonger 91*bef33b0aSMarko Kovacevic* :doc:`Hello World<hello_world>`: As with most introductions to a 92*bef33b0aSMarko Kovacevic programming framework a good place to start is with the Hello World 93*bef33b0aSMarko Kovacevic application. The Hello World example sets up the DPDK Environment Abstraction 94*bef33b0aSMarko Kovacevic Layer (EAL), and prints a simple "Hello World" message to each of the DPDK 95*bef33b0aSMarko Kovacevic enabled cores. This application doesn't do any packet forwarding but it is a 96*bef33b0aSMarko Kovacevic good way to test if the DPDK environment is compiled and set up properly. 97d0dff9baSBernard Iremonger 98*bef33b0aSMarko Kovacevic* :doc:`Basic Forwarding/Skeleton Application<skeleton>`: The Basic 99*bef33b0aSMarko Kovacevic Forwarding/Skeleton contains the minimum amount of code required to enable 100*bef33b0aSMarko Kovacevic basic packet forwarding with DPDK. This allows you to test if your network 101*bef33b0aSMarko Kovacevic interfaces are working with DPDK. 102d0dff9baSBernard Iremonger 103*bef33b0aSMarko Kovacevic* :doc:`Network Layer 2 forwarding<l2_forward_real_virtual>`: The Network Layer 2 104*bef33b0aSMarko Kovacevic forwarding, or ``l2fwd`` application does forwarding based on Ethernet MAC 105*bef33b0aSMarko Kovacevic addresses like a simple switch. 106*bef33b0aSMarko Kovacevic 107*bef33b0aSMarko Kovacevic* :doc:`Network Layer 3 forwarding<l3_forward>`: The Network Layer3 108*bef33b0aSMarko Kovacevic forwarding, or ``l3fwd`` application does forwarding based on Internet 109*bef33b0aSMarko Kovacevic Protocol, IPv4 or IPv6 like a simple router. 110*bef33b0aSMarko Kovacevic 111*bef33b0aSMarko Kovacevic* :doc:`Packet Distributor<dist_app>`: The Packet Distributor 112*bef33b0aSMarko Kovacevic demonstrates how to distribute packets arriving on an Rx port to different 113*bef33b0aSMarko Kovacevic cores for processing and transmission. 114*bef33b0aSMarko Kovacevic 115*bef33b0aSMarko Kovacevic* :doc:`Multi-Process Application<multi_process>`: The 116*bef33b0aSMarko Kovacevic multi-process application shows how two DPDK processes can work together using 117*bef33b0aSMarko Kovacevic queues and memory pools to share information. 118*bef33b0aSMarko Kovacevic 119*bef33b0aSMarko Kovacevic* :doc:`RX/TX callbacks Application<rxtx_callbacks>`: The RX/TX 120*bef33b0aSMarko Kovacevic callbacks sample application is a packet forwarding application that 121*bef33b0aSMarko Kovacevic demonstrates the use of user defined callbacks on received and transmitted 122*bef33b0aSMarko Kovacevic packets. The application calculates the latency of a packet between RX 123*bef33b0aSMarko Kovacevic (packet arrival) and TX (packet transmission) by adding callbacks to the RX 124*bef33b0aSMarko Kovacevic and TX packet processing functions. 125*bef33b0aSMarko Kovacevic 126*bef33b0aSMarko Kovacevic* :doc:`IPSec Security Gateway<ipsec_secgw>`: The IPSec Security 127*bef33b0aSMarko Kovacevic Gateway application is minimal example of something closer to a real world 128*bef33b0aSMarko Kovacevic example. This is also a good example of an application using the DPDK 129*bef33b0aSMarko Kovacevic Cryptodev framework. 130*bef33b0aSMarko Kovacevic 131*bef33b0aSMarko Kovacevic* :doc:`Precision Time Protocol (PTP) client<ptpclient>`: The PTP 132*bef33b0aSMarko Kovacevic client is another minimal implementation of a real world application. 133*bef33b0aSMarko Kovacevic In this case the application is a PTP client that communicates with a PTP 134*bef33b0aSMarko Kovacevic master clock to synchronize time on a Network Interface Card (NIC) using the 135*bef33b0aSMarko Kovacevic IEEE1588 protocol. 136*bef33b0aSMarko Kovacevic 137*bef33b0aSMarko Kovacevic* :doc:`Quality of Service (QoS) Scheduler<qos_scheduler>`: The QoS 138*bef33b0aSMarko Kovacevic Scheduler application demonstrates the use of DPDK to provide QoS scheduling. 139*bef33b0aSMarko Kovacevic 140*bef33b0aSMarko KovacevicThere are many more examples shown in the following chapters. Each of the 141*bef33b0aSMarko Kovacevicdocumented sample applications show how to compile, configure and run the 142*bef33b0aSMarko Kovacevicapplication as well as explaining the main functionality of the code. 143