From: Slawomir Mrozowicz Date: Wed, 5 Jul 2017 05:26:15 +0000 (+0100) Subject: cryptodev: remove driver id from session X-Git-Tag: spdx-start~2651 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=70c5c3d1b2b0545692c62d1a08ce1c840808ce3b;p=dpdk.git 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 Signed-off-by: Pablo de Lara Acked-by: Declan Doherty Acked-by: Akhil Goyal --- diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst index 2bd2b26535..b79d17e85c 100644 --- a/doc/guides/rel_notes/release_17_08.rst +++ b/doc/guides/rel_notes/release_17_08.rst @@ -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.** diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index 1ef83faebd..d226c2348a 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -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; diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index 4dab8494d5..699779a3ab 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -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)) diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c index 7cce09f8de..590803a26c 100644 --- a/drivers/crypto/armv8/rte_armv8_pmd.c +++ b/drivers/crypto/armv8/rte_armv8_pmd.c @@ -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; } diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c index 37ca2ccdc9..35afa99c2f 100644 --- a/drivers/crypto/kasumi/rte_kasumi_pmd.c +++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c @@ -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; diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c index da6259206d..27cb9a2f9c 100644 --- a/drivers/crypto/null/null_crypto_pmd.c +++ b/drivers/crypto/null/null_crypto_pmd.c @@ -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; diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index d497a27eae..6f5937d26b 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -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 { diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index e2c8e430b8..d0638a253d 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -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)); diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c index 0c65b2d96d..f28b8d6817 100644 --- a/drivers/crypto/snow3g/rte_snow3g_pmd.c +++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c @@ -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; diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c index 82710d3cc8..951f1f455a 100644 --- a/drivers/crypto/zuc/rte_zuc_pmd.c +++ b/drivers/crypto/zuc/rte_zuc_pmd.c @@ -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; diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index cb773c7151..c2123cdef4 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -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); diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index d1e7c2fc7a..0fb56083bf 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -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);