#include <rte_common.h>
#include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
-#include "rte_openssl_pmd_private.h"
+#include "openssl_pmd_private.h"
#include "compat.h"
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;
}
-/** Return the number of allocated queue pairs */
-static uint32_t
-openssl_pmd_qp_count(struct rte_cryptodev *dev)
-{
- return dev->data->nb_queue_pairs;
-}
-
/** Returns the size of the symmetric session structure */
static unsigned
openssl_pmd_sym_session_get_size(struct rte_cryptodev *dev __rte_unused)
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);
}
}
.queue_pair_setup = openssl_pmd_qp_setup,
.queue_pair_release = openssl_pmd_qp_release,
- .queue_pair_count = openssl_pmd_qp_count,
.sym_session_get_size = openssl_pmd_sym_session_get_size,
.asym_session_get_size = openssl_pmd_asym_session_get_size,