dpdk: cryptodev support enabled by default
This patch slightly modifes how to enable DPDK Cryptodev. The startup option 'enable-cryptodev' has been removed and unless not enough cryptodevs are found, DPDK cryptodev will be enabled by default. Change-Id: Ic0ac507802cdc0eeb51f065e04ec43a1885617cf Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
This commit is contained in:

committed by
Damjan Marion

parent
69186d930f
commit
63c7e14f2e
@ -323,7 +323,6 @@ typedef struct
|
||||
u8 *uio_driver_name;
|
||||
u8 no_multi_seg;
|
||||
u8 enable_tcp_udp_checksum;
|
||||
u8 cryptodev;
|
||||
|
||||
/* Required config parameters */
|
||||
u8 coremask_set_manually;
|
||||
|
@ -995,9 +995,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
|
||||
else if (unformat (input, "no-multi-seg"))
|
||||
conf->no_multi_seg = 1;
|
||||
|
||||
else if (unformat (input, "enable-cryptodev"))
|
||||
conf->cryptodev = 1;
|
||||
|
||||
else if (unformat (input, "dev default %U", unformat_vlib_cli_sub_input,
|
||||
&sub_input))
|
||||
{
|
||||
|
@ -20,12 +20,11 @@
|
||||
static void
|
||||
dpdk_ipsec_show_mapping (vlib_main_t * vm, u16 detail_display)
|
||||
{
|
||||
dpdk_config_main_t *conf = &dpdk_config_main;
|
||||
dpdk_crypto_main_t *dcm = &dpdk_crypto_main;
|
||||
vlib_thread_main_t *tm = vlib_get_thread_main ();
|
||||
u32 i, skip_master;
|
||||
|
||||
if (!conf->cryptodev)
|
||||
if (!dcm->enabled)
|
||||
{
|
||||
vlib_cli_output (vm, "DPDK Cryptodev support is disabled\n");
|
||||
return;
|
||||
|
@ -23,15 +23,7 @@ Set new default next nodes:
|
||||
|
||||
### How to enable VPP IPSec with DPDK Cryptodev support
|
||||
|
||||
DPDK Cryptodev is supported in DPDK enabled VPP.
|
||||
By default, only HW Cryptodev is supported but needs to be explicetly enabled with the following config option:
|
||||
|
||||
```
|
||||
dpdk {
|
||||
enable-cryptodev
|
||||
}
|
||||
```
|
||||
|
||||
DPDK Cryptodev is supported in DPDK enabled VPP and by default only HW Cryptodev is supported.
|
||||
To enable SW Cryptodev support (AESNI-MB-PMD and GCM-PMD), we need the following env option:
|
||||
|
||||
vpp_uses_dpdk_cryptodev_sw=yes
|
||||
@ -47,15 +39,15 @@ When enabling SW Cryptodev support, it means that you need to pre-build the requ
|
||||
|
||||
VPP allocates crypto resources based on a best effort approach:
|
||||
* first allocate Hardware crypto resources, then Software.
|
||||
* if there are not enough crypto resources for all workers, the graph node is not modifed, therefore the default VPP IPsec implementation based in OpenSSL is used. The following message is displayed:
|
||||
* if there are not enough crypto resources for all workers, the graph node is not modifed and the default VPP IPsec implementation based in OpenSSL is used. The following message is displayed:
|
||||
|
||||
0: dpdk_ipsec_init: not enough cryptodevs for ipsec
|
||||
0: dpdk_ipsec_init: not enough Cryptodevs, default to OpenSSL IPsec
|
||||
|
||||
|
||||
### Configuration example
|
||||
|
||||
To enable DPDK Cryptodev the user just need to provide the startup.conf option
|
||||
as mentioned previously.
|
||||
To enable DPDK Cryptodev the user just need to provide cryptodevs int the
|
||||
startup.conf.
|
||||
|
||||
Example startup.conf:
|
||||
|
||||
|
@ -224,7 +224,6 @@ static uword
|
||||
dpdk_ipsec_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
vlib_frame_t * f)
|
||||
{
|
||||
dpdk_config_main_t *conf = &dpdk_config_main;
|
||||
ipsec_main_t *im = &ipsec_main;
|
||||
dpdk_crypto_main_t *dcm = &dpdk_crypto_main;
|
||||
vlib_thread_main_t *tm = vlib_get_thread_main ();
|
||||
@ -235,19 +234,12 @@ dpdk_ipsec_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
i32 dev_id, ret;
|
||||
u32 i, skip_master;
|
||||
|
||||
if (!conf->cryptodev)
|
||||
{
|
||||
clib_warning ("DPDK Cryptodev support is disabled, "
|
||||
"default to OpenSSL IPsec");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (check_cryptodev_queues () < 0)
|
||||
{
|
||||
conf->cryptodev = 0;
|
||||
clib_warning ("not enough Cryptodevs, default to OpenSSL IPsec");
|
||||
return 0;
|
||||
}
|
||||
dcm->enabled = 1;
|
||||
|
||||
vec_alloc (dcm->workers_main, tm->n_vlib_mains);
|
||||
_vec_len (dcm->workers_main) = tm->n_vlib_mains;
|
||||
|
@ -83,6 +83,7 @@ typedef struct
|
||||
{
|
||||
struct rte_mempool **cop_pools;
|
||||
crypto_worker_main_t *workers_main;
|
||||
u8 enabled;
|
||||
} dpdk_crypto_main_t;
|
||||
|
||||
dpdk_crypto_main_t dpdk_crypto_main;
|
||||
|
Reference in New Issue
Block a user