4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions
8 * Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in
12 the documentation and/or other materials provided with the
14 * Neither the name of NXP nor the names of its
15 contributors may be used to endorse or promote products derived
16 from this software without specific prior written permission.
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 NXP DPAA2 CAAM (DPAA2_SEC)
32 ==========================
34 The DPAA2_SEC PMD provides poll mode crypto driver support for NXP DPAA2 CAAM
40 SEC is the SOC's security engine, which serves as NXP's latest cryptographic
41 acceleration and offloading hardware. It combines functions previously
42 implemented in separate modules to create a modular and scalable acceleration
43 and assurance engine. It also implements block encryption algorithms, stream
44 cipher algorithms, hashing algorithms, public key algorithms, run-time
45 integrity checking, and a hardware random number generator. SEC performs
46 higher-level cryptographic operations than previous NXP cryptographic
47 accelerators. This provides significant improvement to system level performance.
49 DPAA2_SEC is one of the hardware resource in DPAA2 Architecture. More information
50 on DPAA2 Architecture is described in :ref:`dpaa2_overview`.
52 DPAA2_SEC PMD is one of DPAA2 drivers which interacts with Management Complex (MC)
53 portal to access the hardware object - DPSECI. The MC provides access to create,
54 discover, connect, configure and destroy dpseci objects in DPAA2_SEC PMD.
56 DPAA2_SEC PMD also uses some of the other hardware resources like buffer pools,
57 queues, queue portals to store and to enqueue/dequeue data to the hardware SEC.
59 DPSECI objects are detected by PMD using a resource container called DPRC (like
60 in :ref:`dpaa2_overview`).
64 .. code-block:: console
68 +--+--------+-------+-------+-------+---------+
70 DPMCP.1 DPIO.1 DPBP.1 DPNI.1 DPMAC.1 DPSECI.1
71 DPMCP.2 DPIO.2 DPNI.2 DPMAC.2 DPSECI.2
77 SEC provides platform assurance by working with SecMon, which is a companion
78 logic block that tracks the security state of the SOC. SEC is programmed by
79 means of descriptors (not to be confused with frame descriptors (FDs)) that
80 indicate the operations to be performed and link to the message and
81 associated data. SEC incorporates two DMA engines to fetch the descriptors,
82 read the message data, and write the results of the operations. The DMA
83 engine provides a scatter/gather capability so that SEC can read and write
84 data scattered in memory. SEC may be configured by means of software for
85 dynamic changes in byte ordering. The default configuration for this version
86 of SEC is little-endian mode.
88 A block diagram similar to dpaa2 NIC is shown below to show where DPAA2_SEC
89 fits in the DPAA2 Bus model
91 .. code-block:: console
97 +----------------+ +------------+
98 | MC SEC object |.......| Mempool |
99 . . . . . . . . . | (DPSECI) | | (DPBP) |
100 . +---+---+--------+ +-----+------+
106 . . . . . . . . . . .| DPIO driver| .
111 +----+------+-------+ +-----+----- | .
113 | VFIO fslmc-bus |....................|.........................
116 +-------------------+ |
118 ========================== HARDWARE =====|=======================
122 =========================================|========================
129 The DPAA2_SEC PMD has support for:
133 * ``RTE_CRYPTO_CIPHER_3DES_CBC``
134 * ``RTE_CRYPTO_CIPHER_AES128_CBC``
135 * ``RTE_CRYPTO_CIPHER_AES192_CBC``
136 * ``RTE_CRYPTO_CIPHER_AES256_CBC``
137 * ``RTE_CRYPTO_CIPHER_AES128_CTR``
138 * ``RTE_CRYPTO_CIPHER_AES192_CTR``
139 * ``RTE_CRYPTO_CIPHER_AES256_CTR``
143 * ``RTE_CRYPTO_AUTH_SHA1_HMAC``
144 * ``RTE_CRYPTO_AUTH_SHA224_HMAC``
145 * ``RTE_CRYPTO_AUTH_SHA256_HMAC``
146 * ``RTE_CRYPTO_AUTH_SHA384_HMAC``
147 * ``RTE_CRYPTO_AUTH_SHA512_HMAC``
148 * ``RTE_CRYPTO_AUTH_MD5_HMAC``
152 * ``RTE_CRYPTO_AEAD_AES_GCM``
165 * Chained mbufs are not supported.
166 * Hash followed by Cipher mode is not supported
167 * Only supports the session-oriented API implementation (session-less APIs are not supported).
172 DPAA2_SEC driver has similar pre-requisites as described in :ref:`dpaa2_overview`.
173 The following dependencies are not part of DPDK and must be installed separately:
177 NXP Linux software development kit (SDK) includes support for the family
178 of QorIQ® ARM-Architecture-based system on chip (SoC) processors
179 and corresponding boards.
181 It includes the Linux board support packages (BSPs) for NXP SoCs,
182 a fully operational tool chain, kernel and board specific modules.
184 SDK and related information can be obtained from: `NXP QorIQ SDK <http://www.nxp.com/products/software-and-tools/run-time-software/linux-sdk/linux-sdk-for-qoriq-processors:SDKLINUX>`_.
186 * **DPDK Helper Scripts**
188 DPAA2 based resources can be configured easily with the help of ready scripts
189 as provided in the DPDK helper repository.
191 `DPDK Helper Scripts <https://github.com/qoriq-open-source/dpdk-helper>`_.
193 Currently supported by DPDK:
196 * MC Firmware version **10.0.0** and higher.
197 * Supported architectures: **arm64 LE**.
199 * Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup the basic DPDK environment.
201 Pre-Installation Configuration
202 ------------------------------
207 Basic DPAA2 config file options are described in :ref:`dpaa2_overview`.
208 In addition to those, the following options can be modified in the ``config`` file
209 to enable DPAA2_SEC PMD.
211 Please note that enabling debugging options may affect system performance.
213 * ``CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC`` (default ``n``)
214 By default it is only enabled in defconfig_arm64-dpaa2-* config.
215 Toggle compilation of the ``librte_pmd_dpaa2_sec`` driver.
217 * ``CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_INIT`` (default ``n``)
218 Toggle display of initialization related driver messages
220 * ``CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_DRIVER`` (default ``n``)
221 Toggle display of driver runtime messages
223 * ``CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_RX`` (default ``n``)
224 Toggle display of receive fast path run-time message
226 * ``CONFIG_RTE_DPAA2_SEC_PMD_MAX_NB_SESSIONS``
227 By default it is set as 2048 in defconfig_arm64-dpaa2-* config.
228 It indicates Number of sessions to create in the session memory pool
229 on a single DPAA2 SEC device.
233 To compile the DPAA2_SEC PMD for Linux arm64 gcc target, run the
234 following ``make`` command:
236 .. code-block:: console
238 cd <DPDK-source-directory>
239 make config T=arm64-dpaa2-linuxapp-gcc install