xref: /dpdk/doc/guides/cryptodevs/dpaa_sec.rst (revision ceccf8dc7c3d7797e380f12b45cd3ea1d7396b58)
1d81734caSHemant Agrawal..  SPDX-License-Identifier: BSD-3-Clause
2d81734caSHemant 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
816e075220SHemant AgrawalWhitelisting & Blacklisting
826e075220SHemant Agrawal---------------------------
836e075220SHemant Agrawal
846e075220SHemant AgrawalFor blacklisting a DPAA device, following commands can be used.
856e075220SHemant Agrawal
866e075220SHemant Agrawal .. code-block:: console
876e075220SHemant Agrawal
886e075220SHemant Agrawal    <dpdk app> <EAL args> -b "dpaa_bus:dpaa-secX" -- ...
896e075220SHemant Agrawal    e.g. "dpaa_bus:dpaa-sec0"
906e075220SHemant Agrawal
916e075220SHemant Agrawal    or to disable all 4 SEC devices
926e075220SHemant Agrawal    -b "dpaa_sec:dpaa-sec0"  -b "dpaa_sec:dpaa-sec1" -b "dpaa_sec:dpaa-sec2" -b "dpaa_sec:dpaa-sec3"
936e075220SHemant Agrawal
94bf551c96SAkhil GoyalLimitations
95bf551c96SAkhil Goyal-----------
96bf551c96SAkhil Goyal
97bf551c96SAkhil Goyal* Hash followed by Cipher mode is not supported
98bf551c96SAkhil Goyal* Only supports the session-oriented API implementation (session-less APIs are not supported).
99bf551c96SAkhil Goyal
100bf551c96SAkhil GoyalPrerequisites
101bf551c96SAkhil Goyal-------------
102bf551c96SAkhil Goyal
103bf551c96SAkhil GoyalDPAA_SEC driver has similar pre-requisites as described in :ref:`dpaa_overview`.
104bf551c96SAkhil Goyal
105*ceccf8dcSHemant AgrawalSee :doc:`../platform/dpaa` for setup information
106bf551c96SAkhil Goyal
107bf551c96SAkhil Goyal
108*ceccf8dcSHemant Agrawal- Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup the basic DPDK environment.
109bf551c96SAkhil Goyal
110bf551c96SAkhil GoyalPre-Installation Configuration
111bf551c96SAkhil Goyal------------------------------
112bf551c96SAkhil Goyal
113bf551c96SAkhil GoyalConfig File Options
114bf551c96SAkhil Goyal~~~~~~~~~~~~~~~~~~~
115bf551c96SAkhil Goyal
116bf551c96SAkhil GoyalBasic DPAA config file options are described in :ref:`dpaa_overview`.
117bf551c96SAkhil GoyalIn addition to those, the following options can be modified in the ``config`` file
118bf551c96SAkhil Goyalto enable DPAA_SEC PMD.
119bf551c96SAkhil Goyal
120bf551c96SAkhil GoyalPlease note that enabling debugging options may affect system performance.
121bf551c96SAkhil Goyal
122bf551c96SAkhil Goyal* ``CONFIG_RTE_LIBRTE_PMD_DPAA_SEC`` (default ``n``)
123bf551c96SAkhil Goyal  By default it is only enabled in defconfig_arm64-dpaa-* config.
124bf551c96SAkhil Goyal  Toggle compilation of the ``librte_pmd_dpaa_sec`` driver.
125bf551c96SAkhil Goyal
126bf551c96SAkhil GoyalInstallations
127bf551c96SAkhil Goyal-------------
128bf551c96SAkhil GoyalTo compile the DPAA_SEC PMD for Linux arm64 gcc target, run the
129bf551c96SAkhil Goyalfollowing ``make`` command:
130bf551c96SAkhil Goyal
131bf551c96SAkhil Goyal.. code-block:: console
132bf551c96SAkhil Goyal
133bf551c96SAkhil Goyal   cd <DPDK-source-directory>
134bf551c96SAkhil Goyal   make config T=arm64-dpaa-linuxapp-gcc install
135f163231eSHemant Agrawal
136f163231eSHemant AgrawalEnabling logs
137f163231eSHemant Agrawal-------------
138f163231eSHemant Agrawal
139f163231eSHemant AgrawalFor enabling logs, use the following EAL parameter:
140f163231eSHemant Agrawal
141f163231eSHemant Agrawal.. code-block:: console
142f163231eSHemant Agrawal
143a0173139SStephen Hemminger   ./your_crypto_application <EAL args> --log-level=pmd.crypto.dpaa:<level>
144f163231eSHemant Agrawal
145f163231eSHemant AgrawalUsing ``pmd.crypto.dpaa`` as log matching criteria, all Crypto PMD logs can be
146f163231eSHemant Agrawalenabled which are lower than logging ``level``.
147