From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 6880F275D for ; Mon, 4 Apr 2016 19:23:35 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 04 Apr 2016 10:23:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,441,1455004800"; d="scan'208";a="78829541" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga004.fm.intel.com with ESMTP; 04 Apr 2016 10:23:33 -0700 Received: from linux.site (sisvmlab045.ir.intel.com [10.237.216.57]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u34HNWnn024635; Mon, 4 Apr 2016 18:23:32 +0100 Received: by linux.site (Postfix, from userid 11342333) id 1CB97E3BC2; Mon, 4 Apr 2016 18:14:47 +0100 (IST) From: Fiona Trahe To: dev@dpdk.org Cc: Declan.doherty@intel.com, Fiona Trahe Date: Mon, 4 Apr 2016 18:14:35 +0100 Message-Id: <1459790075-25720-1-git-send-email-fiona.trahe@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] cryptodev: renaming 2 elements for clarity X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2016 17:23:36 -0000 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 --- drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 7 ++++--- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 6 +++--- drivers/crypto/null/null_crypto_pmd.c | 4 ++-- drivers/crypto/qat/qat_crypto.c | 4 ++-- drivers/crypto/snow3g/rte_snow3g_pmd.c | 6 +++--- lib/librte_cryptodev/rte_crypto_sym.h | 6 +++--- lib/librte_cryptodev/rte_cryptodev.c | 4 ++-- lib/librte_cryptodev/rte_cryptodev.h | 2 +- 8 files changed, 20 insertions(+), 19 deletions(-) diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index 35577bc..2987ef6 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 a4b8807..3415ac1 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 82b990c..bdaf13c 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 45bb8b3..495ea1c 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 97c7fb5..f3e0e66 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 913941a..4ae9b9e 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 2d72dd7..aa4ea42 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 1427dcf..cb85c00 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -837,7 +837,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 */ -- 2.1.0