1fc1f2750SBernard Iremonger.. BSD LICENSE 2fc1f2750SBernard Iremonger Copyright(c) 2010-2014 Intel Corporation. All rights reserved. 3fc1f2750SBernard Iremonger All rights reserved. 4fc1f2750SBernard Iremonger 5fc1f2750SBernard Iremonger Redistribution and use in source and binary forms, with or without 6fc1f2750SBernard Iremonger modification, are permitted provided that the following conditions 7fc1f2750SBernard Iremonger are met: 8fc1f2750SBernard Iremonger 9fc1f2750SBernard Iremonger * Redistributions of source code must retain the above copyright 10fc1f2750SBernard Iremonger notice, this list of conditions and the following disclaimer. 11fc1f2750SBernard Iremonger * Redistributions in binary form must reproduce the above copyright 12fc1f2750SBernard Iremonger notice, this list of conditions and the following disclaimer in 13fc1f2750SBernard Iremonger the documentation and/or other materials provided with the 14fc1f2750SBernard Iremonger distribution. 15fc1f2750SBernard Iremonger * Neither the name of Intel Corporation nor the names of its 16fc1f2750SBernard Iremonger contributors may be used to endorse or promote products derived 17fc1f2750SBernard Iremonger from this software without specific prior written permission. 18fc1f2750SBernard Iremonger 19fc1f2750SBernard Iremonger THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20fc1f2750SBernard Iremonger "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21fc1f2750SBernard Iremonger LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22fc1f2750SBernard Iremonger A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23fc1f2750SBernard Iremonger OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24fc1f2750SBernard Iremonger SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25fc1f2750SBernard Iremonger LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26fc1f2750SBernard Iremonger DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27fc1f2750SBernard Iremonger THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28fc1f2750SBernard Iremonger (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29fc1f2750SBernard Iremonger OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30fc1f2750SBernard Iremonger 31fc1f2750SBernard Iremonger**Part 2: Development Environment** 32fc1f2750SBernard Iremonger 33fc1f2750SBernard IremongerSource Organization 34fc1f2750SBernard Iremonger=================== 35fc1f2750SBernard Iremonger 3648624fd9SSiobhan ButlerThis section describes the organization of sources in the DPDK framework. 37fc1f2750SBernard Iremonger 38fc1f2750SBernard IremongerMakefiles and Config 39fc1f2750SBernard Iremonger-------------------- 40fc1f2750SBernard Iremonger 41fc1f2750SBernard Iremonger.. note:: 42fc1f2750SBernard Iremonger 43fc1f2750SBernard Iremonger In the following descriptions, 44*0e03fe74SJohn McNamara ``RTE_SDK`` is the environment variable that points to the base directory into which the tarball was extracted. 45fc1f2750SBernard Iremonger See 46*0e03fe74SJohn McNamara :ref:`Useful_Variables_Provided_by_the_Build_System` 47fc1f2750SBernard Iremonger for descriptions of other variables. 48fc1f2750SBernard Iremonger 49*0e03fe74SJohn McNamaraMakefiles that are provided by the DPDK libraries and applications are located in ``$(RTE_SDK)/mk``. 50fc1f2750SBernard Iremonger 51*0e03fe74SJohn McNamaraConfig templates are located in ``$(RTE_SDK)/config``. The templates describe the options that are enabled for each target. 5248624fd9SSiobhan ButlerThe config file also contains items that can be enabled and disabled for many of the DPDK libraries, 53fc1f2750SBernard Iremongerincluding debug options. 54*0e03fe74SJohn McNamaraThe user should look at the config file and become familiar with these options. 55fc1f2750SBernard IremongerThe config file is also used to create a header file, which will be located in the new build directory. 56fc1f2750SBernard Iremonger 57fc1f2750SBernard IremongerLibraries 58fc1f2750SBernard Iremonger--------- 59fc1f2750SBernard Iremonger 60*0e03fe74SJohn McNamaraLibraries are located in subdirectories of ``$(RTE_SDK)/lib``. 61*0e03fe74SJohn McNamaraBy convention a library refers to any code that provides an API to an application. 62*0e03fe74SJohn McNamaraTypically, it generates an archive file (``.a``), but a kernel module would also go in the same directory. 63fc1f2750SBernard Iremonger 64fc1f2750SBernard IremongerThe lib directory contains:: 65fc1f2750SBernard Iremonger 66fc1f2750SBernard Iremonger lib 67*0e03fe74SJohn McNamara +-- librte_cmdline # Command line interface helper 68*0e03fe74SJohn McNamara +-- librte_distributor # Packet distributor 69*0e03fe74SJohn McNamara +-- librte_eal # Environment abstraction layer 70*0e03fe74SJohn McNamara +-- librte_ether # Generic interface to poll mode driver 71*0e03fe74SJohn McNamara +-- librte_hash # Hash library 72fc1f2750SBernard Iremonger +-- librte_ip_frag # IP fragmentation library 73fc1f2750SBernard Iremonger +-- librte_ivshmem # QEMU IVSHMEM library 74*0e03fe74SJohn McNamara +-- librte_kni # Kernel NIC interface 75*0e03fe74SJohn McNamara +-- librte_kvargs # Argument parsing library 76*0e03fe74SJohn McNamara +-- librte_lpm # Longest prefix match library 77*0e03fe74SJohn McNamara +-- librte_malloc # Malloc-like functions 78*0e03fe74SJohn McNamara +-- librte_mbuf # Packet and control mbuf manipulation 79*0e03fe74SJohn McNamara +-- librte_mempool # Memory pool manager (fixed sized objects) 80fc1f2750SBernard Iremonger +-- librte_meter # QoS metering library 81*0e03fe74SJohn McNamara +-- librte_net # Various IP-related headers 82*0e03fe74SJohn McNamara +-- librte_power # Power management library 83*0e03fe74SJohn McNamara +-- librte_ring # Software rings (act as lockless FIFOs) 84fc1f2750SBernard Iremonger +-- librte_sched # QoS scheduler and dropper library 85*0e03fe74SJohn McNamara +-- librte_timer # Timer library 86fc1f2750SBernard Iremonger 87980ed498SBruce RichardsonDrivers 88980ed498SBruce Richardson------- 89980ed498SBruce Richardson 90980ed498SBruce RichardsonDrivers are special libraries which provide poll-mode driver implementations for 91*0e03fe74SJohn McNamaradevices: either hardware devices or pseudo/virtual devices. They are contained 92*0e03fe74SJohn McNamarain the *drivers* subdirectory, classified by type, and each compiles to a 93*0e03fe74SJohn McNamaralibrary with the format ``librte_pmd_X.a`` where ``X`` is the driver name. 94980ed498SBruce Richardson 95*0e03fe74SJohn McNamaraThe drivers directory has a *net* subdirectory which contains:: 96980ed498SBruce Richardson 97980ed498SBruce Richardson drivers/net 98*0e03fe74SJohn McNamara +-- af_packet # Poll mode driver based on Linux af_packet 99*0e03fe74SJohn McNamara +-- bonding # Bonding poll mode driver 1004d84a97dSRahul Lakkireddy +-- cxgbe # Chelsio Terminator 10GbE/40GbE poll mode driver 101d15fcf76SBruce Richardson +-- e1000 # 1GbE poll mode drivers (igb and em) 10272f3de30SBruce Richardson +-- enic # Cisco VIC Ethernet NIC Poll-mode Driver 103637bb769SBruce Richardson +-- fm10k # Host interface PMD driver for FM10000 Series 1045c922205SBruce Richardson +-- i40e # 40GbE poll mode driver 105abf7275bSBruce Richardson +-- ixgbe # 10GbE poll mode driver 10698a1f377SBruce Richardson +-- mlx4 # Mellanox ConnectX-3 poll mode driver 107b3b413f7SBruce Richardson +-- null # NULL poll mode driver for testing 108232771c7SBruce Richardson +-- pcap # PCAP poll mode driver 109*0e03fe74SJohn McNamara +-- ring # Ring poll mode driver 110*0e03fe74SJohn McNamara +-- virtio # Virtio poll mode driver 11109452c07SBruce Richardson +-- vmxnet3 # VMXNET3 poll mode driver 1126d71d3b6SBruce Richardson +-- xenvirt # Xen virtio poll mode driver 113980ed498SBruce Richardson 114*0e03fe74SJohn McNamara.. note:: 115*0e03fe74SJohn McNamara 116*0e03fe74SJohn McNamara Several of the ``driver/net`` directories contain a ``base`` 117*0e03fe74SJohn McNamara sub-directory. The ``base`` directory generally contains code the shouldn't 118*0e03fe74SJohn McNamara be modified directly by the user. Any enhancements should be done via the 119*0e03fe74SJohn McNamara ``X_osdep.c`` and/or ``X_osdep.h`` files in that directory. Refer to the 120*0e03fe74SJohn McNamara local README in the base directories for driver specific instructions. 121*0e03fe74SJohn McNamara 122*0e03fe74SJohn McNamara 123fc1f2750SBernard IremongerApplications 124fc1f2750SBernard Iremonger------------ 125fc1f2750SBernard Iremonger 126*0e03fe74SJohn McNamaraApplications are source files that contain a ``main()`` function. 127*0e03fe74SJohn McNamaraThey are located in the ``$(RTE_SDK)/app`` and ``$(RTE_SDK)/examples`` directories. 128fc1f2750SBernard Iremonger 129*0e03fe74SJohn McNamaraThe app directory contains sample applications that are used to test DPDK (such as autotests) 130*0e03fe74SJohn McNamaraor the Poll Mode Drivers (test-pmd):: 131fc1f2750SBernard Iremonger 132fc1f2750SBernard Iremonger app 133*0e03fe74SJohn McNamara +-- chkincs # Test program to check include dependencies 134*0e03fe74SJohn McNamara +-- cmdline_test # Test the commandline library 135*0e03fe74SJohn McNamara +-- test # Autotests to validate DPDK features 136*0e03fe74SJohn McNamara +-- test-acl # Test the ACL library 137*0e03fe74SJohn McNamara +-- test-pipeline # Test the IP Pipeline framework 138*0e03fe74SJohn McNamara +-- test-pmd # Test and benchmark poll mode drivers 139*0e03fe74SJohn McNamara 140*0e03fe74SJohn McNamaraThe examples directory contains sample applications that show how libraries can be used:: 141fc1f2750SBernard Iremonger 142fc1f2750SBernard Iremonger examples 143*0e03fe74SJohn McNamara +-- cmdline # Example of using the cmdline library 144*0e03fe74SJohn McNamara +-- dpdk_qat # Sample integration with Intel QuickAssist 145*0e03fe74SJohn McNamara +-- exception_path # Sending packets to and from Linux TAP device 146*0e03fe74SJohn McNamara +-- helloworld # Basic Hello World example 147*0e03fe74SJohn McNamara +-- ip_reassembly # Example showing IP reassembly 148*0e03fe74SJohn McNamara +-- ip_fragmentation # Example showing IPv4 fragmentation 149*0e03fe74SJohn McNamara +-- ipv4_multicast # Example showing IPv4 multicast 150*0e03fe74SJohn McNamara +-- kni # Kernel NIC Interface (KNI) example 151*0e03fe74SJohn McNamara +-- l2fwd # L2 forwarding with and without SR-IOV 152*0e03fe74SJohn McNamara +-- l3fwd # L3 forwarding example 153*0e03fe74SJohn McNamara +-- l3fwd-power # L3 forwarding example with power management 154*0e03fe74SJohn McNamara +-- l3fwd-vf # L3 forwarding example with SR-IOV 155fc1f2750SBernard Iremonger +-- link_status_interrupt # Link status change interrupt example 156fc1f2750SBernard Iremonger +-- load_balancer # Load balancing across multiple cores/sockets 157*0e03fe74SJohn McNamara +-- multi_process # Example apps using multiple DPDK processes 158fc1f2750SBernard Iremonger +-- qos_meter # QoS metering example 159fc1f2750SBernard Iremonger +-- qos_sched # QoS scheduler and dropper example 160fc1f2750SBernard Iremonger +-- timer # Example of using librte_timer library 161*0e03fe74SJohn McNamara +-- vmdq_dcb # Example of VMDQ and DCB receiving 162*0e03fe74SJohn McNamara +-- vmdq # Example of VMDQ receiving 163*0e03fe74SJohn McNamara +-- vhost # Example of userspace vhost and switch 164fc1f2750SBernard Iremonger 165fc1f2750SBernard Iremonger.. note:: 166fc1f2750SBernard Iremonger 167fc1f2750SBernard Iremonger The actual examples directory may contain additional sample applications to those shown above. 16848624fd9SSiobhan Butler Check the latest DPDK source files for details. 169