Reorganize source tree to use single autotools instance
[vpp.git] / src / vnet / devices / dpdk / ipsec / dpdk_crypto_ipsec_doc.md
1 # VPP IPSec implementation using DPDK Cryptodev API    {#dpdk_crypto_ipsec_doc}
2
3 This document is meant to contain all related information about implementation and usability.
4
5
6 ## VPP IPsec with DPDK Cryptodev
7
8 DPDK Cryptodev is an asynchronous crypto API that supports both Hardware and Software implementations (for more details refer to [DPDK Cryptography Device Library documentation](http://dpdk.org/doc/guides/prog_guide/cryptodev_lib.html)).
9
10 When DPDK Cryptodev support is enabled, the node graph is modified by adding and replacing some of the nodes.
11
12 The following nodes are replaced:
13 * esp-encrypt -> dpdk-esp-encrypt
14 * esp-decrypt -> dpdk-esp-decrypt
15
16 The following nodes are added:
17 * dpdk-crypto-input : polling input node, basically dequeuing from crypto devices.
18 * dpdk-esp-encrypt-post : internal node.
19 * dpdk-esp-decrypt-post : internal node.
20
21
22 ### How to enable VPP IPSec with DPDK Cryptodev support
23
24 To enable DPDK Cryptodev support (disabled by default), we need the following env option:
25
26     vpp_uses_dpdk_cryptodev=yes
27
28 A couple of ways to achive this:
29 * uncomment/add it in the platforms config (ie. build-data/platforms/vpp.mk)
30 * set the option when building vpp (ie. make vpp_uses_dpdk_cryptodev=yes build-release)
31
32
33 ### Crypto Resources allocation
34
35 VPP allocates crypto resources based on a best effort approach:
36 * first allocate Hardware crypto resources, then Software.
37 * if there are not enough crypto resources for all workers, all packets will be dropped if they reach ESP encrypt/decrypt nodes, displaying the warning:
38
39       0: dpdk_ipsec_init: not enough cryptodevs for ipsec
40
41
42 ### Configuration example
43
44 No especial IPsec configuration is required.
45
46 Once DPDK Cryptodev is enabled, the user just needs to provide cryptodevs in the startup.conf.
47
48 Example startup.conf:
49
50 ```
51 dpdk {
52     socket-mem 1024,1024
53     num-mbufs 131072
54     dev 0000:81:00.0
55     dev 0000:81:00.1
56     dev 0000:85:01.0
57     dev 0000:85:01.1
58     vdev cryptodev_aesni_mb_pmd,socket_id=1
59     vdev cryptodev_aesni_mb_pmd,socket_id=1
60 }
61 ```
62
63 In the above configuration:
64 * 0000:85:01.0 and 0000:85:01.1 are crypto BDFs and they require the same driver binding as DPDK Ethernet devices but they do not support any extra configuration options.
65 * Two AESNI-MB Software Cryptodev PMDs are created in NUMA node 1.
66
67 For further details refer to [DPDK Crypto Device Driver documentation](http://dpdk.org/doc/guides/cryptodevs/index.html)
68
69 ### Operational data
70
71 The following CLI command displays the Cryptodev/Worker mapping:
72
73     show crypto device mapping [verbose]