xref: /dpdk/doc/guides/cryptodevs/dpaa2_sec.rst (revision 131a75b6e4df60586103d71defb85dcf9f77fb17)
1*131a75b6SHemant Agrawal..  SPDX-License-Identifier: BSD-3-Clause
2*131a75b6SHemant Agrawal    Copyright 2016 NXP
34bbee28bSAkhil Goyal
44bbee28bSAkhil Goyal
54bbee28bSAkhil Goyal
64bbee28bSAkhil GoyalNXP DPAA2 CAAM (DPAA2_SEC)
74bbee28bSAkhil Goyal==========================
84bbee28bSAkhil Goyal
94bbee28bSAkhil GoyalThe DPAA2_SEC PMD provides poll mode crypto driver support for NXP DPAA2 CAAM
104bbee28bSAkhil Goyalhardware accelerator.
114bbee28bSAkhil Goyal
124bbee28bSAkhil GoyalArchitecture
134bbee28bSAkhil Goyal------------
144bbee28bSAkhil Goyal
154bbee28bSAkhil GoyalSEC is the SOC's security engine, which serves as NXP's latest cryptographic
164bbee28bSAkhil Goyalacceleration and offloading hardware. It combines functions previously
174bbee28bSAkhil Goyalimplemented in separate modules to create a modular and scalable acceleration
184bbee28bSAkhil Goyaland assurance engine. It also implements block encryption algorithms, stream
194bbee28bSAkhil Goyalcipher algorithms, hashing algorithms, public key algorithms, run-time
204bbee28bSAkhil Goyalintegrity checking, and a hardware random number generator. SEC performs
214bbee28bSAkhil Goyalhigher-level cryptographic operations than previous NXP cryptographic
224bbee28bSAkhil Goyalaccelerators. This provides significant improvement to system level performance.
234bbee28bSAkhil Goyal
244bbee28bSAkhil GoyalDPAA2_SEC is one of the hardware resource in DPAA2 Architecture. More information
254bbee28bSAkhil Goyalon DPAA2 Architecture is described in :ref:`dpaa2_overview`.
264bbee28bSAkhil Goyal
274bbee28bSAkhil GoyalDPAA2_SEC PMD is one of DPAA2 drivers which interacts with Management Complex (MC)
284bbee28bSAkhil Goyalportal to access the hardware object - DPSECI. The MC provides access to create,
294bbee28bSAkhil Goyaldiscover, connect, configure and destroy dpseci objects in DPAA2_SEC PMD.
304bbee28bSAkhil Goyal
314bbee28bSAkhil GoyalDPAA2_SEC PMD also uses some of the other hardware resources like buffer pools,
324bbee28bSAkhil Goyalqueues, queue portals to store and to enqueue/dequeue data to the hardware SEC.
334bbee28bSAkhil Goyal
344bbee28bSAkhil GoyalDPSECI objects are detected by PMD using a resource container called DPRC (like
354bbee28bSAkhil Goyalin :ref:`dpaa2_overview`).
364bbee28bSAkhil Goyal
374bbee28bSAkhil GoyalFor example:
384bbee28bSAkhil Goyal
394bbee28bSAkhil Goyal.. code-block:: console
404bbee28bSAkhil Goyal
414bbee28bSAkhil Goyal    DPRC.1 (bus)
424bbee28bSAkhil Goyal      |
434bbee28bSAkhil Goyal      +--+--------+-------+-------+-------+---------+
444bbee28bSAkhil Goyal         |        |       |       |       |         |
454bbee28bSAkhil Goyal       DPMCP.1  DPIO.1  DPBP.1  DPNI.1  DPMAC.1  DPSECI.1
464bbee28bSAkhil Goyal       DPMCP.2  DPIO.2          DPNI.2  DPMAC.2  DPSECI.2
474bbee28bSAkhil Goyal       DPMCP.3
484bbee28bSAkhil Goyal
494bbee28bSAkhil GoyalImplementation
504bbee28bSAkhil Goyal--------------
514bbee28bSAkhil Goyal
524bbee28bSAkhil GoyalSEC provides platform assurance by working with SecMon, which is a companion
534bbee28bSAkhil Goyallogic block that tracks the security state of the SOC. SEC is programmed by
544bbee28bSAkhil Goyalmeans of descriptors (not to be confused with frame descriptors (FDs)) that
554bbee28bSAkhil Goyalindicate the operations to be performed and link to the message and
564bbee28bSAkhil Goyalassociated data. SEC incorporates two DMA engines to fetch the descriptors,
574bbee28bSAkhil Goyalread the message data, and write the results of the operations. The DMA
584bbee28bSAkhil Goyalengine provides a scatter/gather capability so that SEC can read and write
594bbee28bSAkhil Goyaldata scattered in memory. SEC may be configured by means of software for
604bbee28bSAkhil Goyaldynamic changes in byte ordering. The default configuration for this version
614bbee28bSAkhil Goyalof SEC is little-endian mode.
624bbee28bSAkhil Goyal
634bbee28bSAkhil GoyalA block diagram similar to dpaa2 NIC is shown below to show where DPAA2_SEC
644bbee28bSAkhil Goyalfits in the DPAA2 Bus model
654bbee28bSAkhil Goyal
664bbee28bSAkhil Goyal.. code-block:: console
674bbee28bSAkhil Goyal
684bbee28bSAkhil Goyal
694bbee28bSAkhil Goyal                                       +----------------+
704bbee28bSAkhil Goyal                                       | DPDK DPAA2_SEC |
714bbee28bSAkhil Goyal                                       |     PMD        |
724bbee28bSAkhil Goyal                                       +----------------+       +------------+
734bbee28bSAkhil Goyal                                       |  MC SEC object |.......|  Mempool   |
744bbee28bSAkhil Goyal                    . . . . . . . . .  |   (DPSECI)     |       |  (DPBP)    |
754bbee28bSAkhil Goyal                   .                   +---+---+--------+       +-----+------+
764bbee28bSAkhil Goyal                  .                        ^   |                      .
774bbee28bSAkhil Goyal                 .                         |   |<enqueue,             .
784bbee28bSAkhil Goyal                .                          |   | dequeue>             .
794bbee28bSAkhil Goyal               .                           |   |                      .
804bbee28bSAkhil Goyal              .                        +---+---V----+                 .
814bbee28bSAkhil Goyal             .      . . . . . . . . . .| DPIO driver|                 .
824bbee28bSAkhil Goyal            .      .                   |  (DPIO)    |                 .
834bbee28bSAkhil Goyal           .      .                    +-----+------+                 .
844bbee28bSAkhil Goyal          .      .                     |  QBMAN     |                 .
854bbee28bSAkhil Goyal         .      .                      |  Driver    |                 .
864bbee28bSAkhil Goyal    +----+------+-------+              +-----+----- |                 .
874bbee28bSAkhil Goyal    |   dpaa2 bus       |                    |                        .
884bbee28bSAkhil Goyal    |   VFIO fslmc-bus  |....................|.........................
894bbee28bSAkhil Goyal    |                   |                    |
904bbee28bSAkhil Goyal    |     /bus/fslmc    |                    |
914bbee28bSAkhil Goyal    +-------------------+                    |
924bbee28bSAkhil Goyal                                             |
934bbee28bSAkhil Goyal    ========================== HARDWARE =====|=======================
944bbee28bSAkhil Goyal                                           DPIO
954bbee28bSAkhil Goyal                                             |
964bbee28bSAkhil Goyal                                           DPSECI---DPBP
974bbee28bSAkhil Goyal    =========================================|========================
984bbee28bSAkhil Goyal
994bbee28bSAkhil Goyal
1004bbee28bSAkhil Goyal
1014bbee28bSAkhil GoyalFeatures
1024bbee28bSAkhil Goyal--------
1034bbee28bSAkhil Goyal
10413273250SAkhil GoyalThe DPAA2_SEC PMD has support for:
1054bbee28bSAkhil Goyal
1064bbee28bSAkhil GoyalCipher algorithms:
1074bbee28bSAkhil Goyal
1084bbee28bSAkhil Goyal* ``RTE_CRYPTO_CIPHER_3DES_CBC``
1094bbee28bSAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES128_CBC``
1104bbee28bSAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES192_CBC``
1114bbee28bSAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES256_CBC``
11213273250SAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES128_CTR``
11313273250SAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES192_CTR``
11413273250SAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES256_CTR``
1154bbee28bSAkhil Goyal
1164bbee28bSAkhil GoyalHash algorithms:
1174bbee28bSAkhil Goyal
1184bbee28bSAkhil Goyal* ``RTE_CRYPTO_AUTH_SHA1_HMAC``
1194bbee28bSAkhil Goyal* ``RTE_CRYPTO_AUTH_SHA224_HMAC``
1204bbee28bSAkhil Goyal* ``RTE_CRYPTO_AUTH_SHA256_HMAC``
1214bbee28bSAkhil Goyal* ``RTE_CRYPTO_AUTH_SHA384_HMAC``
1224bbee28bSAkhil Goyal* ``RTE_CRYPTO_AUTH_SHA512_HMAC``
1234bbee28bSAkhil Goyal* ``RTE_CRYPTO_AUTH_MD5_HMAC``
1244bbee28bSAkhil Goyal
12513273250SAkhil GoyalAEAD algorithms:
12613273250SAkhil Goyal
12713273250SAkhil Goyal* ``RTE_CRYPTO_AEAD_AES_GCM``
12813273250SAkhil Goyal
1294bbee28bSAkhil GoyalSupported DPAA2 SoCs
1304bbee28bSAkhil Goyal--------------------
1314bbee28bSAkhil Goyal
1324bbee28bSAkhil Goyal* LS2080A/LS2040A
1334bbee28bSAkhil Goyal* LS2084A/LS2044A
1344bbee28bSAkhil Goyal* LS2088A/LS2048A
1354bbee28bSAkhil Goyal* LS1088A/LS1048A
1364bbee28bSAkhil Goyal
1374bbee28bSAkhil GoyalLimitations
1384bbee28bSAkhil Goyal-----------
1394bbee28bSAkhil Goyal
1404bbee28bSAkhil Goyal* Chained mbufs are not supported.
1414bbee28bSAkhil Goyal* Hash followed by Cipher mode is not supported
1424bbee28bSAkhil Goyal* Only supports the session-oriented API implementation (session-less APIs are not supported).
1434bbee28bSAkhil Goyal
1444bbee28bSAkhil GoyalPrerequisites
1454bbee28bSAkhil Goyal-------------
1464bbee28bSAkhil Goyal
1474bbee28bSAkhil GoyalDPAA2_SEC driver has similar pre-requisites as described in :ref:`dpaa2_overview`.
1484bbee28bSAkhil GoyalThe following dependencies are not part of DPDK and must be installed separately:
1494bbee28bSAkhil Goyal
1504bbee28bSAkhil Goyal* **NXP Linux SDK**
1514bbee28bSAkhil Goyal
1524bbee28bSAkhil Goyal  NXP Linux software development kit (SDK) includes support for the family
1534bbee28bSAkhil Goyal  of QorIQ® ARM-Architecture-based system on chip (SoC) processors
1544bbee28bSAkhil Goyal  and corresponding boards.
1554bbee28bSAkhil Goyal
1564bbee28bSAkhil Goyal  It includes the Linux board support packages (BSPs) for NXP SoCs,
1574bbee28bSAkhil Goyal  a fully operational tool chain, kernel and board specific modules.
1584bbee28bSAkhil Goyal
1594bbee28bSAkhil Goyal  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>`_.
1604bbee28bSAkhil Goyal
161eb6d5a0aSHemant Agrawal* **DPDK Extra Scripts**
1624bbee28bSAkhil Goyal
1634bbee28bSAkhil Goyal  DPAA2 based resources can be configured easily with the help of ready scripts
1644bbee28bSAkhil Goyal  as provided in the DPDK helper repository.
1654bbee28bSAkhil Goyal
166eb6d5a0aSHemant Agrawal  `DPDK Extra Scripts <https://github.com/qoriq-open-source/dpdk-extras>`_.
1674bbee28bSAkhil Goyal
1684bbee28bSAkhil GoyalCurrently supported by DPDK:
1694bbee28bSAkhil Goyal
170eb6d5a0aSHemant Agrawal* NXP SDK **17.08+**.
171eb6d5a0aSHemant Agrawal* MC Firmware version **10.3.1** and higher.
1724bbee28bSAkhil Goyal* Supported architectures:  **arm64 LE**.
1734bbee28bSAkhil Goyal
1744bbee28bSAkhil Goyal* Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup the basic DPDK environment.
1754bbee28bSAkhil Goyal
1764bbee28bSAkhil GoyalPre-Installation Configuration
1774bbee28bSAkhil Goyal------------------------------
1784bbee28bSAkhil Goyal
1794bbee28bSAkhil GoyalConfig File Options
1804bbee28bSAkhil Goyal~~~~~~~~~~~~~~~~~~~
1814bbee28bSAkhil Goyal
1824bbee28bSAkhil GoyalBasic DPAA2 config file options are described in :ref:`dpaa2_overview`.
1834bbee28bSAkhil GoyalIn addition to those, the following options can be modified in the ``config`` file
1844bbee28bSAkhil Goyalto enable DPAA2_SEC PMD.
1854bbee28bSAkhil Goyal
1864bbee28bSAkhil GoyalPlease note that enabling debugging options may affect system performance.
1874bbee28bSAkhil Goyal
1884bbee28bSAkhil Goyal* ``CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC`` (default ``n``)
1894bbee28bSAkhil Goyal  By default it is only enabled in defconfig_arm64-dpaa2-* config.
1904bbee28bSAkhil Goyal  Toggle compilation of the ``librte_pmd_dpaa2_sec`` driver.
1914bbee28bSAkhil Goyal
1924bbee28bSAkhil Goyal* ``CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_INIT`` (default ``n``)
1934bbee28bSAkhil Goyal  Toggle display of initialization related driver messages
1944bbee28bSAkhil Goyal
1954bbee28bSAkhil Goyal* ``CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_DRIVER`` (default ``n``)
1964bbee28bSAkhil Goyal  Toggle display of driver runtime messages
1974bbee28bSAkhil Goyal
1984bbee28bSAkhil Goyal* ``CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_RX`` (default ``n``)
1994bbee28bSAkhil Goyal  Toggle display of receive fast path run-time message
2004bbee28bSAkhil Goyal
2014bbee28bSAkhil Goyal* ``CONFIG_RTE_DPAA2_SEC_PMD_MAX_NB_SESSIONS``
2024bbee28bSAkhil Goyal  By default it is set as 2048 in defconfig_arm64-dpaa2-* config.
2034bbee28bSAkhil Goyal  It indicates Number of sessions to create in the session memory pool
2044bbee28bSAkhil Goyal  on a single DPAA2 SEC device.
2054bbee28bSAkhil Goyal
2064bbee28bSAkhil GoyalInstallations
2074bbee28bSAkhil Goyal-------------
2084bbee28bSAkhil GoyalTo compile the DPAA2_SEC PMD for Linux arm64 gcc target, run the
2094bbee28bSAkhil Goyalfollowing ``make`` command:
2104bbee28bSAkhil Goyal
2114bbee28bSAkhil Goyal.. code-block:: console
2124bbee28bSAkhil Goyal
2134bbee28bSAkhil Goyal   cd <DPDK-source-directory>
2144bbee28bSAkhil Goyal   make config T=arm64-dpaa2-linuxapp-gcc install
215