1.. SPDX-License-Identifier: BSD-3-Clause 2 Copyright(c) 2010-2014 Intel Corporation. 3 4Overview 5======== 6 7This section gives a global overview of the architecture of Data Plane Development Kit (DPDK). 8 9The main goal of the DPDK is to provide a simple, 10complete framework for fast packet processing in data plane applications. 11Users may use the code to understand some of the techniques employed, 12to build upon for prototyping or to add their own protocol stacks. 13Alternative ecosystem options that use the DPDK are available. 14 15The framework creates a set of libraries for specific environments 16through the creation of an Environment Abstraction Layer (EAL), 17which may be specific to a mode of the Intel® architecture (32-bit or 64-bit), 18Linux* user space compilers or a specific platform. 19These environments are created through the use of meson files and configuration files. 20Once the EAL library is created, the user may link with the library to create their own applications. 21Other libraries, outside of EAL, including the Hash, 22Longest Prefix Match (LPM) and rings libraries are also provided. 23Sample applications are provided to help show the user how to use various features of the DPDK. 24 25The DPDK implements a run to completion model for packet processing, 26where all resources must be allocated prior to calling Data Plane applications, 27running as execution units on logical processing cores. 28The model does not support a scheduler and all devices are accessed by polling. 29The primary reason for not using interrupts is the performance overhead imposed by interrupt processing. 30 31In addition to the run-to-completion model, 32a pipeline model may also be used by passing packets or messages between cores via the rings. 33This allows work to be performed in stages and may allow more efficient use of code on cores. 34 35Development Environment 36----------------------- 37 38The DPDK project installation requires Linux and the associated toolchain, 39such as one or more compilers, assembler, meson utility, 40editor and various libraries to create the DPDK components and libraries. 41 42Once these libraries are created for the specific environment and architecture, 43they may then be used to create the user's data plane application. 44 45When creating applications for the Linux user space, the glibc library is used. 46 47See the *DPDK Getting Started Guide* for information on setting up the development environment. 48 49Environment Abstraction Layer 50----------------------------- 51 52The Environment Abstraction Layer (EAL) provides a generic interface 53that hides the environment specifics from the applications and libraries. 54The services provided by the EAL are: 55 56* DPDK loading and launching 57 58* Support for multi-process and multi-thread execution types 59 60* Core affinity/assignment procedures 61 62* System memory allocation/de-allocation 63 64* Atomic/lock operations 65 66* Time reference 67 68* PCI bus access 69 70* Trace and debug functions 71 72* CPU feature identification 73 74* Interrupt handling 75 76* Alarm operations 77 78* Memory management (malloc) 79 80The EAL is fully described in :doc:`env_abstraction_layer`. 81 82Core Components 83--------------- 84 85The *core components* are a set of libraries that provide all the elements needed 86for high-performance packet processing applications. 87 88.. _figure_architecture-overview: 89 90.. figure:: img/architecture-overview.* 91 92 Core Components Architecture 93 94 95Ring Manager (librte_ring) 96~~~~~~~~~~~~~~~~~~~~~~~~~~ 97 98The ring structure provides a lockless multi-producer, multi-consumer FIFO API in a finite size table. 99It has some advantages over lockless queues; easier to implement, adapted to bulk operations and faster. 100A ring is used by the :doc:`mempool_lib` 101and may be used as a general communication mechanism between cores 102and/or execution blocks connected together on a logical core. 103 104This ring buffer and its usage are fully described in :doc:`ring_lib`. 105 106Memory Pool Manager (librte_mempool) 107~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 108 109The Memory Pool Manager is responsible for allocating pools of objects in memory. 110A pool is identified by name and uses a ring to store free objects. 111It provides some other optional services, 112such as a per-core object cache and an alignment helper to ensure that objects are padded to spread them equally on all RAM channels. 113 114This memory pool allocator is described in :doc:`mempool_lib`. 115 116Network Packet Buffer Management (librte_mbuf) 117~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 119The mbuf library provides the facility to create and destroy buffers 120that may be used by the DPDK application to store message buffers. 121The message buffers are created at startup time and stored in a mempool, using the DPDK mempool library. 122 123This library provides an API to allocate/free mbufs, manipulate 124packet buffers which are used to carry network packets. 125 126Network Packet Buffer Management is described in :doc:`mbuf_lib`. 127 128Timer Manager (librte_timer) 129~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 130 131This library provides a timer service to DPDK execution units, 132providing the ability to execute a function asynchronously. 133It can be periodic function calls, or just a one-shot call. 134It uses the timer interface provided by the Environment Abstraction Layer (EAL) 135to get a precise time reference and can be initiated on a per-core basis as required. 136 137The library documentation is available in :doc:`timer_lib`. 138 139Ethernet* Poll Mode Driver Architecture 140--------------------------------------- 141 142The DPDK includes Poll Mode Drivers (PMDs) for 1 GbE, 10 GbE and 40GbE, and para virtualized virtio 143Ethernet controllers which are designed to work without asynchronous, interrupt-based signaling mechanisms. 144 145Packet Forwarding Algorithm Support 146----------------------------------- 147 148The DPDK includes Hash (librte_hash) and Longest Prefix Match (LPM,librte_lpm) 149libraries to support the corresponding packet forwarding algorithms. 150 151See :doc:`hash_lib` and :doc:`lpm_lib` for more information. 152 153librte_net 154---------- 155 156The librte_net library is a collection of IP protocol definitions and convenience macros. 157It is based on code from the FreeBSD* IP stack and contains protocol numbers (for use in IP headers), 158IP-related macros, IPv4/IPv6 header structures and TCP, UDP and SCTP header structures. 159