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 MVSAM Crypto Poll Mode Driver
33 =============================
35 The MVSAM CRYPTO PMD (**librte_crypto_mvsam_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 MVSAM 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.
76 MVSAM CRYPTO PMD driver compilation is disabled by default due to external dependencies.
77 Currently there are two driver specific compilation options in
78 ``config/common_base`` available:
80 - ``CONFIG_RTE_LIBRTE_MVSAM_CRYPTO`` (default ``n``)
82 Toggle compilation of the librte_pmd_mvsam driver.
84 - ``CONFIG_RTE_LIBRTE_MVSAM_CRYPTO_DEBUG`` (default ``n``)
86 Toggle display of debugging messages.
88 For a list of prerequisites please refer to `Prerequisites` section in
89 :ref:`MVPP2 Poll Mode Driver <mvpp2_poll_mode_driver>` guide.
91 MVSAM CRYPTO PMD requires MUSDK built with EIP197 support thus following
92 extra option must be passed to the library configuration script:
94 .. code-block:: console
98 For `crypto_safexcel.ko` module build instructions please refer
99 to `doc/musdk_get_started.txt`.
104 After successfully building MVSAM CRYPTO PMD, the following modules need to be
107 .. code-block:: console
110 insmod mvpp2x_sysfs.ko
113 insmod crypto_safexcel.ko
115 The following parameters (all optional) are exported by the driver:
117 * max_nb_queue_pairs: maximum number of queue pairs in the device (8 by default).
118 * max_nb_sessions: maximum number of sessions that can be created (2048 by default).
119 * socket_id: socket on which to allocate the device resources on.
121 l2fwd-crypto example application can be used to verify MVSAM CRYPTO PMD
124 .. code-block:: console
126 ./l2fwd-crypto --vdev=eth_mvpp2,iface=eth0 --vdev=crypto_mvsam -- \
127 --cipher_op ENCRYPT --cipher_algo aes-cbc \
128 --cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f \
129 --auth_op GENERATE --auth_algo sha1-hmac \
130 --auth_key 10:11:12:13:14:15:16:17:18:19:1a:1b:1c:1d:1e:1f
134 .. code-block:: console
137 AAD: at [0x7f253ceb80], len=
138 P ID 0 configuration ----
140 MAC status : disabled
141 Link status : link up
144 Port: Egress enable tx_port_num=16 qmap=0x1
146 P ID 0 configuration ----
148 MAC status : disabled
149 Link status : link down
152 Port: Egress enable tx_port_num=16 qmap=0x1
153 Port 0, MAC address: 00:50:43:02:21:20
156 Checking link statusdone
157 Port 0 Link Up - speed 0 Mbps - full-duplex
159 Allocated session pool on socket 0
160 eip197: 0:0 registers: paddr: 0xf2880000, vaddr: 0x0x7f56a80000
161 DMA buffer (131136 bytes) for CDR #0 allocated: paddr = 0xb0585e00, vaddr = 0x7f09384e00
162 DMA buffer (131136 bytes) for RDR #0 allocated: paddr = 0xb05a5f00, vaddr = 0x7f093a4f00
163 DMA buffers allocated for 2049 operations. Tokens - 256 bytes
165 L2FWD: lcore 1 has nothing to do
166 L2FWD: lcore 2 has nothing to do
167 L2FWD: lcore 3 has nothing to do
168 L2FWD: entering main loop on lcore 0
169 L2FWD: -- lcoreid=0 portid=0
170 L2FWD: -- lcoreid=0 cryptoid=0
174 refresh period : 10000
175 single lcore mode: disabled
176 stats_printing: enabled
177 sessionless crypto: disabled
179 Crypto chain: Input --> Encrypt --> Auth generate --> Output
181 ---- Cipher information ---
183 Cipher key: at [0x7f56db4e80], len=16
184 00000000: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | ................
185 IV: at [0x7f56db4b80], len=16
186 00000000: 20 F0 63 0E 45 EB 2D 84 72 D4 13 6E 36 B5 AF FE | .c.E.-.r..n6...
188 ---- Authentication information ---
190 Auth key: at [0x7f56db4d80], len=16
191 00000000: 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F | ................
192 IV: at [0x7f56db4a80], len=0
193 AAD: at [0x7f253ceb80], len=