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