DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] cryptodev: renaming 2 elements for clarity
@ 2016-04-04 17:14 Fiona Trahe
  2016-04-06 17:07 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Trahe @ 2016-04-04 17:14 UTC (permalink / raw)
  To: dev; +Cc: Declan.doherty, Fiona Trahe

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   | 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] cryptodev: renaming 2 elements for clarity
  2016-04-04 17:14 [dpdk-dev] [PATCH] cryptodev: renaming 2 elements for clarity Fiona Trahe
@ 2016-04-06 17:07 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2016-04-06 17:07 UTC (permalink / raw)
  To: Fiona Trahe; +Cc: dev, Declan.doherty

2016-04-04 18:14, Fiona Trahe:
> 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>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-06 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-04 17:14 [dpdk-dev] [PATCH] cryptodev: renaming 2 elements for clarity Fiona Trahe
2016-04-06 17:07 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).