int vids[MAX_NB_SOCKETS];
uint32_t nb_vids;
struct rte_mempool *sess_pool;
+ struct rte_mempool *sess_priv_pool;
struct rte_mempool *cop_pool;
uint8_t cid;
uint32_t qid;
}
ret = rte_vhost_crypto_create(vid, info->cid, info->sess_pool,
+ info->sess_priv_pool,
rte_lcore_to_socket_id(options.los[i].lcore_id));
if (ret) {
RTE_LOG(ERR, USER1, "Cannot create vhost crypto\n");
.destroy_device = destroy_device,
};
-__attribute__((unused))
-static void clrscr(void)
-{
- system("@cls||clear");
-}
-
static int
vhost_crypto_worker(void *arg)
{
rte_mempool_free(info->cop_pool);
rte_mempool_free(info->sess_pool);
+ rte_mempool_free(info->sess_priv_pool);
for (j = 0; j < lo->nb_sockets; j++) {
rte_vhost_driver_unregister(lo->socket_files[i]);
int
main(int argc, char *argv[])
{
- struct rte_cryptodev_qp_conf qp_conf = {NB_CRYPTO_DESCRIPTORS};
+ struct rte_cryptodev_qp_conf qp_conf;
struct rte_cryptodev_config config;
struct rte_cryptodev_info dev_info;
char name[128];
config.nb_queue_pairs = dev_info.max_nb_queue_pairs;
config.socket_id = rte_lcore_to_socket_id(lo->lcore_id);
+ config.ff_disable = RTE_CRYPTODEV_FF_SECURITY;
ret = rte_cryptodev_configure(info->cid, &config);
if (ret < 0) {
}
snprintf(name, 127, "SESS_POOL_%u", lo->lcore_id);
- info->sess_pool = rte_mempool_create(name, SESSION_MAP_ENTRIES,
+ info->sess_pool = rte_cryptodev_sym_session_pool_create(name,
+ SESSION_MAP_ENTRIES, 0, 0, 0,
+ rte_lcore_to_socket_id(lo->lcore_id));
+
+ snprintf(name, 127, "SESS_POOL_PRIV_%u", lo->lcore_id);
+ info->sess_priv_pool = rte_mempool_create(name,
+ SESSION_MAP_ENTRIES,
rte_cryptodev_sym_get_private_session_size(
info->cid), 64, 0, NULL, NULL, NULL, NULL,
rte_lcore_to_socket_id(lo->lcore_id), 0);
- if (!info->sess_pool) {
+ if (!info->sess_priv_pool || !info->sess_pool) {
RTE_LOG(ERR, USER1, "Failed to create mempool");
goto error_exit;
}
options.infos[i] = info;
+ qp_conf.nb_descriptors = NB_CRYPTO_DESCRIPTORS;
+ qp_conf.mp_session = info->sess_pool;
+ qp_conf.mp_session_private = info->sess_priv_pool;
+
for (j = 0; j < dev_info.max_nb_queue_pairs; j++) {
ret = rte_cryptodev_queue_pair_setup(info->cid, j,
&qp_conf, rte_lcore_to_socket_id(
- lo->lcore_id),
- info->sess_pool);
+ lo->lcore_id));
if (ret < 0) {
RTE_LOG(ERR, USER1, "Failed to configure qp\n");
goto error_exit;