2 Copyright(c) 2017 Marvell International Ltd.
3 Copyright(c) 2017 Semihalf.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
10 * Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 * Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in
14 the documentation and/or other materials provided with the
16 * Neither the name of the copyright holder nor the names of its
17 contributors may be used to endorse or promote products derived
18 from this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 MRVL Crypto Poll Mode Driver
33 ============================
35 The MRVL CRYPTO PMD (**librte_crypto_mrvl_pmd**) provides poll mode crypto driver
36 support by utilizing MUSDK library, which provides cryptographic operations
37 acceleration by using Security Acceleration Engine (EIP197) directly from
38 user-space with minimum overhead and high performance.
43 MRVL CRYPTO PMD has support for:
46 * Sym operation chaining
70 * Hardware only supports scenarios where ICV (digest buffer) is placed just
71 after the authenticated data. Other placement will result in error.
73 * Before running crypto test suite it is advised to increase limit of
76 .. code-block:: console
83 MRVL CRYPTO PMD driver compilation is disabled by default due to external dependencies.
84 Currently there are two driver specific compilation options in
85 ``config/common_base`` available:
87 - ``CONFIG_RTE_LIBRTE_MRVL_CRYPTO`` (default ``n``)
89 Toggle compilation of the librte_pmd_mrvl driver.
91 - ``CONFIG_RTE_LIBRTE_MRVL_CRYPTO_DEBUG`` (default ``n``)
93 Toggle display of debugging messages.
95 During compilation external MUSDK library, which provides direct access
96 to Marvell's EIP197 cryptographic engine, is necessary. Library sources are
97 available `here <https://github.com/MarvellEmbeddedProcessors/musdk-marvell/tree/musdk-armada-17.08>`__.
99 Alternatively, prebuilt library can be downloaded from
100 `Marvell Extranet <https://extranet.marvell.com>`_. Once approval has been
101 granted, library can be found by typing ``musdk`` in the search box.
103 For MUSDK library build instructions please refer to ``doc/musdk_get_started.txt``
104 in library sources directory.
106 MUSDK requires out of tree kernel modules to work. Kernel tree needed to build
108 `here <https://github.com/MarvellEmbeddedProcessors/linux-marvell/tree/linux-4.4.52-armada-17.08>`__.
113 After successfully building MRVL CRYPTO PMD, the following modules need to be
116 .. code-block:: console
119 insmod mvpp2x_sysfs.ko
122 insmod crypto_safexcel.ko
124 - `musdk_uio.ko`, `mv_pp2_uio.ko` and `mv_sam_uio.ko` are distributed together with MUSDK library.
125 - `crypto_safexcel.ko` is an in-kernel module.
126 - `mvpp2x_sysfs.ko` can be build from sources available `here <https://github.com/MarvellEmbeddedProcessors/mvpp2x-marvell/tree/mvpp2x-armada-17.08>`__.
128 The following parameters (all optional) are exported by the driver:
130 * max_nb_queue_pairs: maximum number of queue pairs in the device (8 by default).
131 * max_nb_sessions: maximum number of sessions that can be created (2048 by default).
132 * socket_id: socket on which to allocate the device resources on.
134 l2fwd-crypto example application can be used to verify MRVL CRYPTO PMD
137 .. code-block:: console
139 ./l2fwd-crypto --vdev=net_mrvl,iface=eth0 --vdev=crypto_mrvl -- \
140 --cipher_op ENCRYPT --cipher_algo aes-cbc \
141 --cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f \
142 --auth_op GENERATE --auth_algo sha1-hmac \
143 --auth_key 10:11:12:13:14:15:16:17:18:19:1a:1b:1c:1d:1e:1f
147 .. code-block:: console
150 AAD: at [0x7f253ceb80], len=
151 P ID 0 configuration ----
153 MAC status : disabled
154 Link status : link up
157 Port: Egress enable tx_port_num=16 qmap=0x1
159 P ID 0 configuration ----
161 MAC status : disabled
162 Link status : link down
165 Port: Egress enable tx_port_num=16 qmap=0x1
166 Port 0, MAC address: 00:50:43:02:21:20
169 Checking link statusdone
170 Port 0 Link Up - speed 0 Mbps - full-duplex
172 Allocated session pool on socket 0
173 eip197: 0:0 registers: paddr: 0xf2880000, vaddr: 0x0x7f56a80000
174 DMA buffer (131136 bytes) for CDR #0 allocated: paddr = 0xb0585e00, vaddr = 0x7f09384e00
175 DMA buffer (131136 bytes) for RDR #0 allocated: paddr = 0xb05a5f00, vaddr = 0x7f093a4f00
176 DMA buffers allocated for 2049 operations. Tokens - 256 bytes
178 L2FWD: lcore 1 has nothing to do
179 L2FWD: lcore 2 has nothing to do
180 L2FWD: lcore 3 has nothing to do
181 L2FWD: entering main loop on lcore 0
182 L2FWD: -- lcoreid=0 portid=0
183 L2FWD: -- lcoreid=0 cryptoid=0
187 refresh period : 10000
188 single lcore mode: disabled
189 stats_printing: enabled
190 sessionless crypto: disabled
192 Crypto chain: Input --> Encrypt --> Auth generate --> Output
194 ---- Cipher information ---
196 Cipher key: at [0x7f56db4e80], len=16
197 00000000: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | ................
198 IV: at [0x7f56db4b80], len=16
199 00000000: 20 F0 63 0E 45 EB 2D 84 72 D4 13 6E 36 B5 AF FE | .c.E.-.r..n6...
201 ---- Authentication information ---
203 Auth key: at [0x7f56db4d80], len=16
204 00000000: 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F | ................
205 IV: at [0x7f56db4a80], len=0
206 AAD: at [0x7f253ceb80], len=