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