From: Fiona Trahe Date: Mon, 4 Apr 2016 17:14:35 +0000 (+0100) Subject: cryptodev: rename elements for clarity X-Git-Tag: spdx-start~7060 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f0e7e2538da59caf5e64e5e5702854f925438915;p=dpdk.git cryptodev: rename elements for clarity renamed rte_cryptodev_sym_session.type -> dev_type (as it's not a session type, but a device type) renamed rte_crypto_sym_op.type -> sess_type (as it's not an op type, but a session type) Signed-off-by: Fiona Trahe --- diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index 35577bca29..2987ef6b60 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -180,8 +180,9 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp, struct rte_crypto_sym_op *op) { struct aesni_gcm_session *sess = NULL; - if (op->type == RTE_CRYPTO_SYM_OP_WITH_SESSION) { - if (unlikely(op->session->type != RTE_CRYPTODEV_AESNI_GCM_PMD)) + if (op->sess_type == RTE_CRYPTO_SYM_OP_WITH_SESSION) { + if (unlikely(op->session->dev_type + != RTE_CRYPTODEV_AESNI_GCM_PMD)) return sess; sess = (struct aesni_gcm_session *)op->session->_private; @@ -339,7 +340,7 @@ handle_completed_gcm_crypto_op(struct aesni_gcm_qp *qp, post_process_gcm_crypto_op(op); /* Free session if a session-less crypto op */ - if (op->sym->type == RTE_CRYPTO_SYM_OP_SESSIONLESS) { + if (op->sym->sess_type == RTE_CRYPTO_SYM_OP_SESSIONLESS) { rte_mempool_put(qp->sess_mp, op->sym->session); op->sym->session = NULL; } diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index a4b8807b8a..3415ac1ba6 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -299,8 +299,8 @@ get_session(struct aesni_mb_qp *qp, struct rte_crypto_op *op) { struct aesni_mb_session *sess = NULL; - if (op->sym->type == RTE_CRYPTO_SYM_OP_WITH_SESSION) { - if (unlikely(op->sym->session->type != + if (op->sym->sess_type == RTE_CRYPTO_SYM_OP_WITH_SESSION) { + if (unlikely(op->sym->session->dev_type != RTE_CRYPTODEV_AESNI_MB_PMD)) return NULL; @@ -475,7 +475,7 @@ post_process_mb_job(struct aesni_mb_qp *qp, JOB_AES_HMAC *job) } /* Free session if a session-less crypto op */ - if (op->sym->type == RTE_CRYPTO_SYM_OP_SESSIONLESS) { + if (op->sym->sess_type == RTE_CRYPTO_SYM_OP_SESSIONLESS) { rte_mempool_put(qp->sess_mp, op->sym->session); op->sym->session = NULL; } diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c index 82b990c4be..bdaf13ca56 100644 --- a/drivers/crypto/null/null_crypto_pmd.c +++ b/drivers/crypto/null/null_crypto_pmd.c @@ -114,9 +114,9 @@ get_session(struct null_crypto_qp *qp, struct rte_crypto_sym_op *op) { struct null_crypto_session *sess; - if (op->type == RTE_CRYPTO_SYM_OP_WITH_SESSION) { + if (op->sess_type == RTE_CRYPTO_SYM_OP_WITH_SESSION) { if (unlikely(op->session == NULL || - op->session->type != RTE_CRYPTODEV_NULL_PMD)) + op->session->dev_type != RTE_CRYPTODEV_NULL_PMD)) return NULL; sess = (struct null_crypto_session *)op->session->_private; diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index 45bb8b3718..495ea1c766 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -676,13 +676,13 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg) return -EINVAL; } #endif - if (unlikely(op->sym->type == RTE_CRYPTO_SYM_OP_SESSIONLESS)) { + if (unlikely(op->sym->sess_type == RTE_CRYPTO_SYM_OP_SESSIONLESS)) { PMD_DRV_LOG(ERR, "QAT PMD only supports session oriented" " requests, op (%p) is sessionless.", op); return -EINVAL; } - if (unlikely(op->sym->session->type != RTE_CRYPTODEV_QAT_SYM_PMD)) { + if (unlikely(op->sym->session->dev_type != RTE_CRYPTODEV_QAT_SYM_PMD)) { PMD_DRV_LOG(ERR, "Session was not created for this device"); return -EINVAL; } diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c index 97c7fb5137..f3e0e6673a 100644 --- a/drivers/crypto/snow3g/rte_snow3g_pmd.c +++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c @@ -162,8 +162,8 @@ snow3g_get_session(struct snow3g_qp *qp, struct rte_crypto_op *op) { struct snow3g_session *sess; - if (op->sym->type == RTE_CRYPTO_SYM_OP_WITH_SESSION) { - if (unlikely(op->sym->session->type != + if (op->sym->sess_type == RTE_CRYPTO_SYM_OP_WITH_SESSION) { + if (unlikely(op->sym->session->dev_type != RTE_CRYPTODEV_SNOW3G_PMD)) return NULL; @@ -336,7 +336,7 @@ process_ops(struct rte_crypto_op **ops, struct snow3g_session *session, if (ops[i]->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED) ops[i]->status = RTE_CRYPTO_OP_STATUS_SUCCESS; /* Free session if a session-less crypto op. */ - if (ops[i]->sym->type == RTE_CRYPTO_SYM_OP_SESSIONLESS) { + if (ops[i]->sym->sess_type == RTE_CRYPTO_SYM_OP_SESSIONLESS) { rte_mempool_put(qp->sess_mp, ops[i]->sym->session); ops[i]->sym->session = NULL; } diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h index 913941a47e..4ae9b9e831 100644 --- a/lib/librte_cryptodev/rte_crypto_sym.h +++ b/lib/librte_cryptodev/rte_crypto_sym.h @@ -369,7 +369,7 @@ struct rte_crypto_sym_op { struct rte_mbuf *m_src; /**< source mbuf */ struct rte_mbuf *m_dst; /**< destination mbuf */ - enum rte_crypto_sym_op_sess_type type; + enum rte_crypto_sym_op_sess_type sess_type; union { struct rte_cryptodev_sym_session *session; @@ -607,7 +607,7 @@ __rte_crypto_sym_op_reset(struct rte_crypto_sym_op *op) { memset(op, 0, sizeof(*op)); - op->type = RTE_CRYPTO_SYM_OP_SESSIONLESS; + op->sess_type = RTE_CRYPTO_SYM_OP_SESSIONLESS; } @@ -649,7 +649,7 @@ __rte_crypto_sym_op_attach_sym_session(struct rte_crypto_sym_op *sym_op, struct rte_cryptodev_sym_session *sess) { sym_op->session = sess; - sym_op->type = RTE_CRYPTO_SYM_OP_WITH_SESSION; + sym_op->sess_type = RTE_CRYPTO_SYM_OP_WITH_SESSION; return 0; } diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 2d72dd7ea1..aa4ea42591 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -952,7 +952,7 @@ rte_cryptodev_sym_session_init(struct rte_mempool *mp, memset(sess, 0, mp->elt_size); sess->dev_id = dev->data->dev_id; - sess->type = dev->dev_type; + sess->dev_type = dev->dev_type; sess->mp = mp; if (dev->dev_ops->session_initialize) @@ -1072,7 +1072,7 @@ 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->type != dev->dev_type) + if (sess->dev_type != dev->dev_type) return sess; /* Let device implementation clear session material */ diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index b599c9501e..568ffbb211 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -839,7 +839,7 @@ struct rte_cryptodev_sym_session { struct { uint8_t dev_id; /**< Device Id */ - enum rte_cryptodev_type type; + enum rte_cryptodev_type dev_type; /** Crypto Device type session created on */ struct rte_mempool *mp; /**< Mempool session allocated from */