dpdk/ipsec: align memory 58/9158/2
authorSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Tue, 31 Oct 2017 15:58:57 +0000 (15:58 +0000)
committerDamjan Marion <dmarion.lists@gmail.com>
Wed, 1 Nov 2017 09:28:59 +0000 (09:28 +0000)
Change-Id: I2feb3e07c3070e8a525c539dd2feffa0dd1bca21
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
src/plugins/dpdk/ipsec/ipsec.c
src/plugins/dpdk/ipsec/ipsec.h

index 6aa5fae..dfbda5b 100644 (file)
@@ -974,7 +974,7 @@ crypto_create_pools (void)
   /* *INDENT-OFF* */
   vec_foreach (dev, dcm->dev)
     {
-      vec_validate (dcm->data, dev->numa);
+      vec_validate_aligned (dcm->data, dev->numa, CLIB_CACHE_LINE_BYTES);
 
       error = crypto_create_crypto_op_pool (dev->numa);
       if (error)
@@ -1016,7 +1016,6 @@ crypto_disable (void)
   /* *INDENT-ON* */
 
   vec_free (dcm->data);
-
   vec_free (dcm->workers_main);
   vec_free (dcm->sa_session);
   vec_free (dcm->dev);
@@ -1050,12 +1049,15 @@ dpdk_ipsec_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
       return 0;
     }
 
-  vec_validate_init_empty (dcm->workers_main, n_mains - 1,
-                          (crypto_worker_main_t) EMPTY_STRUCT);
+  vec_validate_init_empty_aligned (dcm->workers_main, n_mains - 1,
+                                  (crypto_worker_main_t) EMPTY_STRUCT,
+                                  CLIB_CACHE_LINE_BYTES);
 
   /* *INDENT-OFF* */
   vec_foreach (cwm, dcm->workers_main)
     {
+      vec_validate_init_empty_aligned (cwm->ops, VLIB_FRAME_SIZE - 1, 0,
+                                      CLIB_CACHE_LINE_BYTES);
       memset (cwm->cipher_resource_idx, ~0,
              IPSEC_CRYPTO_N_ALG * sizeof(*cwm->cipher_resource_idx));
       memset (cwm->auth_resource_idx, ~0,
index 2a48e4e..d40e480 100644 (file)
@@ -66,9 +66,9 @@ typedef struct
 {
   u16 *resource_idx;
   uword *session_by_drv_id_and_sa_index;
+  struct rte_crypto_op **ops;
   u16 cipher_resource_idx[IPSEC_CRYPTO_N_ALG];
   u16 auth_resource_idx[IPSEC_INTEG_N_ALG];
-  struct rte_crypto_op *ops[VLIB_FRAME_SIZE];
 } crypto_worker_main_t __attribute__ ((aligned (CLIB_CACHE_LINE_BYTES)));
 
 typedef struct