cryptodev: remove driver id from session
Since crypto session will not be attached to a specific device or driver, the field driver_id is not required anymore (only used to check that a session was being handled by the right device). Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
This commit is contained in:
parent
7854308047
commit
70c5c3d1b2
@ -114,6 +114,7 @@ New Features
|
||||
been reorganized as follows:
|
||||
|
||||
* ``dev_id`` field has been removed.
|
||||
* ``driver_id`` field has been removed.
|
||||
|
||||
* **Updated cryptodev library.**
|
||||
|
||||
|
@ -155,10 +155,6 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp, struct rte_crypto_op *op)
|
||||
struct rte_crypto_sym_op *sym_op = op->sym;
|
||||
|
||||
if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
|
||||
if (unlikely(sym_op->session->driver_id !=
|
||||
cryptodev_driver_id))
|
||||
return sess;
|
||||
|
||||
sess = (struct aesni_gcm_session *)sym_op->session->_private;
|
||||
} else {
|
||||
void *_sess;
|
||||
|
@ -354,14 +354,9 @@ get_session(struct aesni_mb_qp *qp, struct rte_crypto_op *op)
|
||||
{
|
||||
struct aesni_mb_session *sess = NULL;
|
||||
|
||||
if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
|
||||
if (unlikely(op->sym->session->driver_id !=
|
||||
cryptodev_driver_id)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
|
||||
sess = (struct aesni_mb_session *)op->sym->session->_private;
|
||||
} else {
|
||||
else {
|
||||
void *_sess = NULL;
|
||||
|
||||
if (rte_mempool_get(qp->sess_mp, (void **)&_sess))
|
||||
|
@ -555,9 +555,7 @@ get_session(struct armv8_crypto_qp *qp, struct rte_crypto_op *op)
|
||||
|
||||
if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
|
||||
/* get existing session */
|
||||
if (likely(op->sym->session != NULL &&
|
||||
op->sym->session->driver_id ==
|
||||
cryptodev_driver_id)) {
|
||||
if (likely(op->sym->session != NULL)) {
|
||||
sess = (struct armv8_crypto_session *)
|
||||
op->sym->session->_private;
|
||||
}
|
||||
|
@ -166,10 +166,6 @@ kasumi_get_session(struct kasumi_qp *qp, struct rte_crypto_op *op)
|
||||
struct kasumi_session *sess;
|
||||
|
||||
if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
|
||||
if (unlikely(op->sym->session->driver_id !=
|
||||
cryptodev_driver_id))
|
||||
return NULL;
|
||||
|
||||
sess = (struct kasumi_session *)op->sym->session->_private;
|
||||
} else {
|
||||
struct rte_cryptodev_sym_session *c_sess = NULL;
|
||||
|
@ -98,9 +98,7 @@ get_session(struct null_crypto_qp *qp, struct rte_crypto_op *op)
|
||||
struct rte_crypto_sym_op *sym_op = op->sym;
|
||||
|
||||
if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
|
||||
if (unlikely(sym_op->session == NULL ||
|
||||
sym_op->session->driver_id !=
|
||||
cryptodev_driver_id))
|
||||
if (unlikely(sym_op->session == NULL))
|
||||
return NULL;
|
||||
|
||||
sess = (struct null_crypto_session *)sym_op->session->_private;
|
||||
|
@ -558,9 +558,7 @@ get_session(struct openssl_qp *qp, struct rte_crypto_op *op)
|
||||
|
||||
if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
|
||||
/* get existing session */
|
||||
if (likely(op->sym->session != NULL &&
|
||||
op->sym->session->driver_id ==
|
||||
cryptodev_driver_id))
|
||||
if (likely(op->sym->session != NULL))
|
||||
sess = (struct openssl_session *)
|
||||
op->sym->session->_private;
|
||||
} else {
|
||||
|
@ -1072,12 +1072,6 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (unlikely(op->sym->session->driver_id !=
|
||||
cryptodev_qat_driver_id)) {
|
||||
PMD_DRV_LOG(ERR, "Session was not created for this device");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ctx = (struct qat_session *)op->sym->session->_private;
|
||||
qat_req = (struct icp_qat_fw_la_bulk_req *)out_msg;
|
||||
rte_mov128((uint8_t *)qat_req, (const uint8_t *)&(ctx->fw_req));
|
||||
|
@ -166,10 +166,6 @@ snow3g_get_session(struct snow3g_qp *qp, struct rte_crypto_op *op)
|
||||
struct snow3g_session *sess;
|
||||
|
||||
if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
|
||||
if (unlikely(op->sym->session->driver_id !=
|
||||
cryptodev_driver_id))
|
||||
return NULL;
|
||||
|
||||
sess = (struct snow3g_session *)op->sym->session->_private;
|
||||
} else {
|
||||
struct rte_cryptodev_sym_session *c_sess = NULL;
|
||||
|
@ -165,10 +165,6 @@ zuc_get_session(struct zuc_qp *qp, struct rte_crypto_op *op)
|
||||
struct zuc_session *sess;
|
||||
|
||||
if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
|
||||
if (unlikely(op->sym->session->driver_id !=
|
||||
cryptodev_driver_id))
|
||||
return NULL;
|
||||
|
||||
sess = (struct zuc_session *)op->sym->session->_private;
|
||||
} else {
|
||||
struct rte_cryptodev_sym_session *c_sess = NULL;
|
||||
|
@ -1087,7 +1087,6 @@ rte_cryptodev_sym_session_init(struct rte_mempool *mp,
|
||||
{
|
||||
memset(sess, 0, mp->elt_size);
|
||||
|
||||
sess->driver_id = dev->driver_id;
|
||||
sess->mp = mp;
|
||||
|
||||
if (dev->dev_ops->session_initialize)
|
||||
@ -1194,10 +1193,6 @@ rte_cryptodev_sym_session_free(uint8_t dev_id,
|
||||
|
||||
dev = &rte_crypto_devices[dev_id];
|
||||
|
||||
/* Check the session belongs to this device type */
|
||||
if (sess->driver_id != dev->driver_id)
|
||||
return sess;
|
||||
|
||||
/* Let device implementation clear session material */
|
||||
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->session_clear, sess);
|
||||
dev->dev_ops->session_clear(dev, (void *)sess->_private);
|
||||
|
@ -884,8 +884,6 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
|
||||
struct rte_cryptodev_sym_session {
|
||||
RTE_STD_C11
|
||||
struct {
|
||||
uint8_t driver_id;
|
||||
/** Crypto driver identifier session created on */
|
||||
struct rte_mempool *mp;
|
||||
/**< Mempool session allocated from */
|
||||
} __rte_aligned(8);
|
||||
|
Loading…
x
Reference in New Issue
Block a user