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 :numref:`figure_quickassist_block_diagram`.
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.
53 .. _figure_quickassist_block_diagram:
55 .. figure:: img/quickassist_block_diagram.*
57 Intel® QuickAssist Technology Application Block Diagram
60 The application allows the configuration of the following items:
64 * Number of logical cores (lcores)
66 * Mapping of NIC RX queues to logical cores
68 Each lcore communicates with every cryptographic acceleration engine in the system through a pair of dedicated input - output queues.
69 Each lcore has a dedicated NIC TX queue with every NIC port in the system.
70 Therefore, each lcore reads packets from its NIC RX queues and cryptographic accelerator output queues and
71 writes packets to its NIC TX queues and cryptographic accelerator input queues.
73 Each incoming packet that is read from a NIC RX queue is either directly forwarded to its destination NIC TX port (forwarding path)
74 or first sent to one of the Intel® QuickAssist Technology devices for either encryption or decryption
75 before being sent out on its destination NIC TX port (cryptographic path).
77 The application supports IPv4 input packets only.
78 For each input packet, the decision between the forwarding path and
79 the cryptographic path is taken at the classification stage based on the value of the IP source address field read from the input packet.
80 Assuming that the IP source address is A.B.C.D, then if:
82 * D = 0: the forwarding path is selected (the packet is forwarded out directly)
84 * D = 1: the cryptographic path for encryption is selected (the packet is first encrypted and then forwarded out)
86 * D = 2: the cryptographic path for decryption is selected (the packet is first decrypted and then forwarded out)
88 For the cryptographic path cases (D = 1 or D = 2), byte C specifies the cipher algorithm and
89 byte B the cryptographic hash algorithm to be used for the current packet.
90 Byte A is not used and can be any value.
91 The cipher and cryptographic hash algorithms supported by this application are listed in the crypto.h header file.
93 For each input packet, the destination NIC TX port is decided at the forwarding stage (executed after the cryptographic stage,
94 if enabled for the packet) by looking at the RX port index of the dst_ports[ ] array,
95 which was initialized at startup, being the outport the adjacent enabled port.
96 For example, if ports 1,3,5 and 6 are enabled, for input port 1, outport port will be 3 and vice versa,
97 and for input port 5, output port will be 6 and vice versa.
99 For the cryptographic path, it is the payload of the IPv4 packet that is encrypted or decrypted.
104 Building and running this application requires having both the DPDK package and
105 the QuickAssist Technology Software Library installed,
106 as well as at least one Intel® QuickAssist Technology hardware device present in the system.
108 For more details on how to build and run DPDK and Intel® QuickAssist Technology applications,
109 please refer to the following documents:
111 * *DPDK Getting Started Guide*
113 * Intel® Communications Chipset 8900 to 8920 Series Software for Linux* Getting Started Guide (440005)
115 * Intel® Communications Chipset 8925 to 8955 Series Software for Linux* Getting Started Guide (523128)
117 For more details on the actual platforms used to validate this application, as well as performance numbers,
118 please refer to the Test Report, which is accessible by contacting your Intel representative.
120 Building the Application
121 ------------------------
123 Steps to build the application:
125 #. Set up the following environment variables:
127 .. code-block:: console
129 export RTE_SDK=<Absolute path to the DPDK installation folder>
130 export ICP_ROOT=<Absolute path to the Intel QAT installation folder>
132 #. Set the target (a default target is used if not specified). For example:
134 .. code-block:: console
136 export RTE_TARGET=x86_64-native-linuxapp-gcc
138 Refer to the *DPDK Getting Started Guide* for possible RTE_TARGET values.
140 #. Build the application:
142 .. code-block:: console
144 cd ${RTE_SDK}/examples/dpdk_qat
147 Running the Application
148 -----------------------
150 Intel® QuickAssist Technology Configuration Files
151 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153 The Intel® QuickAssist Technology configuration files used by the application are located in the config_files folder in the application folder.
154 There following sets of configuration files are included in the DPDK package:
156 * Stargo CRB (single CPU socket): located in the stargo folder
158 * dh89xxcc_qa_dev0.conf
160 * Shumway CRB (dual CPU socket): located in the shumway folder
162 * dh89xxcc_qa_dev0.conf
164 * dh89xxcc_qa_dev1.conf
166 * Coleto Creek: located in the coleto folder
168 * dh895xcc_qa_dev0.conf
170 The relevant configuration file(s) must be copied to the /etc/ directory.
172 Please note that any change to these configuration files requires restarting the Intel®
173 QuickAssist Technology driver using the following command:
175 .. code-block:: console
177 # service qat_service restart
179 Refer to the following documents for information on the Intel® QuickAssist Technology configuration files:
181 * Intel® Communications Chipset 8900 to 8920 Series Software Programmer's Guide
183 * Intel® Communications Chipset 8925 to 8955 Series Software Programmer's Guide
185 * Intel® Communications Chipset 8900 to 8920 Series Software for Linux* Getting Started Guide.
187 * Intel® Communications Chipset 8925 to 8955 Series Software for Linux* Getting Started Guide.
189 Traffic Generator Setup and Application Startup
190 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192 The application has a number of command line options:
194 dpdk_qat [EAL options] -- -p PORTMASK [--no-promisc] [--config '(port,queue,lcore)[,(port,queue,lcore)]']
198 * -p PORTMASK: Hexadecimal bitmask of ports to configure
200 * --no-promisc: Disables promiscuous mode for all ports,
201 so that only packets with the Ethernet MAC destination address set to the Ethernet address of the port are accepted.
202 By default promiscuous mode is enabled so that packets are accepted regardless of the packet's Ethernet MAC destination address.
204 * --config'(port,queue,lcore)[,(port,queue,lcore)]': determines which queues from which ports are mapped to which cores.
206 Refer to the :doc:`l3_forward` for more detailed descriptions of the --config command line option.
208 As an example, to run the application with two ports and two cores,
209 which are using different Intel® QuickAssist Technology execution engines,
210 performing AES-CBC-128 encryption with AES-XCBC-MAC-96 hash, the following settings can be used:
212 * Traffic generator source IP address: 0.9.6.1
216 .. code-block:: console
218 ./build/dpdk_qat -c 0xff -n 2 -- -p 0x3 --config '(0,0,1),(1,0,2)'
220 Refer to the *DPDK Test Report* for more examples of traffic generator setup and the application startup command lines.
221 If no errors are generated in response to the startup commands, the application is running correctly.