1*d81734caSHemant Agrawal.. SPDX-License-Identifier: BSD-3-Clause 2*d81734caSHemant Agrawal Copyright 2017 NXP 3bf551c96SAkhil Goyal 4bf551c96SAkhil Goyal 5bf551c96SAkhil Goyal 6bf551c96SAkhil GoyalNXP DPAA CAAM (DPAA_SEC) 7bf551c96SAkhil Goyal======================== 8bf551c96SAkhil Goyal 9bf551c96SAkhil GoyalThe DPAA_SEC PMD provides poll mode crypto driver support for NXP DPAA CAAM 10bf551c96SAkhil Goyalhardware accelerator. 11bf551c96SAkhil Goyal 12bf551c96SAkhil GoyalArchitecture 13bf551c96SAkhil Goyal------------ 14bf551c96SAkhil Goyal 15bf551c96SAkhil GoyalSEC is the SOC's security engine, which serves as NXP's latest cryptographic 16bf551c96SAkhil Goyalacceleration and offloading hardware. It combines functions previously 17bf551c96SAkhil Goyalimplemented in separate modules to create a modular and scalable acceleration 18bf551c96SAkhil Goyaland assurance engine. It also implements block encryption algorithms, stream 19bf551c96SAkhil Goyalcipher algorithms, hashing algorithms, public key algorithms, run-time 20bf551c96SAkhil Goyalintegrity checking, and a hardware random number generator. SEC performs 21bf551c96SAkhil Goyalhigher-level cryptographic operations than previous NXP cryptographic 22bf551c96SAkhil Goyalaccelerators. This provides significant improvement to system level performance. 23bf551c96SAkhil Goyal 24bf551c96SAkhil GoyalDPAA_SEC is one of the hardware resource in DPAA Architecture. More information 25bf551c96SAkhil Goyalon DPAA Architecture is described in :ref:`dpaa_overview`. 26bf551c96SAkhil Goyal 27bf551c96SAkhil GoyalDPAA_SEC PMD is one of DPAA drivers which interacts with QBMAN to create, 28bf551c96SAkhil Goyalconfigure and destroy the device instance using queue pair with CAAM portal. 29bf551c96SAkhil Goyal 30bf551c96SAkhil GoyalDPAA_SEC PMD also uses some of the other hardware resources like buffer pools, 31bf551c96SAkhil Goyalqueues, queue portals to store and to enqueue/dequeue data to the hardware SEC. 32bf551c96SAkhil Goyal 33bf551c96SAkhil GoyalImplementation 34bf551c96SAkhil Goyal-------------- 35bf551c96SAkhil Goyal 36bf551c96SAkhil GoyalSEC provides platform assurance by working with SecMon, which is a companion 37bf551c96SAkhil Goyallogic block that tracks the security state of the SOC. SEC is programmed by 38bf551c96SAkhil Goyalmeans of descriptors (not to be confused with frame descriptors (FDs)) that 39bf551c96SAkhil Goyalindicate the operations to be performed and link to the message and 40bf551c96SAkhil Goyalassociated data. SEC incorporates two DMA engines to fetch the descriptors, 41bf551c96SAkhil Goyalread the message data, and write the results of the operations. The DMA 42bf551c96SAkhil Goyalengine provides a scatter/gather capability so that SEC can read and write 43bf551c96SAkhil Goyaldata scattered in memory. SEC may be configured by means of software for 44bf551c96SAkhil Goyaldynamic changes in byte ordering. The default configuration for this version 45bf551c96SAkhil Goyalof SEC is little-endian mode. 46bf551c96SAkhil Goyal 47bf551c96SAkhil GoyalFeatures 48bf551c96SAkhil Goyal-------- 49bf551c96SAkhil Goyal 50bf551c96SAkhil GoyalThe DPAA PMD has support for: 51bf551c96SAkhil Goyal 52bf551c96SAkhil GoyalCipher algorithms: 53bf551c96SAkhil Goyal 54bf551c96SAkhil Goyal* ``RTE_CRYPTO_CIPHER_3DES_CBC`` 55bf551c96SAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES128_CBC`` 56bf551c96SAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES192_CBC`` 57bf551c96SAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES256_CBC`` 58bf551c96SAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES128_CTR`` 59bf551c96SAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES192_CTR`` 60bf551c96SAkhil Goyal* ``RTE_CRYPTO_CIPHER_AES256_CTR`` 61bf551c96SAkhil Goyal 62bf551c96SAkhil GoyalHash algorithms: 63bf551c96SAkhil Goyal 64bf551c96SAkhil Goyal* ``RTE_CRYPTO_AUTH_SHA1_HMAC`` 65bf551c96SAkhil Goyal* ``RTE_CRYPTO_AUTH_SHA224_HMAC`` 66bf551c96SAkhil Goyal* ``RTE_CRYPTO_AUTH_SHA256_HMAC`` 67bf551c96SAkhil Goyal* ``RTE_CRYPTO_AUTH_SHA384_HMAC`` 68bf551c96SAkhil Goyal* ``RTE_CRYPTO_AUTH_SHA512_HMAC`` 69bf551c96SAkhil Goyal* ``RTE_CRYPTO_AUTH_MD5_HMAC`` 70bf551c96SAkhil Goyal 71bf551c96SAkhil GoyalAEAD algorithms: 72bf551c96SAkhil Goyal 73bf551c96SAkhil Goyal* ``RTE_CRYPTO_AEAD_AES_GCM`` 74bf551c96SAkhil Goyal 75bf551c96SAkhil GoyalSupported DPAA SoCs 76bf551c96SAkhil Goyal-------------------- 77bf551c96SAkhil Goyal 78bf551c96SAkhil Goyal* LS1046A/LS1026A 79bf551c96SAkhil Goyal* LS1043A/LS1023A 80bf551c96SAkhil Goyal 81bf551c96SAkhil GoyalLimitations 82bf551c96SAkhil Goyal----------- 83bf551c96SAkhil Goyal 84bf551c96SAkhil Goyal* Chained mbufs are not supported. 85bf551c96SAkhil Goyal* Hash followed by Cipher mode is not supported 86bf551c96SAkhil Goyal* Only supports the session-oriented API implementation (session-less APIs are not supported). 87bf551c96SAkhil Goyal 88bf551c96SAkhil GoyalPrerequisites 89bf551c96SAkhil Goyal------------- 90bf551c96SAkhil Goyal 91bf551c96SAkhil GoyalDPAA_SEC driver has similar pre-requisites as described in :ref:`dpaa_overview`. 92bf551c96SAkhil GoyalThe following dependencies are not part of DPDK and must be installed separately: 93bf551c96SAkhil Goyal 94bf551c96SAkhil Goyal* **NXP Linux SDK** 95bf551c96SAkhil Goyal 96bf551c96SAkhil Goyal NXP Linux software development kit (SDK) includes support for the family 97bf551c96SAkhil Goyal of QorIQ® ARM-Architecture-based system on chip (SoC) processors 98bf551c96SAkhil Goyal and corresponding boards. 99bf551c96SAkhil Goyal 100bf551c96SAkhil Goyal It includes the Linux board support packages (BSPs) for NXP SoCs, 101bf551c96SAkhil Goyal a fully operational tool chain, kernel and board specific modules. 102bf551c96SAkhil Goyal 103bf551c96SAkhil 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>`_. 104bf551c96SAkhil Goyal 105bf551c96SAkhil Goyal* **DPDK Extras Scripts** 106bf551c96SAkhil Goyal 107bf551c96SAkhil Goyal DPAA based resources can be configured easily with the help of ready scripts 108bf551c96SAkhil Goyal as provided in the DPDK Extras repository. 109bf551c96SAkhil Goyal 110bf551c96SAkhil Goyal `DPDK Extras Scripts <https://github.com/qoriq-open-source/dpdk-extras>`_. 111bf551c96SAkhil Goyal 112bf551c96SAkhil GoyalCurrently supported by DPDK: 113bf551c96SAkhil Goyal 114bf551c96SAkhil Goyal* NXP SDK **2.0+**. 115bf551c96SAkhil Goyal* Supported architectures: **arm64 LE**. 116bf551c96SAkhil Goyal 117bf551c96SAkhil Goyal* Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup the basic DPDK environment. 118bf551c96SAkhil Goyal 119bf551c96SAkhil GoyalPre-Installation Configuration 120bf551c96SAkhil Goyal------------------------------ 121bf551c96SAkhil Goyal 122bf551c96SAkhil GoyalConfig File Options 123bf551c96SAkhil Goyal~~~~~~~~~~~~~~~~~~~ 124bf551c96SAkhil Goyal 125bf551c96SAkhil GoyalBasic DPAA config file options are described in :ref:`dpaa_overview`. 126bf551c96SAkhil GoyalIn addition to those, the following options can be modified in the ``config`` file 127bf551c96SAkhil Goyalto enable DPAA_SEC PMD. 128bf551c96SAkhil Goyal 129bf551c96SAkhil GoyalPlease note that enabling debugging options may affect system performance. 130bf551c96SAkhil Goyal 131bf551c96SAkhil Goyal* ``CONFIG_RTE_LIBRTE_PMD_DPAA_SEC`` (default ``n``) 132bf551c96SAkhil Goyal By default it is only enabled in defconfig_arm64-dpaa-* config. 133bf551c96SAkhil Goyal Toggle compilation of the ``librte_pmd_dpaa_sec`` driver. 134bf551c96SAkhil Goyal 135bf551c96SAkhil Goyal* ``CONFIG_RTE_LIBRTE_DPAA_SEC_DEBUG_INIT`` (default ``n``) 136bf551c96SAkhil Goyal Toggle display of initialization related driver messages 137bf551c96SAkhil Goyal 138bf551c96SAkhil Goyal* ``CONFIG_RTE_LIBRTE_DPAA_SEC_DEBUG_DRIVER`` (default ``n``) 139bf551c96SAkhil Goyal Toggle display of driver runtime messages 140bf551c96SAkhil Goyal 141bf551c96SAkhil Goyal* ``CONFIG_RTE_LIBRTE_DPAA_SEC_DEBUG_RX`` (default ``n``) 142bf551c96SAkhil Goyal Toggle display of receive fast path run-time message 143bf551c96SAkhil Goyal 144bf551c96SAkhil Goyal* ``CONFIG_RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS`` 145bf551c96SAkhil Goyal By default it is set as 2048 in defconfig_arm64-dpaa-* config. 146bf551c96SAkhil Goyal It indicates Number of sessions to create in the session memory pool 147bf551c96SAkhil Goyal on a single DPAA SEC device. 148bf551c96SAkhil Goyal 149bf551c96SAkhil GoyalInstallations 150bf551c96SAkhil Goyal------------- 151bf551c96SAkhil GoyalTo compile the DPAA_SEC PMD for Linux arm64 gcc target, run the 152bf551c96SAkhil Goyalfollowing ``make`` command: 153bf551c96SAkhil Goyal 154bf551c96SAkhil Goyal.. code-block:: console 155bf551c96SAkhil Goyal 156bf551c96SAkhil Goyal cd <DPDK-source-directory> 157bf551c96SAkhil Goyal make config T=arm64-dpaa-linuxapp-gcc install 158