aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>2017-10-31 15:58:57 +0000
committerDamjan Marion <dmarion.lists@gmail.com>2017-11-01 09:28:59 +0000
commitdf36f2176d7e90dcd3e895b08ee2d69f42d15426 (patch)
treeb85528902608caf36a4416db02d2a20fc745f788 /src
parentaa3a25c1c9534a634ca20f64cbeb287733c67d9d (diff)
dpdk/ipsec: align memory
Change-Id: I2feb3e07c3070e8a525c539dd2feffa0dd1bca21 Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/dpdk/ipsec/ipsec.c10
-rw-r--r--src/plugins/dpdk/ipsec/ipsec.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/dpdk/ipsec/ipsec.c b/src/plugins/dpdk/ipsec/ipsec.c
index 6aa5fae8b26..dfbda5ba473 100644
--- a/src/plugins/dpdk/ipsec/ipsec.c
+++ b/src/plugins/dpdk/ipsec/ipsec.c
@@ -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,
diff --git a/src/plugins/dpdk/ipsec/ipsec.h b/src/plugins/dpdk/ipsec/ipsec.h
index 2a48e4e6110..d40e480ae42 100644
--- a/src/plugins/dpdk/ipsec/ipsec.h
+++ b/src/plugins/dpdk/ipsec/ipsec.h
@@ -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