xref: /dpdk/doc/guides/cryptodevs/aesni_mb.rst (revision 21c0a80e11bbf3405c849fc68a794a08ce1a732c)
1924e84f8SDeclan Doherty..  BSD LICENSE
2924e84f8SDeclan Doherty    Copyright(c) 2015 Intel Corporation. All rights reserved.
3924e84f8SDeclan Doherty
4924e84f8SDeclan Doherty    Redistribution and use in source and binary forms, with or without
5924e84f8SDeclan Doherty    modification, are permitted provided that the following conditions
6924e84f8SDeclan Doherty    are met:
7924e84f8SDeclan Doherty
8924e84f8SDeclan Doherty    * Redistributions of source code must retain the above copyright
9924e84f8SDeclan Doherty    notice, this list of conditions and the following disclaimer.
10924e84f8SDeclan Doherty    * Redistributions in binary form must reproduce the above copyright
11924e84f8SDeclan Doherty    notice, this list of conditions and the following disclaimer in
12924e84f8SDeclan Doherty    the documentation and/or other materials provided with the
13924e84f8SDeclan Doherty    distribution.
14924e84f8SDeclan Doherty    * Neither the name of Intel Corporation nor the names of its
15924e84f8SDeclan Doherty    contributors may be used to endorse or promote products derived
16924e84f8SDeclan Doherty    from this software without specific prior written permission.
17924e84f8SDeclan Doherty
18924e84f8SDeclan Doherty    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19924e84f8SDeclan Doherty    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20924e84f8SDeclan Doherty    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21924e84f8SDeclan Doherty    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22924e84f8SDeclan Doherty    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23924e84f8SDeclan Doherty    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24924e84f8SDeclan Doherty    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25924e84f8SDeclan Doherty    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26924e84f8SDeclan Doherty    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27924e84f8SDeclan Doherty    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28924e84f8SDeclan Doherty    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29924e84f8SDeclan Doherty
30924e84f8SDeclan DohertyAESN-NI Multi Buffer Crytpo Poll Mode Driver
31924e84f8SDeclan Doherty============================================
32924e84f8SDeclan Doherty
33924e84f8SDeclan Doherty
34924e84f8SDeclan DohertyThe AESNI MB PMD (**librte_pmd_aesni_mb**) provides poll mode crypto driver
352fe68f32SJohn McNamarasupport for utilizing Intel multi buffer library, see the white paper
36924e84f8SDeclan Doherty`Fast Multi-buffer IPsec Implementations on Intel® Architecture Processors
37924e84f8SDeclan Doherty<https://www-ssl.intel.com/content/www/us/en/intelligent-systems/intel-technology/fast-multi-buffer-ipsec-implementations-ia-processors-paper.html?wapkw=multi+buffer>`_.
38924e84f8SDeclan Doherty
39924e84f8SDeclan DohertyThe AES-NI MB PMD has current only been tested on Fedora 21 64-bit with gcc.
40924e84f8SDeclan Doherty
41924e84f8SDeclan DohertyFeatures
42924e84f8SDeclan Doherty--------
43924e84f8SDeclan Doherty
44924e84f8SDeclan DohertyAESNI MB PMD has support for:
45924e84f8SDeclan Doherty
46924e84f8SDeclan DohertyCipher algorithms:
47924e84f8SDeclan Doherty
48fddf3804SDeepak Kumar Jain* RTE_CRYPTO_CIPHER_AES128_CBC
49fddf3804SDeepak Kumar Jain* RTE_CRYPTO_CIPHER_AES192_CBC
50fddf3804SDeepak Kumar Jain* RTE_CRYPTO_CIPHER_AES256_CBC
51fddf3804SDeepak Kumar Jain* RTE_CRYPTO_CIPHER_AES128_CTR
52fddf3804SDeepak Kumar Jain* RTE_CRYPTO_CIPHER_AES192_CTR
53fddf3804SDeepak Kumar Jain* RTE_CRYPTO_CIPHER_AES256_CTR
54924e84f8SDeclan Doherty
55924e84f8SDeclan DohertyHash algorithms:
56924e84f8SDeclan Doherty
57fddf3804SDeepak Kumar Jain* RTE_CRYPTO_HASH_SHA1_HMAC
58fddf3804SDeepak Kumar Jain* RTE_CRYPTO_HASH_SHA256_HMAC
59fddf3804SDeepak Kumar Jain* RTE_CRYPTO_HASH_SHA512_HMAC
60924e84f8SDeclan Doherty
61924e84f8SDeclan DohertyLimitations
62924e84f8SDeclan Doherty-----------
63924e84f8SDeclan Doherty
64924e84f8SDeclan Doherty* Chained mbufs are not supported.
65924e84f8SDeclan Doherty* Hash only is not supported.
66924e84f8SDeclan Doherty* Cipher only is not supported.
67924e84f8SDeclan Doherty* Only in-place is currently supported (destination address is the same as source address).
68924e84f8SDeclan Doherty* Only supports session-oriented API implementation (session-less APIs are not supported).
69924e84f8SDeclan Doherty
70924e84f8SDeclan DohertyInstallation
71924e84f8SDeclan Doherty------------
72924e84f8SDeclan Doherty
73924e84f8SDeclan DohertyTo build DPDK with the AESNI_MB_PMD the user is required to download the mult-
74*21c0a80eSPablo de Larabuffer library from `here <https://github.com/01org/intel-ipsec-mb>`_
75*21c0a80eSPablo de Laraand compile it on their user system before building DPDK.
76924e84f8SDeclan Doherty
77924e84f8SDeclan Doherty.. code-block:: console
78924e84f8SDeclan Doherty
79*21c0a80eSPablo de Lara	make
80924e84f8SDeclan Doherty
81b7d65109SPablo de LaraInitialization
82b7d65109SPablo de Lara--------------
83b7d65109SPablo de Lara
84b7d65109SPablo de LaraIn order to enable this virtual crypto PMD, user must:
85b7d65109SPablo de Lara
86b7d65109SPablo de Lara* Export the environmental variable AESNI_MULTI_BUFFER_LIB_PATH with the path where
87b7d65109SPablo de Lara  the library was extracted.
88b7d65109SPablo de Lara
89b7d65109SPablo de Lara* Build the multi buffer library (explained in Installation section).
90b7d65109SPablo de Lara
91b7d65109SPablo de Lara* Set CONFIG_RTE_LIBRTE_PMD_AESNI_MB=y in config/common_base.
92b7d65109SPablo de Lara
93b7d65109SPablo de LaraTo use the PMD in an application, user must:
94b7d65109SPablo de Lara
952f45703cSPablo de Lara* Call rte_eal_vdev_init("crypto_aesni_mb") within the application.
96b7d65109SPablo de Lara
972f45703cSPablo de Lara* Use --vdev="crypto_aesni_mb" in the EAL options, which will call rte_eal_vdev_init() internally.
98b7d65109SPablo de Lara
99b7d65109SPablo de LaraThe following parameters (all optional) can be provided in the previous two calls:
100b7d65109SPablo de Lara
101b7d65109SPablo de Lara* socket_id: Specify the socket where the memory for the device is going to be allocated
102b7d65109SPablo de Lara  (by default, socket_id will be the socket where the core that is creating the PMD is running on).
103b7d65109SPablo de Lara
104b7d65109SPablo de Lara* max_nb_queue_pairs: Specify the maximum number of queue pairs in the device (8 by default).
105b7d65109SPablo de Lara
106b7d65109SPablo de Lara* max_nb_sessions: Specify the maximum number of sessions that can be created (2048 by default).
107b7d65109SPablo de Lara
108b7d65109SPablo de LaraExample:
109b7d65109SPablo de Lara
110b7d65109SPablo de Lara.. code-block:: console
111b7d65109SPablo de Lara
1122f45703cSPablo de Lara    ./l2fwd-crypto -c 40 -n 4 --vdev="crypto_aesni_mb,socket_id=1,max_nb_sessions=128"
113