if (dev->data->queue_pairs[qp_id] != NULL) {
struct openssl_qp *qp = dev->data->queue_pairs[qp_id];
- if (qp->processed_ops)
- rte_ring_free(qp->processed_ops);
+ rte_ring_free(qp->processed_ops);
rte_free(dev->data->queue_pairs[qp_id]);
dev->data->queue_pairs[qp_id] = NULL;
return 0;
qp_setup_cleanup:
- if (qp)
- rte_free(qp);
+ rte_free(qp);
return -1;
}
static int
openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
struct rte_crypto_asym_xform *xform,
- struct rte_cryptodev_asym_session *sess,
- struct rte_mempool *mempool)
+ struct rte_cryptodev_asym_session *sess)
{
void *asym_sess_private_data;
int ret;
return -EINVAL;
}
- if (rte_mempool_get(mempool, &asym_sess_private_data)) {
- CDEV_LOG_ERR(
- "Couldn't get object from session mempool");
- return -ENOMEM;
- }
-
+ asym_sess_private_data = sess->sess_private_data;
ret = openssl_set_asym_session_parameters(asym_sess_private_data,
xform);
if (ret != 0) {
OPENSSL_LOG(ERR, "failed configure session parameters");
-
- /* Return session to mempool */
- rte_mempool_put(mempool, asym_sess_private_data);
return ret;
}
- set_asym_session_private_data(sess, dev->driver_id,
- asym_sess_private_data);
-
return 0;
}
* so it doesn't leave key material behind
*/
static void
-openssl_pmd_asym_session_clear(struct rte_cryptodev *dev,
+openssl_pmd_asym_session_clear(struct rte_cryptodev *dev __rte_unused,
struct rte_cryptodev_asym_session *sess)
{
- uint8_t index = dev->driver_id;
- void *sess_priv = get_asym_session_private_data(sess, index);
+ void *sess_priv = sess->sess_private_data;
/* Zero out the whole structure */
if (sess_priv) {
openssl_reset_asym_session(sess_priv);
memset(sess_priv, 0, sizeof(struct openssl_asym_session));
- struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
- set_asym_session_private_data(sess, index, NULL);
- rte_mempool_put(sess_mp, sess_priv);
}
}