cryptodev: rename elements for clarity
authorFiona Trahe <fiona.trahe@intel.com>
Mon, 4 Apr 2016 17:14:35 +0000 (18:14 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 6 Apr 2016 17:00:57 +0000 (19:00 +0200)
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 <fiona.trahe@intel.com>
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
drivers/crypto/null/null_crypto_pmd.c
drivers/crypto/qat/qat_crypto.c
drivers/crypto/snow3g/rte_snow3g_pmd.c
lib/librte_cryptodev/rte_crypto_sym.h
lib/librte_cryptodev/rte_cryptodev.c
lib/librte_cryptodev/rte_cryptodev.h

index 35577bc..2987ef6 100644 (file)
@@ -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;
        }
index a4b8807..3415ac1 100644 (file)
@@ -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;
        }
index 82b990c..bdaf13c 100644 (file)
@@ -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;
index 45bb8b3..495ea1c 100644 (file)
@@ -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;
        }
index 97c7fb5..f3e0e66 100644 (file)
@@ -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;
                }
index 913941a..4ae9b9e 100644 (file)
@@ -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;
 }
index 2d72dd7..aa4ea42 100644 (file)
@@ -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 */
index b599c95..568ffbb 100644 (file)
@@ -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 */