struct rte_crypto_sym_xform auth_xform = { 0 };
struct rte_crypto_sym_xform *xfs;
struct rte_cryptodev_sym_session **s;
- crypto_session_key_t key = { 0 };
clib_error_t *erorr = 0;
- key.drv_id = res->drv_id;
- key.sa_idx = sa_idx;
sa = pool_elt_at_index (im->sad, sa_idx);
goto done;
}
- hash_set (data->session_by_drv_id_and_sa_index, key.val, session[0]);
+ add_session_by_drv_and_sa_idx (session[0], data, res->drv_id, sa_idx);
done:
clib_spinlock_unlock_if_init (&data->lockp);
dpdk_crypto_main_t *dcm = &dpdk_crypto_main;
crypto_data_t *data;
struct rte_cryptodev_sym_session *s;
- crypto_session_key_t key = { 0 };
uword *val;
u32 drv_id;
return 0;
}
- key.sa_idx = sa_index;
-
/* *INDENT-OFF* */
vec_foreach (data, dcm->data)
{
clib_spinlock_lock_if_init (&data->lockp);
val = hash_get (data->session_by_sa_index, sa_index);
- s = (struct rte_cryptodev_sym_session *) val;
- if (s)
+ if (val)
{
+ s = (struct rte_cryptodev_sym_session *) val[0];
vec_foreach_index (drv_id, dcm->drv)
{
- key.drv_id = drv_id;
- val = hash_get (data->session_by_drv_id_and_sa_index, key.val);
- s = (struct rte_cryptodev_sym_session *) val;
- if (s)
- hash_unset (data->session_by_drv_id_and_sa_index, key.val);
+ val = (uword*) get_session_by_drv_and_sa_idx (data, drv_id, sa_index);
+ if (val)
+ add_session_by_drv_and_sa_idx(NULL, data, drv_id, sa_index);
}
hash_unset (data->session_by_sa_index, sa_index);
struct rte_cryptodev_qp_conf qp_conf;
i32 ret;
u16 qp;
- i8 *error_str;
+ char *error_str;
dev_conf.socket_id = numa;
dev_conf.nb_queue_pairs = n_qp;
return clib_error_return (0, error_str, dev, qp);
}
+ error_str = "failed to start crypto device %u";
+ if (rte_cryptodev_start (dev))
+ return clib_error_return (0, error_str, dev);
+
return 0;
}
pool_name = format (0, "session_h_pool_numa%u%c", numa, 0);
- elt_size = rte_cryptodev_get_header_session_size ();
+
+ elt_size = rte_cryptodev_sym_get_header_session_size ();
error =
dpdk_pool_create (vm, pool_name, elt_size, DPDK_CRYPTO_NB_SESS_OBJS,
vec_validate (data->session_drv, dev->drv_id);
vec_validate (data->session_drv_failed, dev->drv_id);
+ vec_validate_aligned (data->session_by_drv_id_and_sa_index, 32,
+ CLIB_CACHE_LINE_BYTES);
if (data->session_drv[dev->drv_id])
return NULL;
pool_name = format (0, "session_drv%u_pool_numa%u%c", dev->drv_id, numa, 0);
- elt_size = rte_cryptodev_get_private_session_size (dev->id);
+
+ elt_size = rte_cryptodev_sym_get_private_session_size (dev->id);
error =
dpdk_pool_create (vm, pool_name, elt_size, DPDK_CRYPTO_NB_SESS_OBJS,
vec_free (dcm->data);
vec_free (dcm->workers_main);
- vec_free (dcm->sa_session);
vec_free (dcm->dev);
vec_free (dcm->resource);
vec_free (dcm->cipher_algs);
/* Add new next node and set it as default */
vlib_node_t *node, *next_node;
- next_node = vlib_get_node_by_name (vm, (u8 *) "dpdk-esp-encrypt");
+ next_node = vlib_get_node_by_name (vm, (u8 *) "dpdk-esp4-encrypt");
+ ASSERT (next_node);
+ node = vlib_get_node_by_name (vm, (u8 *) "ipsec4-output");
+ ASSERT (node);
+ im->esp4_encrypt_node_index = next_node->index;
+ im->esp4_encrypt_next_index =
+ vlib_node_add_next (vm, node->index, next_node->index);
+
+ next_node = vlib_get_node_by_name (vm, (u8 *) "dpdk-esp4-decrypt");
+ ASSERT (next_node);
+ node = vlib_get_node_by_name (vm, (u8 *) "ipsec4-input");
+ ASSERT (node);
+ im->esp4_decrypt_node_index = next_node->index;
+ im->esp4_decrypt_next_index =
+ vlib_node_add_next (vm, node->index, next_node->index);
+
+ next_node = vlib_get_node_by_name (vm, (u8 *) "dpdk-esp6-encrypt");
ASSERT (next_node);
- node = vlib_get_node_by_name (vm, (u8 *) "ipsec-output-ip4");
+ node = vlib_get_node_by_name (vm, (u8 *) "ipsec6-output");
ASSERT (node);
- im->esp_encrypt_node_index = next_node->index;
- im->esp_encrypt_next_index =
+ im->esp6_encrypt_node_index = next_node->index;
+ im->esp6_encrypt_next_index =
vlib_node_add_next (vm, node->index, next_node->index);
- next_node = vlib_get_node_by_name (vm, (u8 *) "dpdk-esp-decrypt");
+ next_node = vlib_get_node_by_name (vm, (u8 *) "dpdk-esp6-decrypt");
ASSERT (next_node);
- node = vlib_get_node_by_name (vm, (u8 *) "ipsec-input-ip4");
+ node = vlib_get_node_by_name (vm, (u8 *) "ipsec6-input");
ASSERT (node);
- im->esp_decrypt_node_index = next_node->index;
- im->esp_decrypt_next_index =
+ im->esp6_decrypt_node_index = next_node->index;
+ im->esp6_decrypt_next_index =
vlib_node_add_next (vm, node->index, next_node->index);
im->cb.check_support_cb = dpdk_ipsec_check_support;