misc = priv;
ctx = SESS_PRIV(misc);
- if (ctx->auth_key != NULL)
- rte_free(ctx->auth_key);
+ rte_free(ctx->auth_key);
memset(priv, 0, cpt_get_session_size());
}
static int
-otx_cpt_asym_session_cfg(struct rte_cryptodev *dev,
+otx_cpt_asym_session_cfg(struct rte_cryptodev *dev __rte_unused,
struct rte_crypto_asym_xform *xform __rte_unused,
- struct rte_cryptodev_asym_session *sess,
- struct rte_mempool *pool)
+ struct rte_cryptodev_asym_session *sess)
{
- struct cpt_asym_sess_misc *priv;
+ struct cpt_asym_sess_misc *priv = (struct cpt_asym_sess_misc *)
+ sess->sess_private_data;
int ret;
CPT_PMD_INIT_FUNC_TRACE();
- if (rte_mempool_get(pool, (void **)&priv)) {
- CPT_LOG_ERR("Could not allocate session private data");
- return -ENOMEM;
- }
-
- memset(priv, 0, sizeof(struct cpt_asym_sess_misc));
-
ret = cpt_fill_asym_session_parameters(priv, xform);
if (ret) {
CPT_LOG_ERR("Could not configure session parameters");
-
- /* Return session to mempool */
- rte_mempool_put(pool, priv);
return ret;
}
priv->cpt_inst_w7 = 0;
- set_asym_session_private_data(sess, dev->driver_id, priv);
return 0;
}
struct rte_cryptodev_asym_session *sess)
{
struct cpt_asym_sess_misc *priv;
- struct rte_mempool *sess_mp;
CPT_PMD_INIT_FUNC_TRACE();
- priv = get_asym_session_private_data(sess, dev->driver_id);
+ priv = (struct cpt_asym_sess_misc *) sess->sess_private_data;
if (priv == NULL)
return;
/* Free resources allocated during session configure */
cpt_free_asym_session_parameters(priv);
memset(priv, 0, otx_cpt_asym_session_size_get(dev));
- sess_mp = rte_mempool_from_obj(priv);
- set_asym_session_private_data(sess, dev->driver_id, NULL);
- rte_mempool_put(sess_mp, priv);
}
static __rte_always_inline void * __rte_hot
return NULL;
}
- sess = get_asym_session_private_data(asym_op->session,
- otx_cryptodev_driver_id);
+ sess = (struct cpt_asym_sess_misc *)
+ asym_op->session->sess_private_data;
/* Store phys_addr of the mdata to meta_buf */
params.meta_buf = rte_mempool_virt2iova(mdata);
&mdata, (void **)&prep_req);
if (unlikely(ret)) {
- CPT_LOG_DP_ERR("prep cryto req : op %p, cpt_op 0x%x "
+ CPT_LOG_DP_ERR("prep crypto req : op %p, cpt_op 0x%x "
"ret 0x%x", op, (unsigned int)cpt_op, ret);
return NULL;
}
struct rte_crypto_asym_op *op = cop->asym;
struct cpt_asym_sess_misc *sess;
- sess = get_asym_session_private_data(op->session,
- otx_cryptodev_driver_id);
+ sess = (struct cpt_asym_sess_misc *) op->session->sess_private_data;
switch (sess->xfrm_type) {
case RTE_CRYPTO_ASYM_XFORM_RSA: