DPDK patches and discussions
 help / color / mirror / Atom feed
From: Fiona Trahe <fiona.trahe@intel.com>
To: dev@dpdk.org, pablo.de.lara.guarch@intel.com
Cc: fiona.trahe@intel.com, tomaszx.jozwiak@intel.com
Subject: [dpdk-dev] [PATCH 27/30] crypto/qat: cleanups
Date: Fri,  6 Apr 2018 19:52:09 +0100	[thread overview]
Message-ID: <1523040732-3290-28-git-send-email-fiona.trahe@intel.com> (raw)
In-Reply-To: <1523040732-3290-1-git-send-email-fiona.trahe@intel.com>

 - renamed sgl_cookie to cookie
 - renamed qp_gen_config to qat_gen_config as it is intended
   to hold more than just qp data.
 - removed unused macro - ALIGN_POW2
 - moved 64_BYTE_ALIGN to qat_common.h
 - removed crypto reference in common debug msg
 - free cookie pool on qp creation error

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
---
 drivers/crypto/qat/qat_common.c  |  2 +-
 drivers/crypto/qat/qat_common.h  |  2 ++
 drivers/crypto/qat/qat_device.c  |  2 +-
 drivers/crypto/qat/qat_device.h  |  2 +-
 drivers/crypto/qat/qat_qp.c      |  3 +++
 drivers/crypto/qat/qat_sym.h     |  8 --------
 drivers/crypto/qat/qat_sym_pmd.c | 14 +++++++-------
 7 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/drivers/crypto/qat/qat_common.c b/drivers/crypto/qat/qat_common.c
index 5d6779757..c10c1421a 100644
--- a/drivers/crypto/qat/qat_common.c
+++ b/drivers/crypto/qat/qat_common.c
@@ -103,5 +103,5 @@ void qat_stats_reset(struct qat_pci_device *dev,
 		memset(&(qp[i]->stats), 0, sizeof(qp[i]->stats));
 	}
 
-	PMD_DRV_LOG(DEBUG, "QAT crypto: %d stats cleared", service);
+	PMD_DRV_LOG(DEBUG, "QAT: %d stats cleared", service);
 }
diff --git a/drivers/crypto/qat/qat_common.h b/drivers/crypto/qat/qat_common.h
index 8ecebe954..db85d5482 100644
--- a/drivers/crypto/qat/qat_common.h
+++ b/drivers/crypto/qat/qat_common.h
@@ -15,6 +15,8 @@
  */
 #define QAT_SGL_MAX_NUMBER	16
 
+#define QAT_64_BTYE_ALIGN_MASK (~0x3f)
+
 /* Intel(R) QuickAssist Technology device generation is enumerated
  * from one according to the generation of the device
  */
diff --git a/drivers/crypto/qat/qat_device.c b/drivers/crypto/qat/qat_device.c
index d1e103efd..27f08874e 100644
--- a/drivers/crypto/qat/qat_device.c
+++ b/drivers/crypto/qat/qat_device.c
@@ -10,7 +10,7 @@
 
 /* Hardware device information per generation */
 __extension__
