dpdk: cryptodev support enabled by default 48/5848/4
authorSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Wed, 22 Mar 2017 16:11:06 +0000 (16:11 +0000)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 28 Apr 2017 17:24:13 +0000 (17:24 +0000)
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>
src/plugins/dpdk/device/dpdk.h
src/plugins/dpdk/device/init.c
src/plugins/dpdk/ipsec/cli.c
src/plugins/dpdk/ipsec/dpdk_crypto_ipsec_doc.md
src/plugins/dpdk/ipsec/ipsec.c
src/plugins/dpdk/ipsec/ipsec.h

index 90e93e7..82e5938 100644 (file)
@@ -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;
index 33ecde4..e20b258 100755 (executable)
@@ -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))
        {
index 3ae8c9b..a931406 100644 (file)
 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;
index b3d3cc4..5a9f9c6 100644 (file)
@@ -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:
 
index 5d8f4fb..7066564 100644 (file)
@@ -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;
index f0f793c..d794034 100644 (file)
@@ -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;