Sample Applications User Guide Release 16.04.0
Total Page:16
File Type:pdf, Size:1020Kb
Sample Applications User Guide Release 16.04.0 April 12, 2016 CONTENTS 1 Introduction 1 1.1 Documentation Roadmap...............................1 2 Command Line Sample Application2 2.1 Overview........................................2 2.2 Compiling the Application...............................2 2.3 Running the Application................................3 2.4 Explanation.......................................3 3 Ethtool Sample Application5 3.1 Compiling the Application...............................5 3.2 Running the Application................................5 3.3 Using the application.................................5 3.4 Explanation.......................................6 3.5 Ethtool interface....................................6 4 Exception Path Sample Application8 4.1 Overview........................................8 4.2 Compiling the Application...............................9 4.3 Running the Application................................9 4.4 Explanation....................................... 10 5 Hello World Sample Application 13 5.1 Compiling the Application............................... 13 5.2 Running the Application................................ 13 5.3 Explanation....................................... 13 6 Basic Forwarding Sample Application 15 6.1 Compiling the Application............................... 15 6.2 Running the Application................................ 15 6.3 Explanation....................................... 15 7 RX/TX Callbacks Sample Application 20 7.1 Compiling the Application............................... 20 7.2 Running the Application................................ 20 7.3 Explanation....................................... 21 8 IP Fragmentation Sample Application 24 8.1 Overview........................................ 24 8.2 Building the Application................................ 24 i 8.3 Running the Application................................ 25 9 IPv4 Multicast Sample Application 27 9.1 Overview........................................ 27 9.2 Building the Application................................ 27 9.3 Running the Application................................ 28 9.4 Explanation....................................... 28 10 IP Reassembly Sample Application 33 10.1 Overview........................................ 33 10.2 The Longest Prefix Match (LPM for IPv4, LPM6 for IPv6) table is used to store/lookup an outgoing port number, associated with that IPv4 address. Any unmatched packets are forwarded to the originating port.Compiling the Appli- cation.......................................... 33 10.3 Running the Application................................ 34 10.4 Explanation....................................... 35 11 Kernel NIC Interface Sample Application 38 11.1 Overview........................................ 38 11.2 Compiling the Application............................... 39 11.3 Loading the Kernel Module.............................. 39 11.4 Running the Application................................ 40 11.5 KNI Operations.................................... 41 11.6 Explanation....................................... 41 12 Keep Alive Sample Application 48 12.1 Overview........................................ 48 12.2 Compiling the Application............................... 48 12.3 Running the Application................................ 49 12.4 Explanation....................................... 49 13 L2 Forwarding with Crypto Sample Application 51 13.1 Overview........................................ 51 13.2 Compiling the Application............................... 51 13.3 Running the Application................................ 51 13.4 Explanation....................................... 53 14 L2 Forwarding Sample Application (in Real and Virtualized Environments) with core load statistics. 58 14.1 Overview........................................ 58 14.2 Compiling the Application............................... 60 14.3 Running the Application................................ 60 14.4 Explanation....................................... 60 15 L2 Forwarding Sample Application (in Real and Virtualized Environments) 69 15.1 Overview........................................ 69 15.2 Compiling the Application............................... 71 15.3 Running the Application................................ 71 15.4 Explanation....................................... 71 16 L2 Forwarding Sample Application with Cache Allocation Technology (CAT) 78 16.1 Compiling the Application............................... 78 16.2 Running the Application................................ 79 ii 16.3 Explanation....................................... 80 17 L3 Forwarding Sample Application 82 17.1 Overview........................................ 82 17.2 Compiling the Application............................... 82 17.3 Running the Application................................ 83 17.4 Explanation....................................... 84 18 L3 Forwarding with Power Management Sample Application 88 18.1 Introduction....................................... 88 18.2 Overview........................................ 88 18.3 Compiling the Application............................... 89 18.4 Running the Application................................ 89 18.5 Explanation....................................... 90 19 L3 Forwarding with Access Control Sample Application 95 19.1 Overview........................................ 95 19.2 Compiling the Application............................... 99 19.3 Running the Application................................ 99 19.4 Explanation....................................... 100 20 L3 Forwarding in a Virtualization Environment Sample Application 102 20.1 Overview........................................ 102 20.2 Compiling the Application............................... 102 20.3 Running the Application................................ 103 20.4 Explanation....................................... 104 21 Link Status Interrupt Sample Application 105 21.1 Overview........................................ 105 21.2 Compiling the Application............................... 105 21.3 Running the Application................................ 106 21.4 Explanation....................................... 106 22 Load Balancer Sample Application 112 22.1 Overview........................................ 112 22.2 Compiling the Application............................... 113 22.3 Running the Application................................ 113 22.4 Explanation....................................... 114 23 Multi-process Sample Application 117 23.1 Example Applications................................. 117 24 QoS Metering Sample Application 132 24.1 Overview........................................ 132 24.2 Compiling the Application............................... 132 24.3 Running the Application................................ 133 24.4 Explanation....................................... 133 25 QoS Scheduler Sample Application 135 25.1 Overview........................................ 135 25.2 Compiling the Application............................... 135 25.3 Running the Application................................ 136 25.4 Explanation....................................... 139 iii 26 Intel® QuickAssist Technology Sample Application 141 26.1 Overview........................................ 141 26.2 Building the Application................................ 143 26.3 Running the Application................................ 143 27 Quota and Watermark Sample Application 145 27.1 Overview........................................ 145 27.2 Compiling the Application............................... 147 27.3 Running the Application................................ 147 27.4 Code Overview.................................... 148 28 Timer Sample Application 155 28.1 Compiling the Application............................... 155 28.2 Running the Application................................ 155 28.3 Explanation....................................... 155 29 Packet Ordering Application 158 29.1 Overview........................................ 158 29.2 Compiling the Application............................... 158 29.3 Running the Application................................ 158 30 VMDQ and DCB Forwarding Sample Application 160 30.1 Overview........................................ 160 30.2 Compiling the Application............................... 161 30.3 Running the Application................................ 161 30.4 Explanation....................................... 162 31 Vhost Sample Application 166 31.1 Background...................................... 166 31.2 Sample Code Overview................................ 168 31.3 Supported Distributions................................ 168 31.4 Prerequisites...................................... 168 31.5 Compiling the Sample Code............................. 173 31.6 Running the Sample Code.............................. 173 31.7 Running the Virtual Machine (QEMU)........................ 175 31.8 Running DPDK in the Virtual Machine........................ 179 31.9 Passing Traffic to the Virtual Machine Device.................... 181 32 Netmap Compatibility Sample Application 182 32.1 Introduction....................................... 182 32.2 Available APIs..................................... 182 32.3 Caveats......................................... 182 32.4 Porting Netmap Applications............................. 183 32.5 Compiling the “bridge” Sample Application..................... 184 32.6 Running the “bridge” Sample Application...................... 184 33 Internet Protocol (IP) Pipeline Application 185 33.1 Application overview.................................