-struct qat_gen_hw_data qp_gen_config[] =  {
+struct qat_gen_hw_data qat_gen_config[] =  {
 	[QAT_GEN1] = {
 		.dev_gen = QAT_GEN1,
 		.qp_hw_data = qat_gen1_qps,
diff --git a/drivers/crypto/qat/qat_device.h b/drivers/crypto/qat/qat_device.h
index fd20a0147..4201a1c71 100644
--- a/drivers/crypto/qat/qat_device.h
+++ b/drivers/crypto/qat/qat_device.h
@@ -62,7 +62,7 @@ struct qat_gen_hw_data {
 	const struct qat_qp_hw_data (*qp_hw_data)[ADF_MAX_QPS_ON_ANY_SERVICE];
 };
 
-extern struct qat_gen_hw_data qp_gen_config[];
+extern struct qat_gen_hw_data qat_gen_config[];
 
 struct qat_pci_device *
 qat_pci_device_allocate(struct rte_pci_device *pci_dev);
diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index 8fbdf85b8..06ffac47b 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -266,6 +266,9 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 	return 0;
 
 create_err:
+	if (qp->op_cookie_pool)
+		rte_mempool_free(qp->op_cookie_pool);
+	rte_free(qp->op_cookies);
 	rte_free(qp);
 	return -EFAULT;
 }
diff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h
index d887dc126..bdb672be4 100644
--- a/drivers/crypto/qat/qat_sym.h
+++ b/drivers/crypto/qat/qat_sym.h
@@ -9,14 +9,6 @@
 
 #include "qat_common.h"
 
-/*
- * This macro rounds up a number to a be a multiple of
- * the alignment when the alignment is a power of 2
- */
-#define ALIGN_POW2_ROUNDUP(num, align) \
-	(((num) + (align) - 1) & ~((align) - 1))
-#define QAT_64_BTYE_ALIGN_MASK (~0x3f)
-
 struct qat_sym_session;
 
 struct qat_sym_op_cookie {
diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c
index aa71b4641..e6760b8f8 100644
--- a/drivers/crypto/qat/qat_sym_pmd.c
+++ b/drivers/crypto/qat/qat_sym_pmd.c
@@ -68,7 +68,7 @@ static void qat_sym_dev_info_get(struct rte_cryptodev *dev,
 {
 	struct qat_sym_dev_private *internals = dev->data->dev_private;
 	const struct qat_qp_hw_data *sym_hw_qps =
-		qp_gen_config[internals->qat_dev->qat_dev_gen]
+		qat_gen_config[internals->qat_dev->qat_dev_gen]
 			      .qp_hw_data[QAT_SERVICE_SYMMETRIC];
 
 	PMD_INIT_FUNC_TRACE();
@@ -143,7 +143,7 @@ static int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 			(struct qat_qp **)&(dev->data->queue_pairs[qp_id]);
 	struct qat_sym_dev_private *qat_private = dev->data->dev_private;
 	const struct qat_qp_hw_data *sym_hw_qps =
-			qp_gen_config[qat_private->qat_dev->qat_dev_gen]
+			qat_gen_config[qat_private->qat_dev->qat_dev_gen]
 				      .qp_hw_data[QAT_SERVICE_SYMMETRIC];
 	const struct qat_qp_hw_data *qp_hw_data = sym_hw_qps + qp_id;
 
@@ -178,16 +178,16 @@ static int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	for (i = 0; i < qp->nb_descriptors; i++) {
 
-		struct qat_sym_op_cookie *sql_cookie =
+		struct qat_sym_op_cookie *cookie =
 				qp->op_cookies[i];
 
-		sql_cookie->qat_sgl_src_phys_addr =
-				rte_mempool_virt2iova(sql_cookie) +
+		cookie->qat_sgl_src_phys_addr =
+				rte_mempool_virt2iova(cookie) +
 				offsetof(struct qat_sym_op_cookie,
 				qat_sgl_src);
 
-		sql_cookie->qat_sgl_dst_phys_addr =
-				rte_mempool_virt2iova(sql_cookie) +
+		cookie->qat_sgl_dst_phys_addr =
+				rte_mempool_virt2iova(cookie) +
 				offsetof(struct qat_sym_op_cookie,
 				qat_sgl_dst);
 	}
-- 
2.13.6

  parent reply	other threads:[~2018-04-06 18:52 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06 18:51 [dpdk-dev] [PATCH 00/30] crypto/qat: refactor to support multiple service Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 01/30] crypto/qat: use SPDX license Fiona Trahe
2018-04-18  8:03   ` De Lara Guarch, Pablo
2018-04-06 18:51 ` [dpdk-dev] [PATCH 02/30] crypto/qat: add qat common header Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 03/30] crypto/qat: add qat device files Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 04/30] crypto/qat: remove unused includes Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 05/30] crypto/qat: add symmetric session file Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 06/30] crypto/qat: change filename crypto to sym Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 07/30] crypto/qat: rename fns for consistency Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 08/30] crypto/qat: renamed sym-specific structs Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 09/30] crypto/qat: make enqueue function generic Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 10/30] crypto/qat: make dequeue " Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 11/30] crypto/qat: move generic qp fn to qp file Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 12/30] crypto/qat: separate sym-specific from generic qp setup Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 13/30] crypto/qat: move sym-specific qp code to sym file Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 14/30] crypto/qat: remove dependencies on cryptodev from common Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 15/30] crypto/qat: move defines from sym to qp header file Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 16/30] crypto/qat: create data structures to support different generations Fiona Trahe
2018-04-06 18:51 ` [dpdk-dev] [PATCH 17/30] crypto/qat: rename sgl related objects Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 18/30] crypto/qat: move sgl related element to appropriate files Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 19/30] crypto/qat: add QAT PCI device struct Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 20/30] crypto/qat: separate the name used for PCI reg from crypto name Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 21/30] crypto/qat: move to using new device structure Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 22/30] crypto/qat: use common stats structures Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 23/30] crypto/qat: rename functions which depend on cryptodev Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 24/30] crypto/qat: move code into appropriate files Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 25/30] crypto/qat: add lock around csr access and change logic Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 26/30] crypto/qat: remove incorrect usage of bundle number Fiona Trahe
2018-04-06 18:52 ` Fiona Trahe [this message]
2018-04-06 18:52 ` [dpdk-dev] [PATCH 28/30] crypto/qat: create appropriately named device for registration Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 29/30] crypto/qat: add MAX PCI DEVICES flag to config file Fiona Trahe
2018-04-06 18:52 ` [dpdk-dev] [PATCH 30/30] crypto/qat: add performance improvement into qat crypto dev Fiona Trahe
2018-04-11 12:41 ` [dpdk-dev] [PATCH 00/30] crypto/qat: refactor to support multiple service De Lara Guarch, Pablo
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 00/31] crypto/qat: refactor to support multiple Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 01/31] crypto/qat: add qat common header Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 02/31] crypto/qat: add qat device files Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 03/31] crypto/qat: remove unused includes Fiona Trahe
2018-06-11 22:20   ` De Lara Guarch, Pablo
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 04/31] crypto/qat: add symmetric session file Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 05/31] crypto/qat: change filename crypto to sym Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 06/31] crypto/qat: rename fns for consistency Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 07/31] crypto/qat: renamed sym-specific structs Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 08/31] crypto/qat: make enqueue function generic Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 09/31] crypto/qat: make dequeue " Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 10/31] crypto/qat: move generic qp fn to qp file Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 11/31] crypto/qat: separate sym-specific from generic qp setup Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 12/31] crypto/qat: move sym-specific qp code to sym file Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 13/31] crypto/qat: remove dependencies on cryptodev from common Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 14/31] crypto/qat: move defines from sym to qp header file Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 15/31] crypto/qat: create data structures to support different generations Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 16/31] crypto/qat: rename sgl related objects Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 17/31] crypto/qat: move sgl related element to appropriate files Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 18/31] crypto/qat: add QAT PCI device struct Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 19/31] crypto/qat: separate the name used for PCI reg from crypto name Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 20/31] crypto/qat: move to using new device structure Fiona Trahe
2018-05-11 11:13 ` [dpdk-dev] [PATCH v2 21/31] crypto/qat: use common stats structures Fiona Trahe
2018-05-11 11:14 ` [dpdk-dev] [PATCH v2 22/31] crypto/qat: rename functions which depend on cryptodev Fiona Trahe
2018-05-11 11:14 ` [dpdk-dev] [PATCH v2 23/31] crypto/qat: move code into appropriate files Fiona Trahe
2018-05-11 11:14 ` [dpdk-dev] [PATCH v2 24/31] crypto/qat: add lock around csr access and change logic Fiona Trahe
2018-05-11 11:14 ` [dpdk-dev] [PATCH v2 25/31] crypto/qat: remove incorrect usage of bundle number Fiona Trahe
2018-05-11 11:14 ` [dpdk-dev] [PATCH v2 26/31] crypto/qat: cleanups Fiona Trahe
2018-06-11 22:21   ` De Lara Guarch, Pablo
2018-05-11 11:14 ` [dpdk-dev] [PATCH v2 27/31] crypto/qat: create appropriately named device for registration Fiona Trahe
2018-05-11 11:14 ` [dpdk-dev] [PATCH v2 28/31] crypto/qat: add MAX PCI DEVICES flag to config file Fiona Trahe
2018-05-11 11:14 ` [dpdk-dev] [PATCH v2 29/31] crypto/qat: add performance improvement into qat crypto dev Fiona Trahe
2018-06-11 22:23   ` De Lara Guarch, Pablo
2018-05-11 11:14 ` [dpdk-dev] [PATCH v2 30/31] doc/qat: specify QAT driver and device name formats Fiona Trahe
2018-05-14 15:38   ` Kovacevic, Marko
2018-05-11 11:14 ` [dpdk-dev] [PATCH v2 31/31] crypto/qat: remove CONFIG_RTE_QAT_PMD_MAX_NB_SESSIONS Fiona Trahe
2018-06-13 12:13 ` [dpdk-dev] [PATCH v3 00/38] crypto/qat: refactor to support multiple services Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 01/38] crypto/qat: add qat common header Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 02/38] crypto/qat: add qat device files Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 03/38] crypto/qat: remove unused includes Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 04/38] crypto/qat: add symmetric session file Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 05/38] crypto/qat: change filename crypto to sym Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 06/38] crypto/qat: rename fns for consistency Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 07/38] crypto/qat: renamed sym-specific structs Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 08/38] crypto/qat: make enqueue function generic Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 09/38] crypto/qat: make dequeue " Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 10/38] crypto/qat: move generic qp fn to qp file Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 11/38] crypto/qat: separate sym-specific from generic qp setup Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 12/38] crypto/qat: move sym-specific qp code to sym file Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 13/38] crypto/qat: remove dependencies on cryptodev from common Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 14/38] crypto/qat: move defines from sym to qp header file Tomasz Jozwiak
2018-06-13 12:13   ` [dpdk-dev] [PATCH v3 15/38] crypto/qat: create structures to support various generations Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 16/38] crypto/qat: rename sgl related objects Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 17/38] crypto/qat: move sgl related element to appropriate files Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 18/38] crypto/qat: add QAT PCI device struct Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 19/38] crypto/qat: use generic driver name for PCI registration Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 20/38] crypto/qat: move to using new device structure Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 21/38] crypto/qat: use common stats structures Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 22/38] crypto/qat: rename functions which depend on cryptodev Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 23/38] crypto/qat: move code into appropriate files Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 24/38] crypto/qat: add lock around csr access and change logic Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 25/38] crypto/qat: remove incorrect usage of bundle number Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 26/38] crypto/qat: rename variables Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 27/38] crypto/qat: modify debug message Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 28/38] crypto/qat: free cookie pool on queue creation error Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 29/38] crypto/qat: remove unused macro Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 30/38] crypto/qat: move macro to common file Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 31/38] crypto/qat: register appropriately named device Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 32/38] crypto/qat: add max PCI devices to config file Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 33/38] crypto/qat: optimize adf modulo function Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 34/38] crypto/qat: remove unused arguments Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 35/38] crypto/qat: make response process function inline Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 36/38] crypto/qat: check for service type Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 37/38] doc/qat: specify QAT driver and device name formats Tomasz Jozwiak
2018-06-13 12:14   ` [dpdk-dev] [PATCH v3 38/38] crypto/qat: remove configurable max number of sessions Tomasz Jozwiak
2018-06-14 10:59   ` [dpdk-dev] [PATCH v3 00/38] crypto/qat: refactor to support multiple services De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1523040732-3290-28-git-send-email-fiona.trahe@intel.com \
    --to=fiona.trahe@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=tomaszx.jozwiak@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).