Programmer’s Guide
- 1. Introduction
- 2. Overview
- 3. Environment Abstraction Layer
- 3.1. EAL in a Linux-userland Execution Environment
- 3.1.1. Initialization and Core Launching
- 3.1.2. Shutdown and Cleanup
- 3.1.3. Multi-process Support
- 3.1.4. Memory Mapping Discovery and Memory Reservation
- 3.1.5. PCI Access
- 3.1.6. Per-lcore and Shared Variables
- 3.1.7. Logs
- 3.1.8. CPU Feature Identification
- 3.1.9. User Space Interrupt Event
- 3.1.10. Blacklisting
- 3.1.11. Misc Functions
- 3.2. Memory Segments and Memory Zones (memzone)
- 3.3. Multiple pthread
- 3.4. Malloc
- 3.1. EAL in a Linux-userland Execution Environment
- 4. Service Cores
- 5. Ring Library
- 6. Mempool Library
- 7. Mbuf Library
- 8. Poll Mode Driver
- 9. Generic flow API (rte_flow)
- 10. Switch Representation within DPDK Applications
- 11. Traffic Metering and Policing API
- 12. Traffic Management API
- 13. Wireless Baseband Device Library
- 14. Cryptography Device Library
- 15. Compression Device Library
- 16. Security Library
- 17. Rawdevice Library
- 18. Link Bonding Poll Mode Driver Library
- 19. Timer Library
- 20. Hash Library
- 21. Elastic Flow Distributor Library
- 22. Membership Library
- 23. LPM Library
- 24. LPM6 Library
- 25. Flow Classification Library
- 26. Packet Distributor Library
- 27. Reorder Library
- 28. IP Fragmentation and Reassembly Library
- 29. Generic Receive Offload Library
- 30. Generic Segmentation Offload Library
- 31. The librte_pdump Library
- 32. Multi-process Support
- 33. Kernel NIC Interface
- 34. Thread Safety of DPDK Functions
- 35. Event Device Library
- 36. Event Ethernet Rx Adapter Library
- 36.1. API Walk-through
- 36.1.1. Creating an Adapter Instance
- 36.1.2. Adding Rx Queues to the Adapter Instance
- 36.1.3. Querying Adapter Capabilities
- 36.1.4. Configuring the Service Function
- 36.1.5. Starting the Adapter Instance
- 36.1.6. Getting Adapter Statistics
- 36.1.7. Interrupt Based Rx Queues
- 36.1.8. Rx Callback for SW Rx Adapter
- 36.1. API Walk-through
- 37. Event Timer Adapter Library
- 38. Event Crypto Adapter Library
- 39. Quality of Service (QoS) Framework
- 40. Power Management
- 41. Packet Classification and Access Control
- 42. Packet Framework
- 43. Vhost Library
- 44. Metrics Library
- 45. Port Hotplug Framework
- 46. Berkeley Packet Filter Library
- 47. Source Organization
- 48. Development Kit Build System
- 48.1. Building the Development Kit Binary
- 48.2. Building External Applications
- 48.3. Makefile Description
- 48.3.1. General Rules For DPDK Makefiles
- 48.3.2. Makefile Types
- 48.3.3. Internally Generated Build Tools
- 48.3.4. Useful Variables Provided by the Build System
- 48.3.5. Variables that Can be Set/Overridden in a Makefile Only
- 48.3.6. Variables that can be Set/Overridden by the User on the Command Line Only
- 48.3.7. Variables that Can be Set/Overridden by the User in a Makefile or Command Line
- 49. Development Kit Root Makefile Help
- 50. Extending the DPDK
- 51. Building Your Own Application
- 52. External Application/Library Makefile help
- 53. Performance Optimization Guidelines
- 54. Writing Efficient Code
- 55. Profile Your Application
- 56. Glossary
Figures
Fig. 2.1 Core Components Architecture
Fig. 3.1 EAL Initialization in a Linux Application Environment
Fig. 3.2 Example of a malloc heap and malloc elements within the malloc library
Fig. 5.9 Multiple producer enqueue first step
Fig. 5.10 Multiple producer enqueue second step
Fig. 5.11 Multiple producer enqueue third step
Fig. 5.12 Multiple producer enqueue fourth step
Fig. 5.13 Multiple producer enqueue last step
Fig. 5.14 Modulo 32-bit indexes - Example 1
Fig. 5.15 Modulo 32-bit indexes - Example 2
Fig. 6.1 Two Channels and Quad-ranked DIMM Example
Fig. 6.2 Three Channels and Two Dual-ranked DIMM Example
Fig. 6.3 A mempool in Memory with its Associated Ring
Fig. 7.1 An mbuf with One Segment
Fig. 7.2 An mbuf with Three Segments
Fig. 32.1 Memory Sharing in the DPDK Multi-process Sample Application
Fig. 33.1 Components of a DPDK KNI Application
Fig. 33.2 Packet Flow via mbufs in the DPDK KNI
Fig. 39.1 Complex Packet Processing Pipeline with QoS Support
Fig. 39.2 Hierarchical Scheduler Block Internal Diagram
Fig. 39.3 Scheduling Hierarchy per Port
Fig. 39.4 Internal Data Structures per Port
Fig. 39.5 Prefetch Pipeline for the Hierarchical Scheduler Enqueue Operation
Fig. 39.6 Pipe Prefetch State Machine for the Hierarchical Scheduler Dequeue Operation
Fig. 39.7 High-level Block Diagram of the DPDK Dropper
Fig. 39.8 Flow Through the Dropper
Fig. 39.9 Example Data Flow Through Dropper
Fig. 39.10 Packet Drop Probability for a Given RED Configuration
Fig. 39.11 Initial Drop Probability (pb), Actual Drop probability (pa) Computed Using a Factor 1 (Blue Curve) and a Factor 2 (Red Curve)
Fig. 42.3 Example of Packet Processing Pipeline where Input Ports 0 and 1 are Connected with Output Ports 0, 1 and 2 through Tables 0 and 1
Fig. 42.4 Sequence of Steps for Hash Table Operations in a Packet Processing Context
Fig. 42.5 Data Structures for Configurable Key Size Hash Tables
Fig. 42.6 Bucket Search Pipeline for Key Lookup Operation (Configurable Key Size Hash Tables)
Fig. 42.7 Data Structures for 8-byte Key Hash Tables
Fig. 42.8 Data Structures for 16-byte Key Hash Tables
Fig. 42.9 Bucket Search Pipeline for Key Lookup Operation (Single Key Size Hash Tables)
Fig. 21.1 Load Balancing Using Front End Node
Fig. 21.3 Table Based Flow Distribution
Fig. 21.4 Searching for Perfect Hash Function
Fig. 21.5 Divide and Conquer for Millions of Keys
Fig. 21.6 EFD as a Flow-Level Load Balancer
Fig. 21.8 Perfect Hash Search - Assigned Keys & Target Value
Fig. 21.9 Perfect Hash Search - Satisfy Target Values
Fig. 21.10 Finding Hash Index for Conflict Free lookup_table
Fig. 21.11 EFD Lookup Operation
Fig. 22.3 Example Usages of Membership Library
Fig. 22.4 Bloom Filter False Positive Probability
Fig. 22.5 Detecting Routing Loops Using BF
Fig. 22.6 Vector Bloom Filter (vBF) Overview
Fig. 22.7 vBF for Flow Scheduling to Worker Thread
Fig. 22.8 Using HTSS for Attack Signature Matching
Fig. 22.9 Using HTSS with False Negatives for Wild Card Classification
Tables
Table 39.2 Packet Processing Pipeline Implementing QoS
Table 39.3 Infrastructure Blocks Used by the Packet Processing Pipeline
Table 39.4 Port Scheduling Hierarchy
Table 39.5 Scheduler Internal Data Structures per Port
Table 39.6 Ethernet Frame Overhead Fields
Table 39.7 Token Bucket Generic Parameters
Table 39.8 Token Bucket Generic Operations
Table 39.9 Token Bucket Persistent Data Structure
Table 39.10 Token Bucket Operations
Table 39.11 Subport/Pipe Traffic Class Upper Limit Enforcement Persistent Data Structure
Table 39.12 Subport/Pipe Traffic Class Upper Limit Enforcement Operations
Table 39.13 Weighted Round Robin (WRR)
Table 39.14 Subport Traffic Class Oversubscription
Table 39.15 Watermark Propagation from Subport Level to Member Pipes at the Beginning of Each Traffic Class Upper Limit Enforcement Period
Table 39.16 Watermark Calculation
Table 39.17 RED Configuration Parameters
Table 39.18 Relative Performance of Alternative Approaches
Table 39.19 RED Configuration Corresponding to RED Configuration File
Table 42.2 20 Port Abstract Interface
Table 42.5 Configuration Parameters Common for All Hash Table Types
Table 42.6 Configuration Parameters Specific to Extendable Bucket Hash Table
Table 42.7 Configuration Parameters Specific to Pre-computed Key Signature Hash Table
Table 42.8 Main Large Data Structures (Arrays) used for Configurable Key Size Hash Tables
Table 42.9 Field Description for Bucket Array Entry (Configurable Key Size Hash Tables)
Table 42.10 Description of the Bucket Search Pipeline Stages (Configurable Key Size Hash Tables)
Table 42.11 Lookup Tables for Match, Match_Many and Match_Pos
Table 42.12 Collapsed Lookup Tables for Match, Match_Many and Match_Pos
Table 42.13 Main Large Data Structures (Arrays) used for 8-byte and 16-byte Key Size Hash Tables
Table 42.14 Field Description for Bucket Array Entry (8-byte and 16-byte Key Hash Tables)
Table 42.15 Description of the Bucket Search Pipeline Stages (8-byte and 16-byte Key Hash Tables)
Table 42.16 Next Hop Actions (Reserved)
Table 42.17 User Action Examples
Table 20.1 Entry distribution measured with an example table with 1024 random entries using jhash algorithm
Table 20.2 Entry distribution measured with an example table with 1 million random entries using jhash algorithm