doc: add AMD CCP guide
[dpdk.git] / doc / guides / cryptodevs / ccp.rst
1 .. SPDX-License-Identifier: BSD-3-Clause
2    Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved.
3
4 AMD CCP Poll Mode Driver
5 ========================
6
7 This code provides the initial implementation of the ccp poll mode driver.
8 The CCP poll mode driver library (librte_pmd_ccp) implements support for
9 AMD’s cryptographic co-processor (CCP). The CCP PMD is a virtual crypto
10 poll mode driver which schedules crypto operations to one or more available
11 CCP hardware engines on the platform. The CCP PMD provides poll mode crypto
12 driver support for the following hardware accelerator devices::
13
14         AMD Cryptographic Co-processor (0x1456)
15         AMD Cryptographic Co-processor (0x1468)
16
17 Features
18 --------
19
20 CCP crypto PMD has support for:
21
22 Cipher algorithms:
23
24 * ``RTE_CRYPTO_CIPHER_AES_CBC``
25 * ``RTE_CRYPTO_CIPHER_AES_ECB``
26 * ``RTE_CRYPTO_CIPHER_AES_CTR``
27 * ``RTE_CRYPTO_CIPHER_3DES_CBC``
28
29 Hash algorithms:
30
31 * ``RTE_CRYPTO_AUTH_SHA1``
32 * ``RTE_CRYPTO_AUTH_SHA1_HMAC``
33 * ``RTE_CRYPTO_AUTH_SHA224``
34 * ``RTE_CRYPTO_AUTH_SHA224_HMAC``
35 * ``RTE_CRYPTO_AUTH_SHA256``
36 * ``RTE_CRYPTO_AUTH_SHA256_HMAC``
37 * ``RTE_CRYPTO_AUTH_SHA384``
38 * ``RTE_CRYPTO_AUTH_SHA384_HMAC``
39 * ``RTE_CRYPTO_AUTH_SHA512``
40 * ``RTE_CRYPTO_AUTH_SHA512_HMAC``
41 * ``RTE_CRYPTO_AUTH_MD5_HMAC``
42 * ``RTE_CRYPTO_AUTH_AES_CMAC``
43 * ``RTE_CRYPTO_AUTH_SHA3_224``
44 * ``RTE_CRYPTO_AUTH_SHA3_224_HMAC``
45 * ``RTE_CRYPTO_AUTH_SHA3_256``
46 * ``RTE_CRYPTO_AUTH_SHA3_256_HMAC``
47 * ``RTE_CRYPTO_AUTH_SHA3_384``
48 * ``RTE_CRYPTO_AUTH_SHA3_384_HMAC``
49 * ``RTE_CRYPTO_AUTH_SHA3_512``
50 * ``RTE_CRYPTO_AUTH_SHA3_512_HMAC``
51
52 AEAD algorithms:
53
54 * ``RTE_CRYPTO_AEAD_AES_GCM``
55
56 Installation
57 ------------
58
59 To compile CCP PMD, it has to be enabled in the config/common_base file.
60 * ``CONFIG_RTE_LIBRTE_PMD_CCP=y``
61
62 The CCP PMD also supports computing authentication over CPU with cipher offloaded
63 to CCP. To enable this feature, enable following in the configuration.
64 * ``CONFIG_RTE_LIBRTE_PMD_CCP_CPU_AUTH=y``
65
66 This code was verified on Ubuntu 16.04.
67
68 Initialization
69 --------------
70
71 Bind the CCP devices to DPDK UIO driver module before running the CCP PMD stack.
72 e.g. for the 0x1456 device::
73
74         cd to the top-level DPDK directory
75         modprobe uio
76         insmod ./build/kmod/igb_uio.ko
77         echo "1022 1456" > /sys/bus/pci/drivers/igb_uio/new_id
78
79 Another way to bind the CCP devices to DPDK UIO driver is by using the ``dpdk-devbind.py`` script.
80 The following command assumes ``BFD`` of ``0000:09:00.2``::
81
82         cd to the top-level DPDK directory
83         ./usertools/dpdk-devbind.py -b igb_uio 0000:09:00.2
84
85 To verify real traffic l2fwd-crypto example can be used with following command:
86
87 .. code-block:: console
88
89         sudo ./build/l2fwd-crypto -l 1 -n 4 --vdev "crypto_ccp" -- -p 0x1
90         --chain CIPHER_HASH --cipher_op ENCRYPT --cipher_algo AES_CBC
91         --cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f
92         --iv 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:ff
93         --auth_op GENERATE --auth_algo SHA1_HMAC
94         --auth_key 11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11
95         :11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11
96         :11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11
97
98 Limitations
99 -----------
100
101 * Chained mbufs are not supported
102 * MD5_HMAC is supported only if ``CONFIG_RTE_LIBRTE_PMD_CCP_CPU_AUTH=y`` is enabled in configuration