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 IremongerProgrammer's Guide 32fc1f2750SBernard Iremonger================== 33fc1f2750SBernard Iremonger 34a9bc351cSBruce Richardson|today| 35fc1f2750SBernard Iremonger 36fc1f2750SBernard Iremonger 37fc1f2750SBernard Iremonger**Contents** 38fc1f2750SBernard Iremonger 39fc1f2750SBernard Iremonger.. toctree:: 40fc1f2750SBernard Iremonger :maxdepth: 3 41fc1f2750SBernard Iremonger :numbered: 42fc1f2750SBernard Iremonger 43fc1f2750SBernard Iremonger intro 44fc1f2750SBernard Iremonger overview 45fc1f2750SBernard Iremonger env_abstraction_layer 46fc1f2750SBernard Iremonger malloc_lib 47fc1f2750SBernard Iremonger ring_lib 48fc1f2750SBernard Iremonger mempool_lib 49fc1f2750SBernard Iremonger mbuf_lib 50fc1f2750SBernard Iremonger poll_mode_drv 51fc1f2750SBernard Iremonger i40e_ixgbe_igb_virt_func_drv 52fc1f2750SBernard Iremonger driver_vm_emul_dev 53fc1f2750SBernard Iremonger ivshmem_lib 54fc1f2750SBernard Iremonger poll_mode_drv_emulated_virtio_nic 55fc1f2750SBernard Iremonger poll_mode_drv_paravirtual_vmxnets_nic 56fc1f2750SBernard Iremonger intel_dpdk_xen_based_packet_switch_sol 57fc1f2750SBernard Iremonger libpcap_ring_based_poll_mode_drv 58fc1f2750SBernard Iremonger link_bonding_poll_mode_drv_lib 59fc1f2750SBernard Iremonger timer_lib 60fc1f2750SBernard Iremonger hash_lib 61fc1f2750SBernard Iremonger lpm_lib 62fc1f2750SBernard Iremonger lpm6_lib 63fc1f2750SBernard Iremonger packet_distrib_lib 64*34287c69SSergio Gonzalez Monroy reorder_lib 65fc1f2750SBernard Iremonger ip_fragment_reassembly_lib 66fc1f2750SBernard Iremonger multi_proc_support 67fc1f2750SBernard Iremonger kernel_nic_interface 68fc1f2750SBernard Iremonger thread_safety_intel_dpdk_functions 69fc1f2750SBernard Iremonger qos_framework 70fc1f2750SBernard Iremonger power_man 71fc1f2750SBernard Iremonger packet_classif_access_ctrl 72fc1f2750SBernard Iremonger packet_framework 730ee5e7fbSSiobhan Butler vhost_lib 74fc1f2750SBernard Iremonger source_org 75fc1f2750SBernard Iremonger dev_kit_build_system 76fc1f2750SBernard Iremonger dev_kit_root_make_help 77fc1f2750SBernard Iremonger extend_intel_dpdk 78fc1f2750SBernard Iremonger build_app 79fc1f2750SBernard Iremonger ext_app_lib_make_help 80fc1f2750SBernard Iremonger perf_opt_guidelines 81fc1f2750SBernard Iremonger writing_efficient_code 82fc1f2750SBernard Iremonger profile_app 83fc1f2750SBernard Iremonger glossary 84fc1f2750SBernard Iremonger 85fc1f2750SBernard Iremonger 86fc1f2750SBernard Iremonger**Figures** 87fc1f2750SBernard Iremonger 88fc1f2750SBernard Iremonger:ref:`Figure 1. Core Components Architecture <pg_figure_1>` 89fc1f2750SBernard Iremonger 90fc1f2750SBernard Iremonger:ref:`Figure 2. EAL Initialization in a Linux Application Environment <pg_figure_2>` 91fc1f2750SBernard Iremonger 92fc1f2750SBernard Iremonger:ref:`Figure 3. Example of a malloc heap and malloc elements within the malloc library <pg_figure_3>` 93fc1f2750SBernard Iremonger 94fc1f2750SBernard Iremonger:ref:`Figure 4. Ring Structure <pg_figure_4>` 95fc1f2750SBernard Iremonger 96fc1f2750SBernard Iremonger:ref:`Figure 5. Two Channels and Quad-ranked DIMM Example <pg_figure_5>` 97fc1f2750SBernard Iremonger 98fc1f2750SBernard Iremonger:ref:`Figure 6. Three Channels and Two Dual-ranked DIMM Example <pg_figure_6>` 99fc1f2750SBernard Iremonger 100fc1f2750SBernard Iremonger:ref:`Figure 7. A mempool in Memory with its Associated Ring <pg_figure_7>` 101fc1f2750SBernard Iremonger 102fc1f2750SBernard Iremonger:ref:`Figure 8. An mbuf with One Segment <pg_figure_8>` 103fc1f2750SBernard Iremonger 104fc1f2750SBernard Iremonger:ref:`Figure 9. An mbuf with Three Segments <pg_figure_9>` 105fc1f2750SBernard Iremonger 106fc1f2750SBernard Iremonger:ref:`Figure 10. Virtualization for a Single Port NIC in SR-IOV Mode <pg_figure_10>` 107fc1f2750SBernard Iremonger 108fc1f2750SBernard Iremonger:ref:`Figure 11. Performance Benchmark Setup <pg_figure_11>` 109fc1f2750SBernard Iremonger 110fc1f2750SBernard Iremonger:ref:`Figure 12. Fast Host-based Packet Processing <pg_figure_12>` 111fc1f2750SBernard Iremonger 112fc1f2750SBernard Iremonger:ref:`Figure 13. Inter-VM Communication <pg_figure_13>` 113fc1f2750SBernard Iremonger 114fc1f2750SBernard Iremonger:ref:`Figure 14. Host2VM Communication Example Using kni vhost Back End <pg_figure_14>` 115fc1f2750SBernard Iremonger 116fc1f2750SBernard Iremonger:ref:`Figure 15. Host2VM Communication Example Using qemu vhost Back End <pg_figure_15>` 117fc1f2750SBernard Iremonger 118fc1f2750SBernard Iremonger:ref:`Figure 16. Memory Sharing inthe Intel® DPDK Multi-process Sample Application <pg_figure_16>` 119fc1f2750SBernard Iremonger 120fc1f2750SBernard Iremonger:ref:`Figure 17. Components of an Intel® DPDK KNI Application <pg_figure_17>` 121fc1f2750SBernard Iremonger 122fc1f2750SBernard Iremonger:ref:`Figure 18. Packet Flow via mbufs in the Intel DPDK® KNI <pg_figure_18>` 123fc1f2750SBernard Iremonger 124fc1f2750SBernard Iremonger:ref:`Figure 19. vHost-net Architecture Overview <pg_figure_19>` 125fc1f2750SBernard Iremonger 126fc1f2750SBernard Iremonger:ref:`Figure 20. KNI Traffic Flow <pg_figure_20>` 127fc1f2750SBernard Iremonger 128fc1f2750SBernard Iremonger:ref:`Figure 21. Complex Packet Processing Pipeline with QoS Support <pg_figure_21>` 129fc1f2750SBernard Iremonger 130fc1f2750SBernard Iremonger:ref:`Figure 22. Hierarchical Scheduler Block Internal Diagram <pg_figure_22>` 131fc1f2750SBernard Iremonger 132fc1f2750SBernard Iremonger:ref:`Figure 23. Scheduling Hierarchy per Port <pg_figure_23>` 133fc1f2750SBernard Iremonger 134fc1f2750SBernard Iremonger:ref:`Figure 24. Internal Data Structures per Port <pg_figure_24>` 135fc1f2750SBernard Iremonger 136fc1f2750SBernard Iremonger:ref:`Figure 25. Prefetch Pipeline for the Hierarchical Scheduler Enqueue Operation <pg_figure_25>` 137fc1f2750SBernard Iremonger 138fc1f2750SBernard Iremonger:ref:`Figure 26. Pipe Prefetch State Machine for the Hierarchical Scheduler Dequeue Operation <pg_figure_26>` 139fc1f2750SBernard Iremonger 140fc1f2750SBernard Iremonger:ref:`Figure 27. High-level Block Diagram of the Intel® DPDK Dropper <pg_figure_27>` 141fc1f2750SBernard Iremonger 142fc1f2750SBernard Iremonger:ref:`Figure 28. Flow Through the Dropper <pg_figure_28>` 143fc1f2750SBernard Iremonger 144fc1f2750SBernard Iremonger:ref:`Figure 29. Example Data Flow Through Dropper <pg_figure_29>` 145fc1f2750SBernard Iremonger 146fc1f2750SBernard Iremonger:ref:`Figure 30. Packet Drop Probability for a Given RED Configuration <pg_figure_30>` 147fc1f2750SBernard Iremonger 148fc1f2750SBernard Iremonger:ref:`Figure 31. Initial Drop Probability (pb), Actual Drop probability (pa) Computed Using a Factor 1 (Blue Curve) and a Factor 2 (Red Curve) <pg_figure_31>` 149fc1f2750SBernard Iremonger 150fc1f2750SBernard Iremonger:ref:`Figure 32. Example of packet processing pipeline. The input ports 0 and 1 are connected with the output ports 0, 1 and 2 through tables 0 and 1. <pg_figure_32>` 151fc1f2750SBernard Iremonger 152fc1f2750SBernard Iremonger:ref:`Figure 33. Sequence of steps for hash table operations in packet processing context <pg_figure_33>` 153fc1f2750SBernard Iremonger 154fc1f2750SBernard Iremonger:ref:`Figure 34. Data structures for configurable key size hash tables <pg_figure_34>` 155fc1f2750SBernard Iremonger 156fc1f2750SBernard Iremonger:ref:`Figure 35. Bucket search pipeline for key lookup operation (configurable key size hash tables) <pg_figure_35>` 157fc1f2750SBernard Iremonger 158fc1f2750SBernard Iremonger:ref:`Figure 36. Pseudo-code for match, match_many and match_pos <pg_figure_36>` 159fc1f2750SBernard Iremonger 160fc1f2750SBernard Iremonger:ref:`Figure 37. Data structures for 8-byte key hash tables <pg_figure_37>` 161fc1f2750SBernard Iremonger 162fc1f2750SBernard Iremonger:ref:`Figure 38. Data structures for 16-byte key hash tables <pg_figure_38>` 163fc1f2750SBernard Iremonger 164fc1f2750SBernard Iremonger:ref:`Figure 39. Bucket search pipeline for key lookup operation (single key size hash tables) <pg_figure_39>` 165fc1f2750SBernard Iremonger 166fc1f2750SBernard Iremonger**Tables** 167fc1f2750SBernard Iremonger 168fc1f2750SBernard Iremonger:ref:`Table 1. Packet Processing Pipeline Implementing QoS <pg_table_1>` 169fc1f2750SBernard Iremonger 170fc1f2750SBernard Iremonger:ref:`Table 2. Infrastructure Blocks Used by the Packet Processing Pipeline <pg_table_2>` 171fc1f2750SBernard Iremonger 172fc1f2750SBernard Iremonger:ref:`Table 3. Port Scheduling Hierarchy <pg_table_3>` 173fc1f2750SBernard Iremonger 174fc1f2750SBernard Iremonger:ref:`Table 4. Scheduler Internal Data Structures per Port <pg_table_4>` 175fc1f2750SBernard Iremonger 176fc1f2750SBernard Iremonger:ref:`Table 5. Ethernet Frame Overhead Fields <pg_table_5>` 177fc1f2750SBernard Iremonger 178fc1f2750SBernard Iremonger:ref:`Table 6. Token Bucket Generic Operations <pg_table_6>` 179fc1f2750SBernard Iremonger 180fc1f2750SBernard Iremonger:ref:`Table 7. Token Bucket Generic Parameters <pg_table_7>` 181fc1f2750SBernard Iremonger 182fc1f2750SBernard Iremonger:ref:`Table 8. Token Bucket Persistent Data Structure <pg_table_8>` 183fc1f2750SBernard Iremonger 184fc1f2750SBernard Iremonger:ref:`Table 9. Token Bucket Operations <pg_table_9>` 185fc1f2750SBernard Iremonger 186fc1f2750SBernard Iremonger:ref:`Table 10. Subport/Pipe Traffic Class Upper Limit Enforcement Persistent Data Structure <pg_table_10>` 187fc1f2750SBernard Iremonger 188fc1f2750SBernard Iremonger:ref:`Table 11. Subport/Pipe Traffic Class Upper Limit Enforcement Operations <pg_table_11>` 189fc1f2750SBernard Iremonger 190fc1f2750SBernard Iremonger:ref:`Table 12. Weighted Round Robin (WRR) <pg_table_12>` 191fc1f2750SBernard Iremonger 192fc1f2750SBernard Iremonger:ref:`Table 13. Subport Traffic Class Oversubscription <pg_table_13>` 193fc1f2750SBernard Iremonger 194fc1f2750SBernard Iremonger:ref:`Table 14. Watermark Propagation from Subport Level to Member Pipes at the Beginning of Each Traffic Class Upper Limit Enforcement Period <pg_table_14>` 195fc1f2750SBernard Iremonger 196fc1f2750SBernard Iremonger:ref:`Table 15. Watermark Calculation <pg_table_15>` 197fc1f2750SBernard Iremonger 198fc1f2750SBernard Iremonger:ref:`Table 16. RED Configuration Parameters <pg_table_16>` 199fc1f2750SBernard Iremonger 200fc1f2750SBernard Iremonger:ref:`Table 17. Relative Performance of Alternative Approaches <pg_table_17>` 201fc1f2750SBernard Iremonger 202fc1f2750SBernard Iremonger:ref:`Table 18. RED Configuration Corresponding to RED Configuration File <pg_table_18>` 203fc1f2750SBernard Iremonger 204fc1f2750SBernard Iremonger:ref:`Table 19. Port types <pg_table_19>` 205fc1f2750SBernard Iremonger 206fc1f2750SBernard Iremonger:ref:`Table 20. Port abstract interface <pg_table_20>` 207fc1f2750SBernard Iremonger 208fc1f2750SBernard Iremonger:ref:`Table 21. Table types <pg_table_21>` 209fc1f2750SBernard Iremonger 210fc1f2750SBernard Iremonger:ref:`Table 29. Table Abstract Interface <pg_table_29_1>` 211fc1f2750SBernard Iremonger 212fc1f2750SBernard Iremonger:ref:`Table 22. Configuration parameters common for all hash table types <pg_table_22>` 213fc1f2750SBernard Iremonger 214fc1f2750SBernard Iremonger:ref:`Table 23. Configuration parameters specific to extendible bucket hash table <pg_table_23>` 215fc1f2750SBernard Iremonger 216fc1f2750SBernard Iremonger:ref:`Table 24. Configuration parameters specific to pre-computed key signature hash table <pg_table_24>` 217fc1f2750SBernard Iremonger 218fc1f2750SBernard Iremonger:ref:`Table 25. The main large data structures (arrays) used for configurable key size hash tables <pg_table_25>` 219fc1f2750SBernard Iremonger 220fc1f2750SBernard Iremonger:ref:`Table 26. Field description for bucket array entry (configurable key size hash tables) <pg_table_26>` 221fc1f2750SBernard Iremonger 222fc1f2750SBernard Iremonger:ref:`Table 27. Description of the bucket search pipeline stages (configurable key size hash tables) <pg_table_27>` 223fc1f2750SBernard Iremonger 224fc1f2750SBernard Iremonger:ref:`Table 28. Lookup tables for match, match_many, match_pos <pg_table_28>` 225fc1f2750SBernard Iremonger 226fc1f2750SBernard Iremonger:ref:`Table 29. Collapsed lookup tables for match, match_many and match_pos <pg_table_29>` 227fc1f2750SBernard Iremonger 228fc1f2750SBernard Iremonger:ref:`Table 30. The main large data structures (arrays) used for 8-byte and 16-byte key size hash tables <pg_table_30>` 229fc1f2750SBernard Iremonger 230fc1f2750SBernard Iremonger:ref:`Table 31. Field description for bucket array entry (8-byte and 16-byte key hash tables) <pg_table_31>` 231fc1f2750SBernard Iremonger 232fc1f2750SBernard Iremonger:ref:`Table 32. Description of the bucket search pipeline stages (8-byte and 16-byte key hash tables) <pg_table_32>` 233fc1f2750SBernard Iremonger 234fc1f2750SBernard Iremonger:ref:`Table 33. Next hop actions (reserved) <pg_table_33>` 235fc1f2750SBernard Iremonger 236fc1f2750SBernard Iremonger:ref:`Table 34. User action examples <pg_table_34>` 237