xref: /dpdk/doc/guides/cryptodevs/mvsam.rst (revision 8809f78c7dd9f33a44a4f89c58fc91ded34296ed)
112e10bd0SJerin Jacob..  SPDX-License-Identifier: BSD-3-Clause
2e95faac1STomasz Duszynski    Copyright(c) 2017 Marvell International Ltd.
3e95faac1STomasz Duszynski    Copyright(c) 2017 Semihalf.
4e95faac1STomasz Duszynski
5e95faac1STomasz DuszynskiMVSAM Crypto Poll Mode Driver
6e95faac1STomasz Duszynski=============================
7e95faac1STomasz Duszynski
8*8809f78cSBruce RichardsonThe MVSAM CRYPTO PMD (**librte_crypto_mvsam**) provides poll mode crypto driver
9e95faac1STomasz Duszynskisupport by utilizing MUSDK library, which provides cryptographic operations
10e95faac1STomasz Duszynskiacceleration by using Security Acceleration Engine (EIP197) directly from
11e95faac1STomasz Duszynskiuser-space with minimum overhead and high performance.
12e95faac1STomasz Duszynski
133af63caeSDmitri EpshteinDetailed information about SoCs that use MVSAM crypto driver can be obtained here:
143af63caeSDmitri Epshtein
153af63caeSDmitri Epshtein* https://www.marvell.com/embedded-processors/armada-70xx/
163af63caeSDmitri Epshtein* https://www.marvell.com/embedded-processors/armada-80xx/
173af63caeSDmitri Epshtein* https://www.marvell.com/embedded-processors/armada-3700/
183af63caeSDmitri Epshtein
193af63caeSDmitri Epshtein
20e95faac1STomasz DuszynskiFeatures
21e95faac1STomasz Duszynski--------
22e95faac1STomasz Duszynski
23e95faac1STomasz DuszynskiMVSAM CRYPTO PMD has support for:
24e95faac1STomasz Duszynski
253af63caeSDmitri EpshteinCipher algorithms:
263af63caeSDmitri Epshtein
273af63caeSDmitri Epshtein* ``RTE_CRYPTO_CIPHER_NULL``
283af63caeSDmitri Epshtein* ``RTE_CRYPTO_CIPHER_AES_CBC``
293af63caeSDmitri Epshtein* ``RTE_CRYPTO_CIPHER_AES_CTR``
303af63caeSDmitri Epshtein* ``RTE_CRYPTO_CIPHER_AES_ECB``
313af63caeSDmitri Epshtein* ``RTE_CRYPTO_CIPHER_3DES_CBC``
323af63caeSDmitri Epshtein* ``RTE_CRYPTO_CIPHER_3DES_CTR``
333af63caeSDmitri Epshtein* ``RTE_CRYPTO_CIPHER_3DES_ECB``
343af63caeSDmitri Epshtein
353af63caeSDmitri EpshteinHash algorithms:
363af63caeSDmitri Epshtein
373af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_NULL``
383af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_MD5``
393af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_MD5_HMAC``
403af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_SHA1``
413af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_SHA1_HMAC``
423af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_SHA224``
433af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_SHA224_HMAC``
443af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_SHA256``
453af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_SHA256_HMAC``
463af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_SHA384``
473af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_SHA384_HMAC``
483af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_SHA512``
493af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_SHA512_HMAC``
503af63caeSDmitri Epshtein* ``RTE_CRYPTO_AUTH_AES_GMAC``
513af63caeSDmitri Epshtein
523af63caeSDmitri EpshteinAEAD algorithms:
533af63caeSDmitri Epshtein
543af63caeSDmitri Epshtein* ``RTE_CRYPTO_AEAD_AES_GCM``
553af63caeSDmitri Epshtein
563af63caeSDmitri EpshteinFor supported feature flags please consult :doc:`overview`.
57e95faac1STomasz Duszynski
58e95faac1STomasz DuszynskiLimitations
59e95faac1STomasz Duszynski-----------
60e95faac1STomasz Duszynski
61e95faac1STomasz Duszynski* Hardware only supports scenarios where ICV (digest buffer) is placed just
62e95faac1STomasz Duszynski  after the authenticated data. Other placement will result in error.
63e95faac1STomasz Duszynski
64e95faac1STomasz DuszynskiInstallation
65e95faac1STomasz Duszynski------------
66e95faac1STomasz Duszynski
67e95faac1STomasz DuszynskiMVSAM CRYPTO PMD requires MUSDK built with EIP197 support thus following
68e95faac1STomasz Duszynskiextra option must be passed to the library configuration script:
69e95faac1STomasz Duszynski
70e95faac1STomasz Duszynski.. code-block:: console
71e95faac1STomasz Duszynski
723af63caeSDmitri Epshtein   --enable-sam [--enable-sam-statistics] [--enable-sam-debug]
73e95faac1STomasz Duszynski
743af63caeSDmitri EpshteinFor instructions how to build required kernel modules please refer
75e95faac1STomasz Duszynskito `doc/musdk_get_started.txt`.
76e95faac1STomasz Duszynski
77e95faac1STomasz DuszynskiInitialization
78e95faac1STomasz Duszynski--------------
79e95faac1STomasz Duszynski
80e95faac1STomasz DuszynskiAfter successfully building MVSAM CRYPTO PMD, the following modules need to be
81e95faac1STomasz Duszynskiloaded:
82e95faac1STomasz Duszynski
83e95faac1STomasz Duszynski.. code-block:: console
84e95faac1STomasz Duszynski
853af63caeSDmitri Epshtein   insmod musdk_cma.ko
863af63caeSDmitri Epshtein   insmod crypto_safexcel.ko rings=0,0
87e95faac1STomasz Duszynski   insmod mv_sam_uio.ko
88e95faac1STomasz Duszynski
89e95faac1STomasz DuszynskiThe following parameters (all optional) are exported by the driver:
90e95faac1STomasz Duszynski
913af63caeSDmitri Epshtein- ``max_nb_queue_pairs``: maximum number of queue pairs in the device (default: 8 - A8K, 4 - A7K/A3K).
923af63caeSDmitri Epshtein- ``max_nb_sessions``: maximum number of sessions that can be created (default: 2048).
933af63caeSDmitri Epshtein- ``socket_id``: socket on which to allocate the device resources on.
94e95faac1STomasz Duszynski
95e95faac1STomasz Duszynskil2fwd-crypto example application can be used to verify MVSAM CRYPTO PMD
96e95faac1STomasz Duszynskioperation:
97e95faac1STomasz Duszynski
98e95faac1STomasz Duszynski.. code-block:: console
99e95faac1STomasz Duszynski
100fd5f9fb9SCiara Power   ./dpdk-l2fwd-crypto --vdev=eth_mvpp2,iface=eth0 --vdev=crypto_mvsam -- \
101e95faac1STomasz Duszynski     --cipher_op ENCRYPT --cipher_algo aes-cbc \
102e95faac1STomasz Duszynski     --cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f  \
103e95faac1STomasz Duszynski     --auth_op GENERATE --auth_algo sha1-hmac \
104e95faac1STomasz Duszynski     --auth_key 10:11:12:13:14:15:16:17:18:19:1a:1b:1c:1d:1e:1f
105