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