2 Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in
13 the documentation and/or other materials provided with the
15 * Neither the name of Intel Corporation nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 Intel® QuickAssist Technology Sample Application
32 ================================================
34 This sample application demonstrates the use of the cryptographic operations provided
35 by the Intel® QuickAssist Technology from within the DPDK environment.
36 Therefore, building and running this application requires having both the DPDK and
37 the QuickAssist Technology Software Library installed, as well as at least one
38 Intel® QuickAssist Technology hardware device present in the system.
40 For this sample application, there is a dependency on either of:
42 * Intel® Communications Chipset 8900 to 8920 Series Software for Linux* package
44 * Intel® Communications Chipset 8925 to 8955 Series Software for Linux* package
49 An overview of the application is provided in Figure 11.
50 For simplicity, only two NIC ports and one Intel® QuickAssist Technology device are shown in this diagram,
51 although the number of NIC ports and Intel® QuickAssist Technology devices can be different.
55 **Figure 11. Intel® QuickAssist Technology Application Block Diagram**
57 .. image14_png has been renamed
59 |quickassist_block_diagram|
61 The application allows the configuration of the following items:
65 * Number of logical cores (lcores)
67 * Mapping of NIC RX queues to logical cores
69 Each lcore communicates with every cryptographic acceleration engine in the system through a pair of dedicated input - output queues.
70 Each lcore has a dedicated NIC TX queue with every NIC port in the system.
71 Therefore, each lcore reads packets from its NIC RX queues and cryptographic accelerator output queues and
72 writes packets to its NIC TX queues and cryptographic accelerator input queues.
74 Each incoming packet that is read from a NIC RX queue is either directly forwarded to its destination NIC TX port (forwarding path)
75 or first sent to one of the Intel® QuickAssist Technology devices for either encryption or decryption
76 before being sent out on its destination NIC TX port (cryptographic path).
78 The application supports IPv4 input packets only.
79 For each input packet, the decision between the forwarding path and
80 the cryptographic path is taken at the classification stage based on the value of the IP source address field read from the input packet.
81 Assuming that the IP source address is A.B.C.D, then if:
83 * D = 0: the forwarding path is selected (the packet is forwarded out directly)
85 * D = 1: the cryptographic path for encryption is selected (the packet is first encrypted and then forwarded out)
87 * D = 2: the cryptographic path for decryption is selected (the packet is first decrypted and then forwarded out)
89 For the cryptographic path cases (D = 1 or D = 2), byte C specifies the cipher algorithm and
90 byte B the cryptographic hash algorithm to be used for the current packet.
91 Byte A is not used and can be any value.
92 The cipher and cryptographic hash algorithms supported by this application are listed in the crypto.h header file.
94 For each input packet, the destination NIC TX port is decided at the forwarding stage (executed after the cryptographic stage,
95 if enabled for the packet) by looking at the RX port index of the dst_ports[ ] array,
96 which was initialized at startup, being the outport the adjacent enabled port.
97 For example, if ports 1,3,5 and 6 are enabled, for input port 1, outport port will be 3 and vice versa,
98 and for input port 5, output port will be 6 and vice versa.
100 For the cryptographic path, it is the payload of the IPv4 packet that is encrypted or decrypted.
105 Building and running this application requires having both the DPDK package and
106 the QuickAssist Technology Software Library installed,
107 as well as at least one Intel® QuickAssist Technology hardware device present in the system.
109 For more details on how to build and run DPDK and Intel® QuickAssist Technology applications,
110 please refer to the following documents:
112 * *DPDK Getting Started Guide*
114 * Intel® Communications Chipset 8900 to 8920 Series Software for Linux* Getting Started Guide (440005)
116 * Intel® Communications Chipset 8925 to 8955 Series Software for Linux* Getting Started Guide (523128)
118 For more details on the actual platforms used to validate this application, as well as performance numbers,
119 please refer to the Test Report, which is accessible by contacting your Intel representative.
121 Building the Application
122 ------------------------
124 Steps to build the application:
126 #. Set up the following environment variables:
128 .. code-block:: console
130 export RTE_SDK=<Absolute path to the DPDK installation folder>
131 export ICP_ROOT=<Absolute path to the Intel QAT installation folder>
133 #. Set the target (a default target is used if not specified). For example:
135 .. code-block:: console
137 export RTE_TARGET=x86_64-native-linuxapp-gcc
139 Refer to the *DPDK Getting Started Guide* for possible RTE_TARGET values.
141 #. Build the application:
143 .. code-block:: console
145 cd ${RTE_SDK}/examples/dpdk_qat
148 Running the Application
149 -----------------------
151 Intel® QuickAssist Technology Configuration Files
152 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154 The Intel® QuickAssist Technology configuration files used by the application are located in the config_files folder in the application folder.
155 There following sets of configuration files are included in the DPDK package:
157 * Stargo CRB (single CPU socket): located in the stargo folder
159 * dh89xxcc_qa_dev0.conf
161 * Shumway CRB (dual CPU socket): located in the shumway folder
163 * dh89xxcc_qa_dev0.conf
165 * dh89xxcc_qa_dev1.conf
167 * Coleto Creek: located in the coleto folder
169 * dh895xcc_qa_dev0.conf
171 The relevant configuration file(s) must be copied to the /etc/ directory.
173 Please note that any change to these configuration files requires restarting the Intel®
174 QuickAssist Technology driver using the following command:
176 .. code-block:: console
178 # service qat_service restart
180 Refer to the following documents for information on the Intel® QuickAssist Technology configuration files:
182 * Intel® Communications Chipset 8900 to 8920 Series Software Programmer's Guide
184 * Intel® Communications Chipset 8925 to 8955 Series Software Programmer's Guide
186 * Intel® Communications Chipset 8900 to 8920 Series Software for Linux* Getting Started Guide.
188 * Intel® Communications Chipset 8925 to 8955 Series Software for Linux* Getting Started Guide.
190 Traffic Generator Setup and Application Startup
191 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
193 The application has a number of command line options:
195 dpdk_qat [EAL options] -- -p PORTMASK [--no-promisc] [--config '(port,queue,lcore)[,(port,queue,lcore)]']
199 * -p PORTMASK: Hexadecimal bitmask of ports to configure
201 * --no-promisc: Disables promiscuous mode for all ports,
202 so that only packets with the Ethernet MAC destination address set to the Ethernet address of the port are accepted.
203 By default promiscuous mode is enabled so that packets are accepted regardless of the packet's Ethernet MAC destination address.
205 * --config'(port,queue,lcore)[,(port,queue,lcore)]': determines which queues from which ports are mapped to which cores.
207 Refer to Chapter 10 , "L3 Forwarding Sample Application" for more detailed descriptions of the --config command line option.
209 As an example, to run the application with two ports and two cores,
210 which are using different Intel® QuickAssist Technology execution engines,
211 performing AES-CBC-128 encryption with AES-XCBC-MAC-96 hash, the following settings can be used:
213 * Traffic generator source IP address: 0.9.6.1
217 .. code-block:: console
219 ./build/dpdk_qat -c 0xff -n 2 -- -p 0x3 --config '(0,0,1),(1,0,2)'
221 Refer to the *DPDK Test Report* for more examples of traffic generator setup and the application startup command lines.
222 If no errors are generated in response to the startup commands, the application is running correctly.
224 .. |quickassist_block_diagram| image:: img/quickassist_block_diagram.*