#include <string.h>
#include <rte_common.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
#include <rte_malloc.h>
#include "ccp_pmd_private.h"
.increment = 1 \
}, \
.digest_size = { \
- .min = 20, \
+ .min = 1, \
.max = 20, \
- .increment = 0 \
+ .increment = 1 \
}, \
.aad_size = { 0 } \
}, } \
.increment = 1 \
}, \
.digest_size = { \
- .min = 28, \
+ .min = 1, \
.max = 28, \
- .increment = 0 \
+ .increment = 1 \
}, \
.aad_size = { 0 } \
}, } \
.increment = 1 \
}, \
.digest_size = { \
- .min = 32, \
+ .min = 1, \
.max = 32, \
- .increment = 0 \
+ .increment = 1 \
}, \
.aad_size = { 0 } \
}, } \
.increment = 1 \
}, \
.digest_size = { \
- .min = 48, \
+ .min = 1, \
.max = 48, \
- .increment = 0 \
+ .increment = 1 \
}, \
.aad_size = { 0 } \
}, } \
.increment = 1 \
}, \
.digest_size = { \
- .min = 64, \
+ .min = 1, \
.max = 64, \
- .increment = 0 \
+ .increment = 1 \
}, \
.aad_size = { 0 } \
}, } \
.increment = 1 \
}, \
.digest_size = { \
- .min = 64, \
+ .min = 1, \
.max = 64, \
- .increment = 0 \
+ .increment = 1 \
}, \
.aad_size = { 0 } \
}, } \
.increment = 1 \
}, \
.digest_size = { \
- .min = 16, \
+ .min = 1, \
.max = 16, \
- .increment = 0 \
+ .increment = 1 \
}, \
.aad_size = { 0 } \
}, } \
static int
ccp_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
const struct rte_cryptodev_qp_conf *qp_conf,
- int socket_id, struct rte_mempool *session_pool)
+ int socket_id)
{
struct ccp_private *internals = dev->data->dev_private;
struct ccp_qp *qp;
goto qp_setup_cleanup;
}
- qp->sess_mp = session_pool;
+ qp->sess_mp = qp_conf->mp_session;
+ qp->sess_mp_priv = qp_conf->mp_session_private;
/* mempool for batch info */
qp->batch_mp = rte_mempool_create(
qp_setup_cleanup:
dev->data->queue_pairs[qp_id] = NULL;
- if (qp)
- rte_free(qp);
+ rte_free(qp);
return -1;
}
-static int
-ccp_pmd_qp_start(struct rte_cryptodev *dev __rte_unused,
- uint16_t queue_pair_id __rte_unused)
-{
- return -ENOTSUP;
-}
-
-static int
-ccp_pmd_qp_stop(struct rte_cryptodev *dev __rte_unused,
- uint16_t queue_pair_id __rte_unused)
-{
- return -ENOTSUP;
-}
-
-static uint32_t
-ccp_pmd_qp_count(struct rte_cryptodev *dev)
-{
- return dev->data->nb_queue_pairs;
-}
-
static unsigned
-ccp_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
+ccp_pmd_sym_session_get_size(struct rte_cryptodev *dev __rte_unused)
{
return sizeof(struct ccp_session);
}
static int
-ccp_pmd_session_configure(struct rte_cryptodev *dev,
+ccp_pmd_sym_session_configure(struct rte_cryptodev *dev,
struct rte_crypto_sym_xform *xform,
struct rte_cryptodev_sym_session *sess,
struct rte_mempool *mempool)
rte_mempool_put(mempool, sess_private_data);
return ret;
}
- set_session_private_data(sess, dev->driver_id,
+ set_sym_session_private_data(sess, dev->driver_id,
sess_private_data);
return 0;
}
static void
-ccp_pmd_session_clear(struct rte_cryptodev *dev,
+ccp_pmd_sym_session_clear(struct rte_cryptodev *dev,
struct rte_cryptodev_sym_session *sess)
{
uint8_t index = dev->driver_id;
- void *sess_priv = get_session_private_data(sess, index);
+ void *sess_priv = get_sym_session_private_data(sess, index);
if (sess_priv) {
struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
rte_mempool_put(sess_mp, sess_priv);
memset(sess_priv, 0, sizeof(struct ccp_session));
- set_session_private_data(sess, index, NULL);
+ set_sym_session_private_data(sess, index, NULL);
}
}
.queue_pair_setup = ccp_pmd_qp_setup,
.queue_pair_release = ccp_pmd_qp_release,
- .queue_pair_start = ccp_pmd_qp_start,
- .queue_pair_stop = ccp_pmd_qp_stop,
- .queue_pair_count = ccp_pmd_qp_count,
- .session_get_size = ccp_pmd_session_get_size,
- .session_configure = ccp_pmd_session_configure,
- .session_clear = ccp_pmd_session_clear,
+ .sym_session_get_size = ccp_pmd_sym_session_get_size,
+ .sym_session_configure = ccp_pmd_sym_session_configure,
+ .sym_session_clear = ccp_pmd_sym_session_clear,
};
struct rte_cryptodev_ops *ccp_pmd_ops = &ccp_ops;