DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/5] crypto/qat: move to dynamic logging
@ 2018-05-11 11:31 Fiona Trahe
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 1/5] crypto/qat: cleanup unused and useless trace Fiona Trahe
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Fiona Trahe @ 2018-05-11 11:31 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch, fiona.trahe, tomaszx.jozwiak

Note this patchset is targeting 18.08 release
and depends on the qat refactoring patchset:
http://dpdk.org/ml/archives/dev/2018-May/101306.html
 

Move to dynamic logging and cleanup trace.

Fiona Trahe (2):
  crypto/qat: rename log macro for non-dp logs
  doc/qat: document debug options

Tomasz Jozwiak (3):
  crypto/qat: cleanup unused and useless trace
  crypto/qat: move to dynamic logging for non-dp trace
  crypto/qat: move to dynamic logging for data-path trace

 config/common_base                   |    4 -
 doc/guides/cryptodevs/qat.rst        |   26 +++++++++
 drivers/crypto/qat/Makefile          |    1 +
 drivers/crypto/qat/meson.build       |    1 +
 drivers/crypto/qat/qat_common.c      |   12 ++--
 drivers/crypto/qat/qat_device.c      |   12 ++--
 drivers/crypto/qat/qat_logs.c        |   41 +++++++++++++
 drivers/crypto/qat/qat_logs.h        |   65 ++++++++-------------
 drivers/crypto/qat/qat_qp.c          |   63 +++++++++------------
 drivers/crypto/qat/qat_sym.c         |   65 ++++++++++-----------
 drivers/crypto/qat/qat_sym.h         |   30 +++++-----
 drivers/crypto/qat/qat_sym_pmd.c     |   21 +++----
 drivers/crypto/qat/qat_sym_session.c |  103 +++++++++++++++------------------
 13 files changed, 235 insertions(+), 209 deletions(-)
 create mode 100644 drivers/crypto/qat/qat_logs.c

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

* [dpdk-dev] [PATCH 1/5] crypto/qat: cleanup unused and useless trace
  2018-05-11 11:31 [dpdk-dev] [PATCH 0/5] crypto/qat: move to dynamic logging Fiona Trahe
@ 2018-05-11 11:31 ` Fiona Trahe
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 2/5] crypto/qat: move to dynamic logging for non-dp trace Fiona Trahe
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Fiona Trahe @ 2018-05-11 11:31 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch, fiona.trahe, tomaszx.jozwiak

From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>

Removed INIT_FUNC trace and other unused macros.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 config/common_base                   |    1 -
 drivers/crypto/qat/qat_logs.h        |   31 -------------------------------
 drivers/crypto/qat/qat_qp.c          |   11 +----------
 drivers/crypto/qat/qat_sym_pmd.c     |    7 +------
 drivers/crypto/qat/qat_sym_session.c |    9 ---------
 5 files changed, 2 insertions(+), 57 deletions(-)

diff --git a/config/common_base b/config/common_base
index 5c114fa..970cbb0 100644
--- a/config/common_base
+++ b/config/common_base
@@ -482,7 +482,6 @@ CONFIG_RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS=2048
 # Compile PMD for QuickAssist based devices
 #
 CONFIG_RTE_LIBRTE_PMD_QAT=n
-CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_INIT=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_DRIVER=n
diff --git a/drivers/crypto/qat/qat_logs.h b/drivers/crypto/qat/qat_logs.h
index c9144bf..e6f8a01 100644
--- a/drivers/crypto/qat/qat_logs.h
+++ b/drivers/crypto/qat/qat_logs.h
@@ -5,37 +5,6 @@
 #ifndef _QAT_LOGS_H_
 #define _QAT_LOGS_H_
 
-#define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, \
-		"PMD: %s(): " fmt "\n", __func__, ##args)
-
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_INIT
-#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
-#else
-#define PMD_INIT_FUNC_TRACE() do { } while (0)
-#endif
-
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
-#endif
-
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
-#endif
-
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX_FREE
-#define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-#else
-#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
-#endif
-
 #ifdef RTE_LIBRTE_PMD_QAT_DEBUG_DRIVER
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index f9d3762..531752b 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -120,7 +120,6 @@ int qat_qps_per_service(const struct qat_qp_hw_data *qp_hw_data,
 {
 	const struct rte_memzone *mz;
 
-	PMD_INIT_FUNC_TRACE();
 	mz = rte_memzone_lookup(queue_name);
 	if (mz != 0) {
 		if (((size_t)queue_size <= mz->len) &&
@@ -194,7 +193,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 
 	if (qat_queue_create(qat_dev, &(qp->tx_q), qat_qp_conf,
 					ADF_RING_DIR_TX) != 0) {
-		PMD_INIT_LOG(ERR, "Tx queue create failed "
+		PMD_DRV_LOG(ERR, "Tx queue create failed "
 				"queue_pair_id=%u", queue_pair_id);
 		goto create_err;
 	}
@@ -261,7 +260,6 @@ int qat_qp_release(struct qat_qp **qp_addr)
 	struct qat_qp *qp = *qp_addr;
 	uint32_t i;
 
-	PMD_INIT_FUNC_TRACE();
 	if (qp == NULL) {
 		PMD_DRV_LOG(DEBUG, "qp already freed");
 		return 0;
@@ -418,7 +416,6 @@ static void qat_queue_delete(struct qat_queue *queue)
 static int qat_qp_check_queue_alignment(uint64_t phys_addr,
 					uint32_t queue_size_bytes)
 {
-	PMD_INIT_FUNC_TRACE();
 	if (((queue_size_bytes - 1) & phys_addr) != 0)
 		return -EINVAL;
 	return 0;
@@ -429,7 +426,6 @@ static int adf_verify_queue_size(uint32_t msg_size, uint32_t msg_num,
 {
 	uint8_t i = ADF_MIN_RING_SIZE;
 
-	PMD_INIT_FUNC_TRACE();
 	for (; i <= ADF_MAX_RING_SIZE; i++)
 		if ((msg_size * msg_num) ==
 				(uint32_t)ADF_SIZE_TO_RING_SIZE_IN_BYTES(i)) {
@@ -448,8 +444,6 @@ static void adf_queue_arb_enable(struct qat_queue *txq, void *base_addr,
 							txq->hw_bundle_number);
 	uint32_t value;
 
-	PMD_INIT_FUNC_TRACE();
-
 	rte_spinlock_lock(lock);
 	value = ADF_CSR_RD(base_addr, arb_csr_offset);
 	value |= (0x01 << txq->hw_queue_number);
@@ -465,8 +459,6 @@ static void adf_queue_arb_disable(struct qat_queue *txq, void *base_addr,
 							txq->hw_bundle_number);
 	uint32_t value;
 
-	PMD_INIT_FUNC_TRACE();
-
 	rte_spinlock_lock(lock);
 	value = ADF_CSR_RD(base_addr, arb_csr_offset);
 	value &= ~(0x01 << txq->hw_queue_number);
@@ -479,7 +471,6 @@ static void adf_configure_queues(struct qat_qp *qp)
 	uint32_t queue_config;
 	struct qat_queue *queue = &qp->tx_q;
 
-	PMD_INIT_FUNC_TRACE();
 	queue_config = BUILD_RING_CONFIG(queue->queue_size);
 
 	WRITE_CSR_RING_CONFIG(qp->mmap_bar_addr, queue->hw_bundle_number,
diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c
index c94a8a1..8797c0e 100644
--- a/drivers/crypto/qat/qat_sym_pmd.c
+++ b/drivers/crypto/qat/qat_sym_pmd.c
@@ -33,27 +33,23 @@ static int qat_sym_qp_release(struct rte_cryptodev *dev,
 static int qat_sym_dev_config(__rte_unused struct rte_cryptodev *dev,
 		__rte_unused struct rte_cryptodev_config *config)
 {
-	PMD_INIT_FUNC_TRACE();
 	return 0;
 }
 
 static int qat_sym_dev_start(__rte_unused struct rte_cryptodev *dev)
 {
-	PMD_INIT_FUNC_TRACE();
 	return 0;
 }
 
 static void qat_sym_dev_stop(__rte_unused struct rte_cryptodev *dev)
 {
-	PMD_INIT_FUNC_TRACE();
+	return;
 }
 
 static int qat_sym_dev_close(struct rte_cryptodev *dev)
 {
 	int i, ret;
 
-	PMD_INIT_FUNC_TRACE();
-
 	for (i = 0; i < dev->data->nb_queue_pairs; i++) {
 		ret = qat_sym_qp_release(dev, i);
 		if (ret < 0)
@@ -71,7 +67,6 @@ static void qat_sym_dev_info_get(struct rte_cryptodev *dev,
 		qat_gen_config[internals->qat_dev->qat_dev_gen]
 			      .qp_hw_data[QAT_SERVICE_SYMMETRIC];
 
-	PMD_INIT_FUNC_TRACE();
 	if (info != NULL) {
 		info->max_nb_queue_pairs =
 			qat_qps_per_service(sym_hw_qps, QAT_SERVICE_SYMMETRIC);
diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 689596d..83d0fb1 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -111,7 +111,6 @@
 qat_sym_session_clear(struct rte_cryptodev *dev,
 		struct rte_cryptodev_sym_session *sess)
 {
-	PMD_INIT_FUNC_TRACE();
 	uint8_t index = dev->driver_id;
 	void *sess_priv = get_session_private_data(sess, index);
 	struct qat_sym_session *s = (struct qat_sym_session *)sess_priv;
@@ -411,8 +410,6 @@
 	int ret;
 	int qat_cmd_id;
 
-	PMD_INIT_FUNC_TRACE();
-
 	/* Set context descriptor physical address */
 	session->cd_paddr = rte_mempool_virt2iova(session) +
 			offsetof(struct qat_sym_session, cd);
@@ -936,7 +933,6 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,
 	uint64_t *hash_state_out_be64;
 	int i;
 
-	PMD_INIT_FUNC_TRACE();
 	digest_size = qat_hash_get_digest_size(hash_alg);
 	if (digest_size <= 0)
 		return -EFAULT;
@@ -1006,7 +1002,6 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 	uint8_t opad[qat_hash_get_block_size(ICP_QAT_HW_AUTH_ALGO_DELIMITER)];
 	int i;
 
-	PMD_INIT_FUNC_TRACE();
 	if (hash_alg == ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC) {
 		static uint8_t qat_aes_xcbc_key_seed[
 					ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ] = {
@@ -1129,7 +1124,6 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 qat_sym_session_init_common_hdr(struct icp_qat_fw_comn_req_hdr *header,
 		enum qat_sym_proto_flag proto_flags)
 {
-	PMD_INIT_FUNC_TRACE();
 	header->hdr_flags =
 		ICP_QAT_FW_COMN_HDR_FLAGS_BUILD(ICP_QAT_FW_COMN_REQ_FLAG_SET);
 	header->service_type = ICP_QAT_FW_COMN_REQ_CPM_FW_LA;
@@ -1212,7 +1206,6 @@ int qat_sym_session_aead_create_cd_cipher(struct qat_sym_session *cdesc,
 	uint16_t cipher_offset, cd_size;
 	uint32_t wordIndex  = 0;
 	uint32_t *temp_key = NULL;
-	PMD_INIT_FUNC_TRACE();
 
 	if (cdesc->qat_cmd == ICP_QAT_FW_LA_CMD_CIPHER) {
 		cd_pars->u.s.content_desc_addr = cdesc->cd_paddr;
@@ -1369,8 +1362,6 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	enum qat_sym_proto_flag qat_proto_flag =
 		QAT_CRYPTO_PROTO_FLAG_NONE;
 
-	PMD_INIT_FUNC_TRACE();
-
 	if (cdesc->qat_cmd == ICP_QAT_FW_LA_CMD_AUTH) {
 		ICP_QAT_FW_COMN_CURR_ID_SET(hash_cd_ctrl,
 					ICP_QAT_FW_SLICE_AUTH);
-- 
1.7.0.7

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

* [dpdk-dev] [PATCH 2/5] crypto/qat: move to dynamic logging for non-dp trace
  2018-05-11 11:31 [dpdk-dev] [PATCH 0/5] crypto/qat: move to dynamic logging Fiona Trahe
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 1/5] crypto/qat: cleanup unused and useless trace Fiona Trahe
@ 2018-05-11 11:31 ` Fiona Trahe
  2018-06-12 15:54   ` De Lara Guarch, Pablo
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 3/5] crypto/qat: rename log macro for non-dp logs Fiona Trahe
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Fiona Trahe @ 2018-05-11 11:31 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch, fiona.trahe, tomaszx.jozwiak

From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>

For all trace not on the data-path move to dynamic logging.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 config/common_base             |    1 -
 drivers/crypto/qat/Makefile    |    1 +
 drivers/crypto/qat/meson.build |    1 +
 drivers/crypto/qat/qat_logs.c  |   18 ++++++++++++++++++
 drivers/crypto/qat/qat_logs.h  |   12 ++++--------
 5 files changed, 24 insertions(+), 9 deletions(-)
 create mode 100644 drivers/crypto/qat/qat_logs.c

diff --git a/config/common_base b/config/common_base
index 970cbb0..e15ebac 100644
--- a/config/common_base
+++ b/config/common_base
@@ -484,7 +484,6 @@ CONFIG_RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS=2048
 CONFIG_RTE_LIBRTE_PMD_QAT=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_RX=n
-CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_DRIVER=n
 #
 # Max. number of QuickAssist devices, which can be detected and attached
 #
diff --git a/drivers/crypto/qat/Makefile b/drivers/crypto/qat/Makefile
index d467683..ef4a567 100644
--- a/drivers/crypto/qat/Makefile
+++ b/drivers/crypto/qat/Makefile
@@ -26,6 +26,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_device.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_qp.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_sym_session.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_common.c
+SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_logs.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_sym_pmd.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_asym_pmd.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_comp_pmd.c
diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build
index e22e08f..bcab16e 100644
--- a/drivers/crypto/qat/meson.build
+++ b/drivers/crypto/qat/meson.build
@@ -8,6 +8,7 @@ endif
 sources = files('qat_common.c',
 		'qat_qp.c',
 		'qat_device.c',
+		'qat_logs.c',
 		'qat_sym_pmd.c', 'qat_sym.c', 'qat_sym_session.c',
 		'qat_asym_pmd.c',
 		'qat_comp_pmd.c')
diff --git a/drivers/crypto/qat/qat_logs.c b/drivers/crypto/qat/qat_logs.c
new file mode 100644
index 0000000..c5ee539
--- /dev/null
+++ b/drivers/crypto/qat/qat_logs.c
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include <rte_log.h>
+
+int qat_gen_logtype;
+
+static void
+qat_pci_init_log(void)
+{
+	/* Non-data-path logging for pci device and all services */
+	qat_gen_logtype = rte_log_register("pmd.qat_general");
+	if (qat_gen_logtype >= 0)
+		rte_log_set_level(qat_gen_logtype, RTE_LOG_NOTICE);
+}
+
+RTE_INIT(qat_pci_init_log);
diff --git a/drivers/crypto/qat/qat_logs.h b/drivers/crypto/qat/qat_logs.h
index e6f8a01..b00a06b 100644
--- a/drivers/crypto/qat/qat_logs.h
+++ b/drivers/crypto/qat/qat_logs.h
@@ -5,14 +5,10 @@
 #ifndef _QAT_LOGS_H_
 #define _QAT_LOGS_H_
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_DRIVER
-#define PMD_DRV_LOG_RAW(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
-#else
-#define PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0)
-#endif
+extern int qat_gen_logtype;
 
-#define PMD_DRV_LOG(level, fmt, args...) \
-	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+#define PMD_DRV_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, qat_gen_logtype,		\
+			"%s(): " fmt "\n", __func__, ## args)
 
 #endif /* _QAT_LOGS_H_ */
-- 
1.7.0.7

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

* [dpdk-dev] [PATCH 3/5] crypto/qat: rename log macro for non-dp logs
  2018-05-11 11:31 [dpdk-dev] [PATCH 0/5] crypto/qat: move to dynamic logging Fiona Trahe
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 1/5] crypto/qat: cleanup unused and useless trace Fiona Trahe
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 2/5] crypto/qat: move to dynamic logging for non-dp trace Fiona Trahe
@ 2018-05-11 11:31 ` Fiona Trahe
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 4/5] crypto/qat: move to dynamic logging for data-path trace Fiona Trahe
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Fiona Trahe @ 2018-05-11 11:31 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch, fiona.trahe, tomaszx.jozwiak

Rename PMD_DRV_LOG to the more appropriate name QAT_LOG.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 drivers/crypto/qat/qat_common.c      |   12 ++--
 drivers/crypto/qat/qat_device.c      |   12 ++--
 drivers/crypto/qat/qat_logs.h        |    2 +-
 drivers/crypto/qat/qat_qp.c          |   54 ++++++++++----------
 drivers/crypto/qat/qat_sym.c         |   18 +++---
 drivers/crypto/qat/qat_sym.h         |    2 +-
 drivers/crypto/qat/qat_sym_pmd.c     |   14 +++---
 drivers/crypto/qat/qat_sym_session.c |   94 +++++++++++++++++-----------------
 8 files changed, 104 insertions(+), 104 deletions(-)

diff --git a/drivers/crypto/qat/qat_common.c b/drivers/crypto/qat/qat_common.c
index c10c142..c206d3b 100644
--- a/drivers/crypto/qat/qat_common.c
+++ b/drivers/crypto/qat/qat_common.c
@@ -28,7 +28,7 @@
 	buf = buf->next;
 	while (buf) {
 		if (unlikely(nr == QAT_SGL_MAX_NUMBER)) {
-			PMD_DRV_LOG(ERR,
+			QAT_LOG(ERR,
 				"QAT PMD exceeded size of QAT SGL entry(%u)",
 					QAT_SGL_MAX_NUMBER);
 			return -EINVAL;
@@ -61,7 +61,7 @@ void qat_stats_get(struct qat_pci_device *dev,
 	struct qat_qp **qp;
 
 	if (stats == NULL || dev == NULL || service >= QAT_SERVICE_INVALID) {
-		PMD_DRV_LOG(ERR, "invalid param: stats %p, dev %p, service %d",
+		QAT_LOG(ERR, "invalid param: stats %p, dev %p, service %d",
 				stats, dev, service);
 		return;
 	}
@@ -69,7 +69,7 @@ void qat_stats_get(struct qat_pci_device *dev,
 	qp = dev->qps_in_use[service];
 	for (i = 0; i < ADF_MAX_QPS_ON_ANY_SERVICE; i++) {
 		if (qp[i] == NULL) {
-			PMD_DRV_LOG(DEBUG, "Service %d Uninitialised qp %d",
+			QAT_LOG(DEBUG, "Service %d Uninitialised qp %d",
 					service, i);
 			continue;
 		}
@@ -88,7 +88,7 @@ void qat_stats_reset(struct qat_pci_device *dev,
 	struct qat_qp **qp;
 
 	if (dev == NULL || service >= QAT_SERVICE_INVALID) {
-		PMD_DRV_LOG(ERR, "invalid param: dev %p, service %d",
+		QAT_LOG(ERR, "invalid param: dev %p, service %d",
 				dev, service);
 		return;
 	}
@@ -96,12 +96,12 @@ void qat_stats_reset(struct qat_pci_device *dev,
 	qp = dev->qps_in_use[service];
 	for (i = 0; i < ADF_MAX_QPS_ON_ANY_SERVICE; i++) {
 		if (qp[i] == NULL) {
-			PMD_DRV_LOG(DEBUG, "Service %d Uninitialised qp %d",
+			QAT_LOG(DEBUG, "Service %d Uninitialised qp %d",
 					service, i);
 			continue;
 		}
 		memset(&(qp[i]->stats), 0, sizeof(qp[i]->stats));
 	}
 
-	PMD_DRV_LOG(DEBUG, "QAT: %d stats cleared", service);
+	QAT_LOG(DEBUG, "QAT: %d stats cleared", service);
 }
diff --git a/drivers/crypto/qat/qat_device.c b/drivers/crypto/qat/qat_device.c
index 0cab2e9..4b97c84 100644
--- a/drivers/crypto/qat/qat_device.c
+++ b/drivers/crypto/qat/qat_device.c
@@ -105,14 +105,14 @@ struct qat_pci_device *
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
 	snprintf(name+strlen(name), QAT_DEV_NAME_MAX_LEN-strlen(name), "_qat");
 	if (qat_pci_get_named_dev(name) != NULL) {
-		PMD_DRV_LOG(ERR, "QAT device with name %s already allocated!",
+		QAT_LOG(ERR, "QAT device with name %s already allocated!",
 				name);
 		return NULL;
 	}
 
 	qat_dev_id = qat_pci_find_free_device_index();
 	if (qat_dev_id == RTE_PMD_QAT_MAX_PCI_DEVICES) {
-		PMD_DRV_LOG(ERR, "Reached maximum number of QAT devices");
+		QAT_LOG(ERR, "Reached maximum number of QAT devices");
 		return NULL;
 	}
 
@@ -131,7 +131,7 @@ struct qat_pci_device *
 		qat_dev->qat_dev_gen = QAT_GEN2;
 		break;
 	default:
-		PMD_DRV_LOG(ERR, "Invalid dev_id, can't determine generation");
+		QAT_LOG(ERR, "Invalid dev_id, can't determine generation");
 		return NULL;
 	}
 
@@ -141,7 +141,7 @@ struct qat_pci_device *
 
 	qat_nb_pci_devices++;
 
-	PMD_DRV_LOG(DEBUG, "QAT device %d allocated, name %s, total QATs %d",
+	QAT_LOG(DEBUG, "QAT device %d allocated, name %s, total QATs %d",
 			qat_dev->qat_dev_id, qat_dev->name, qat_nb_pci_devices);
 
 	return qat_dev;
@@ -168,7 +168,7 @@ struct qat_pci_device *
 		qat_dev->attached = QAT_DETACHED;
 		qat_nb_pci_devices--;
 	}
-	PMD_DRV_LOG(DEBUG, "QAT device %s released, total QATs %d",
+	QAT_LOG(DEBUG, "QAT device %s released, total QATs %d",
 				name, qat_nb_pci_devices);
 	return 0;
 }
@@ -189,7 +189,7 @@ static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	int ret = 0;
 	struct qat_pci_device *qat_pci_dev;
 
-	PMD_DRV_LOG(DEBUG, "Found QAT device at %02x:%02x.%x",
+	QAT_LOG(DEBUG, "Found QAT device at %02x:%02x.%x",
 			pci_dev->addr.bus,
 			pci_dev->addr.devid,
 			pci_dev->addr.function);
diff --git a/drivers/crypto/qat/qat_logs.h b/drivers/crypto/qat/qat_logs.h
index b00a06b..b12f754 100644
--- a/drivers/crypto/qat/qat_logs.h
+++ b/drivers/crypto/qat/qat_logs.h
@@ -7,7 +7,7 @@
 
 extern int qat_gen_logtype;
 
-#define PMD_DRV_LOG(level, fmt, args...)			\
+#define QAT_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, qat_gen_logtype,		\
 			"%s(): " fmt "\n", __func__, ## args)
 
diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index 531752b..32c1759 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -125,12 +125,12 @@ int qat_qps_per_service(const struct qat_qp_hw_data *qp_hw_data,
 		if (((size_t)queue_size <= mz->len) &&
 				((socket_id == SOCKET_ID_ANY) ||
 					(socket_id == mz->socket_id))) {
-			PMD_DRV_LOG(DEBUG, "re-use memzone already "
+			QAT_LOG(DEBUG, "re-use memzone already "
 					"allocated for %s", queue_name);
 			return mz;
 		}
 
-		PMD_DRV_LOG(ERR, "Incompatible memzone already "
+		QAT_LOG(ERR, "Incompatible memzone already "
 				"allocated %s, size %u, socket %d. "
 				"Requested size %u, socket %u",
 				queue_name, (uint32_t)mz->len,
@@ -138,7 +138,7 @@ int qat_qps_per_service(const struct qat_qp_hw_data *qp_hw_data,
 		return NULL;
 	}
 
-	PMD_DRV_LOG(DEBUG, "Allocate memzone for %s, size %u on socket %u",
+	QAT_LOG(DEBUG, "Allocate memzone for %s, size %u on socket %u",
 					queue_name, queue_size, socket_id);
 	return rte_memzone_reserve_aligned(queue_name, queue_size,
 		socket_id, RTE_MEMZONE_IOVA_CONTIG, queue_size);
@@ -155,18 +155,18 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 	char op_cookie_pool_name[RTE_RING_NAMESIZE];
 	uint32_t i;
 
-	PMD_DRV_LOG(DEBUG, "Setup qp %u on qat pci device %d gen %d",
+	QAT_LOG(DEBUG, "Setup qp %u on qat pci device %d gen %d",
 		queue_pair_id, qat_dev->qat_dev_id, qat_dev->qat_dev_gen);
 
 	if ((qat_qp_conf->nb_descriptors > ADF_MAX_DESC) ||
 		(qat_qp_conf->nb_descriptors < ADF_MIN_DESC)) {
-		PMD_DRV_LOG(ERR, "Can't create qp for %u descriptors",
+		QAT_LOG(ERR, "Can't create qp for %u descriptors",
 				qat_qp_conf->nb_descriptors);
 		return -EINVAL;
 	}
 
 	if (pci_dev->mem_resource[0].addr == NULL) {
-		PMD_DRV_LOG(ERR, "Could not find VF config space "
+		QAT_LOG(ERR, "Could not find VF config space "
 				"(UIO driver attached?).");
 		return -EINVAL;
 	}
@@ -175,7 +175,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 	qp = rte_zmalloc("qat PMD qp metadata",
 			sizeof(*qp), RTE_CACHE_LINE_SIZE);
 	if (qp == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to alloc mem for qp struct");
+		QAT_LOG(ERR, "Failed to alloc mem for qp struct");
 		return -ENOMEM;
 	}
 	qp->nb_descriptors = qat_qp_conf->nb_descriptors;
@@ -183,7 +183,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 			qat_qp_conf->nb_descriptors * sizeof(*qp->op_cookies),
 			RTE_CACHE_LINE_SIZE);
 	if (qp->op_cookies == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to alloc mem for cookie");
+		QAT_LOG(ERR, "Failed to alloc mem for cookie");
 		rte_free(qp);
 		return -ENOMEM;
 	}
@@ -193,14 +193,14 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 
 	if (qat_queue_create(qat_dev, &(qp->tx_q), qat_qp_conf,
 					ADF_RING_DIR_TX) != 0) {
-		PMD_DRV_LOG(ERR, "Tx queue create failed "
+		QAT_LOG(ERR, "Tx queue create failed "
 				"queue_pair_id=%u", queue_pair_id);
 		goto create_err;
 	}
 
 	if (qat_queue_create(qat_dev, &(qp->rx_q), qat_qp_conf,
 					ADF_RING_DIR_RX) != 0) {
-		PMD_DRV_LOG(ERR, "Rx queue create failed "
+		QAT_LOG(ERR, "Rx queue create failed "
 				"queue_pair_id=%hu", queue_pair_id);
 		qat_queue_delete(&(qp->tx_q));
 		goto create_err;
@@ -215,7 +215,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 		pci_dev->driver->driver.name, qat_dev->qat_dev_id,
 		qat_qp_conf->service_str, queue_pair_id);
 
-	PMD_DRV_LOG(DEBUG, "cookiepool: %s", op_cookie_pool_name);
+	QAT_LOG(DEBUG, "cookiepool: %s", op_cookie_pool_name);
 	qp->op_cookie_pool = rte_mempool_lookup(op_cookie_pool_name);
 	if (qp->op_cookie_pool == NULL)
 		qp->op_cookie_pool = rte_mempool_create(op_cookie_pool_name,
@@ -224,14 +224,14 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 				NULL, NULL, NULL, NULL, qat_qp_conf->socket_id,
 				0);
 	if (!qp->op_cookie_pool) {
-		PMD_DRV_LOG(ERR, "QAT PMD Cannot create"
+		QAT_LOG(ERR, "QAT PMD Cannot create"
 				" op mempool");
 		goto create_err;
 	}
 
 	for (i = 0; i < qp->nb_descriptors; i++) {
 		if (rte_mempool_get(qp->op_cookie_pool, &qp->op_cookies[i])) {
-			PMD_DRV_LOG(ERR, "QAT PMD Cannot get op_cookie");
+			QAT_LOG(ERR, "QAT PMD Cannot get op_cookie");
 			goto create_err;
 		}
 	}
@@ -241,7 +241,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 	qp->service_type = qat_qp_conf->hw->service_type;
 	qp->qat_dev = qat_dev;
 
-	PMD_DRV_LOG(DEBUG, "QP setup complete: id: %d, cookiepool: %s",
+	QAT_LOG(DEBUG, "QP setup complete: id: %d, cookiepool: %s",
 			queue_pair_id, op_cookie_pool_name);
 
 	*qp_addr = qp;
@@ -261,11 +261,11 @@ int qat_qp_release(struct qat_qp **qp_addr)
 	uint32_t i;
 
 	if (qp == NULL) {
-		PMD_DRV_LOG(DEBUG, "qp already freed");
+		QAT_LOG(DEBUG, "qp already freed");
 		return 0;
 	}
 
-	PMD_DRV_LOG(DEBUG, "Free qp on qat_pci device %d",
+	QAT_LOG(DEBUG, "Free qp on qat_pci device %d",
 				qp->qat_dev->qat_dev_id);
 
 	/* Don't free memory if there are still responses to be processed */
@@ -298,10 +298,10 @@ static void qat_queue_delete(struct qat_queue *queue)
 	int status = 0;
 
 	if (queue == NULL) {
-		PMD_DRV_LOG(DEBUG, "Invalid queue");
+		QAT_LOG(DEBUG, "Invalid queue");
 		return;
 	}
-	PMD_DRV_LOG(DEBUG, "Free ring %d, memzone: %s",
+	QAT_LOG(DEBUG, "Free ring %d, memzone: %s",
 			queue->hw_queue_number, queue->memz_name);
 
 	mz = rte_memzone_lookup(queue->memz_name);
@@ -310,10 +310,10 @@ static void qat_queue_delete(struct qat_queue *queue)
 		memset(queue->base_addr, 0x7F, queue->queue_size);
 		status = rte_memzone_free(mz);
 		if (status != 0)
-			PMD_DRV_LOG(ERR, "Error %d on freeing queue %s",
+			QAT_LOG(ERR, "Error %d on freeing queue %s",
 					status, queue->memz_name);
 	} else {
-		PMD_DRV_LOG(DEBUG, "queue %s doesn't exist",
+		QAT_LOG(DEBUG, "queue %s doesn't exist",
 				queue->memz_name);
 	}
 }
@@ -336,7 +336,7 @@ static void qat_queue_delete(struct qat_queue *queue)
 			qp_conf->hw->tx_ring_num : qp_conf->hw->rx_ring_num);
 
 	if (desc_size > ADF_MSG_SIZE_TO_BYTES(ADF_MAX_MSG_SIZE)) {
-		PMD_DRV_LOG(ERR, "Invalid descriptor size %d", desc_size);
+		QAT_LOG(ERR, "Invalid descriptor size %d", desc_size);
 		return -EINVAL;
 	}
 
@@ -351,7 +351,7 @@ static void qat_queue_delete(struct qat_queue *queue)
 	qp_mz = queue_dma_zone_reserve(queue->memz_name, queue_size_bytes,
 			qp_conf->socket_id);
 	if (qp_mz == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to allocate ring memzone");
+		QAT_LOG(ERR, "Failed to allocate ring memzone");
 		return -ENOMEM;
 	}
 
@@ -359,7 +359,7 @@ static void qat_queue_delete(struct qat_queue *queue)
 	queue->base_phys_addr = qp_mz->iova;
 	if (qat_qp_check_queue_alignment(queue->base_phys_addr,
 			queue_size_bytes)) {
-		PMD_DRV_LOG(ERR, "Invalid alignment on queue create "
+		QAT_LOG(ERR, "Invalid alignment on queue create "
 					" 0x%"PRIx64"\n",
 					queue->base_phys_addr);
 		ret = -EFAULT;
@@ -368,7 +368,7 @@ static void qat_queue_delete(struct qat_queue *queue)
 
 	if (adf_verify_queue_size(desc_size, qp_conf->nb_descriptors,
 			&(queue->queue_size)) != 0) {
-		PMD_DRV_LOG(ERR, "Invalid num inflights");
+		QAT_LOG(ERR, "Invalid num inflights");
 		ret = -EINVAL;
 		goto queue_create_err;
 	}
@@ -378,7 +378,7 @@ static void qat_queue_delete(struct qat_queue *queue)
 	queue->modulo_mask = (1 << ADF_RING_SIZE_MODULO(queue->queue_size)) - 1;
 
 	if (queue->max_inflights < 2) {
-		PMD_DRV_LOG(ERR, "Invalid num inflights");
+		QAT_LOG(ERR, "Invalid num inflights");
 		ret = -EINVAL;
 		goto queue_create_err;
 	}
@@ -399,7 +399,7 @@ static void qat_queue_delete(struct qat_queue *queue)
 	WRITE_CSR_RING_BASE(io_addr, queue->hw_bundle_number,
 			queue->hw_queue_number, queue_base);
 
-	PMD_DRV_LOG(DEBUG, "RING: Name:%s, size in CSR: %u, in bytes %u,"
+	QAT_LOG(DEBUG, "RING: Name:%s, size in CSR: %u, in bytes %u,"
 		" nb msgs %u, msg_size %u, max_inflights %u modulo mask %u",
 			queue->memz_name,
 			queue->queue_size, queue_size_bytes,
@@ -432,7 +432,7 @@ static int adf_verify_queue_size(uint32_t msg_size, uint32_t msg_num,
 			*p_queue_size_for_csr = i;
 			return 0;
 		}
-	PMD_DRV_LOG(ERR, "Invalid ring size %d", msg_size * msg_num);
+	QAT_LOG(ERR, "Invalid ring size %d", msg_size * msg_num);
 	return -EINVAL;
 }
 
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 887d4eb..7bedad3 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -39,7 +39,7 @@
 	return 0;
 
 cipher_decrypt_err:
-	PMD_DRV_LOG(ERR, "libcrypto ECB cipher decrypt for BPI IV failed");
+	QAT_LOG(ERR, "libcrypto ECB cipher decrypt for BPI IV failed");
 	return -EINVAL;
 }
 
@@ -165,14 +165,14 @@
 
 #ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
 	if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
-		PMD_DRV_LOG(ERR, "QAT PMD only supports symmetric crypto "
+		QAT_LOG(ERR, "QAT PMD only supports symmetric crypto "
 				"operation requests, op (%p) is not a "
 				"symmetric operation.", op);
 		return -EINVAL;
 	}
 #endif
 	if (unlikely(op->sess_type == RTE_CRYPTO_OP_SESSIONLESS)) {
-		PMD_DRV_LOG(ERR, "QAT PMD only supports session oriented"
+		QAT_LOG(ERR, "QAT PMD only supports session oriented"
 				" requests, op (%p) is sessionless.", op);
 		return -EINVAL;
 	}
@@ -181,12 +181,12 @@
 			op->sym->session, cryptodev_qat_driver_id);
 
 	if (unlikely(ctx == NULL)) {
-		PMD_DRV_LOG(ERR, "Session was not created for this device");
+		QAT_LOG(ERR, "Session was not created for this device");
 		return -EINVAL;
 	}
 
 	if (unlikely(ctx->min_qat_dev_gen > qat_dev_gen)) {
-		PMD_DRV_LOG(ERR, "Session alg not supported on this device gen");
+		QAT_LOG(ERR, "Session alg not supported on this device gen");
 		op->status = RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
 		return -EINVAL;
 	}
@@ -231,7 +231,7 @@
 				(cipher_param->cipher_length % BYTE_LENGTH != 0)
 				 || (cipher_param->cipher_offset
 							% BYTE_LENGTH != 0))) {
-				PMD_DRV_LOG(ERR,
+				QAT_LOG(ERR,
 		  "SNOW3G/KASUMI/ZUC in QAT PMD only supports byte aligned values");
 				op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 				return -EINVAL;
@@ -265,7 +265,7 @@
 				ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3) {
 			if (unlikely((auth_param->auth_off % BYTE_LENGTH != 0)
 				|| (auth_param->auth_len % BYTE_LENGTH != 0))) {
-				PMD_DRV_LOG(ERR,
+				QAT_LOG(ERR,
 		"For SNOW3G/KASUMI/ZUC, QAT PMD only supports byte aligned values");
 				op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 				return -EINVAL;
@@ -501,7 +501,7 @@
 				&cookie->qat_sgl_src,
 				qat_req->comn_mid.src_length);
 		if (ret) {
-			PMD_DRV_LOG(ERR, "QAT PMD Cannot fill sgl array");
+			QAT_LOG(ERR, "QAT PMD Cannot fill sgl array");
 			return ret;
 		}
 
@@ -516,7 +516,7 @@
 						qat_req->comn_mid.dst_length);
 
 			if (ret) {
-				PMD_DRV_LOG(ERR, "QAT PMD Cannot "
+				QAT_LOG(ERR, "QAT PMD Cannot "
 						"fill sgl array");
 				return ret;
 			}
diff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h
index ddd0f47..b693a4d 100644
--- a/drivers/crypto/qat/qat_sym.h
+++ b/drivers/crypto/qat/qat_sym.h
@@ -59,7 +59,7 @@ struct qat_sym_op_cookie {
 	return 0;
 
 cipher_encrypt_err:
-	PMD_DRV_LOG(ERR, "libcrypto ECB cipher encrypt failed");
+	QAT_LOG(ERR, "libcrypto ECB cipher encrypt failed");
 	return -EINVAL;
 }
 
diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c
index 8797c0e..1156390 100644
--- a/drivers/crypto/qat/qat_sym_pmd.c
+++ b/drivers/crypto/qat/qat_sym_pmd.c
@@ -85,7 +85,7 @@ static void qat_sym_stats_get(struct rte_cryptodev *dev,
 	struct qat_sym_dev_private *qat_priv;
 
 	if (stats == NULL || dev == NULL) {
-		PMD_DRV_LOG(ERR, "invalid ptr: stats %p, dev %p", stats, dev);
+		QAT_LOG(ERR, "invalid ptr: stats %p, dev %p", stats, dev);
 		return;
 	}
 	qat_priv = dev->data->dev_private;
@@ -102,7 +102,7 @@ static void qat_sym_stats_reset(struct rte_cryptodev *dev)
 	struct qat_sym_dev_private *qat_priv;
 
 	if (dev == NULL) {
-		PMD_DRV_LOG(ERR, "invalid cryptodev ptr %p", dev);
+		QAT_LOG(ERR, "invalid cryptodev ptr %p", dev);
 		return;
 	}
 	qat_priv = dev->data->dev_private;
@@ -115,7 +115,7 @@ static int qat_sym_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)
 {
 	struct qat_sym_dev_private *qat_private = dev->data->dev_private;
 
-	PMD_DRV_LOG(DEBUG, "Release sym qp %u on device %d",
+	QAT_LOG(DEBUG, "Release sym qp %u on device %d",
 				queue_pair_id, dev->data->dev_id);
 
 	qat_private->qat_dev->qps_in_use[QAT_SERVICE_SYMMETRIC][queue_pair_id]
@@ -149,7 +149,7 @@ static int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 			return ret;
 	}
 	if (qp_id >= qat_qps_per_service(sym_hw_qps, QAT_SERVICE_SYMMETRIC)) {
-		PMD_DRV_LOG(ERR, "qp_id %u invalid for this device", qp_id);
+		QAT_LOG(ERR, "qp_id %u invalid for this device", qp_id);
 		return -EINVAL;
 	}
 
@@ -253,7 +253,7 @@ static int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, "%s_%s",
 			qat_pci_dev->name, "sym");
-	PMD_DRV_LOG(DEBUG, "Creating QAT SYM device %s", name);
+	QAT_LOG(DEBUG, "Creating QAT SYM device %s", name);
 
 	/* Populate subset device to use in cryptodev device creation */
 	qat_pci_dev->sym_rte_dev.driver = &cryptodev_qat_sym_driver;
@@ -293,13 +293,13 @@ static int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		break;
 	default:
 		internals->qat_dev_capabilities = qat_gen2_sym_capabilities;
-		PMD_DRV_LOG(DEBUG,
+		QAT_LOG(DEBUG,
 			"QAT gen %d capabilities unknown, default to GEN2",
 					qat_pci_dev->qat_dev_gen);
 		break;
 	}
 
-	PMD_DRV_LOG(DEBUG, "Created QAT SYM device %s as cryptodev instance %d",
+	QAT_LOG(DEBUG, "Created QAT SYM device %s as cryptodev instance %d",
 			cryptodev->data->name, internals->sym_dev_id);
 	return 0;
 }
diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 83d0fb1..dc1c200 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -217,7 +217,7 @@
 	case RTE_CRYPTO_CIPHER_AES_CBC:
 		if (qat_sym_validate_aes_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES cipher key size");
+			QAT_LOG(ERR, "Invalid AES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -226,7 +226,7 @@
 	case RTE_CRYPTO_CIPHER_AES_CTR:
 		if (qat_sym_validate_aes_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES cipher key size");
+			QAT_LOG(ERR, "Invalid AES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -235,7 +235,7 @@
 	case RTE_CRYPTO_CIPHER_SNOW3G_UEA2:
 		if (qat_sym_validate_snow3g_key(cipher_xform->key.length,
 					&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid SNOW 3G cipher key size");
+			QAT_LOG(ERR, "Invalid SNOW 3G cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -247,7 +247,7 @@
 	case RTE_CRYPTO_CIPHER_KASUMI_F8:
 		if (qat_sym_validate_kasumi_key(cipher_xform->key.length,
 					&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid KASUMI cipher key size");
+			QAT_LOG(ERR, "Invalid KASUMI cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -256,7 +256,7 @@
 	case RTE_CRYPTO_CIPHER_3DES_CBC:
 		if (qat_sym_validate_3des_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid 3DES cipher key size");
+			QAT_LOG(ERR, "Invalid 3DES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -265,7 +265,7 @@
 	case RTE_CRYPTO_CIPHER_DES_CBC:
 		if (qat_sym_validate_des_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid DES cipher key size");
+			QAT_LOG(ERR, "Invalid DES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -274,7 +274,7 @@
 	case RTE_CRYPTO_CIPHER_3DES_CTR:
 		if (qat_sym_validate_3des_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid 3DES cipher key size");
+			QAT_LOG(ERR, "Invalid 3DES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -287,12 +287,12 @@
 					cipher_xform->key.data,
 					&session->bpi_ctx);
 		if (ret != 0) {
-			PMD_DRV_LOG(ERR, "failed to create DES BPI ctx");
+			QAT_LOG(ERR, "failed to create DES BPI ctx");
 			goto error_out;
 		}
 		if (qat_sym_validate_des_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid DES cipher key size");
+			QAT_LOG(ERR, "Invalid DES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -305,12 +305,12 @@
 					cipher_xform->key.data,
 					&session->bpi_ctx);
 		if (ret != 0) {
-			PMD_DRV_LOG(ERR, "failed to create AES BPI ctx");
+			QAT_LOG(ERR, "failed to create AES BPI ctx");
 			goto error_out;
 		}
 		if (qat_sym_validate_aes_docsisbpi_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES DOCSISBPI key size");
+			QAT_LOG(ERR, "Invalid AES DOCSISBPI key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -319,7 +319,7 @@
 	case RTE_CRYPTO_CIPHER_ZUC_EEA3:
 		if (!qat_is_cipher_alg_supported(
 			cipher_xform->algo, internals)) {
-			PMD_DRV_LOG(ERR, "%s not supported on this device",
+			QAT_LOG(ERR, "%s not supported on this device",
 				rte_crypto_cipher_algorithm_strings
 					[cipher_xform->algo]);
 			ret = -ENOTSUP;
@@ -327,7 +327,7 @@
 		}
 		if (qat_sym_validate_zuc_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid ZUC cipher key size");
+			QAT_LOG(ERR, "Invalid ZUC cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -338,12 +338,12 @@
 	case RTE_CRYPTO_CIPHER_AES_F8:
 	case RTE_CRYPTO_CIPHER_AES_XTS:
 	case RTE_CRYPTO_CIPHER_ARC4:
-		PMD_DRV_LOG(ERR, "Crypto QAT PMD: Unsupported Cipher alg %u",
+		QAT_LOG(ERR, "Crypto QAT PMD: Unsupported Cipher alg %u",
 				cipher_xform->algo);
 		ret = -ENOTSUP;
 		goto error_out;
 	default:
-		PMD_DRV_LOG(ERR, "Crypto: Undefined Cipher specified %u\n",
+		QAT_LOG(ERR, "Crypto: Undefined Cipher specified %u\n",
 				cipher_xform->algo);
 		ret = -EINVAL;
 		goto error_out;
@@ -388,7 +388,7 @@
 
 	ret = qat_sym_session_set_parameters(dev, xform, sess_private_data);
 	if (ret != 0) {
-		PMD_DRV_LOG(ERR,
+		QAT_LOG(ERR,
 		    "Crypto QAT PMD: failed to configure session parameters");
 
 		/* Return session to mempool */
@@ -419,7 +419,7 @@
 	/* Get requested QAT command id */
 	qat_cmd_id = qat_get_cmd_id(xform);
 	if (qat_cmd_id < 0 || qat_cmd_id >= ICP_QAT_FW_LA_CMD_DELIMITER) {
-		PMD_DRV_LOG(ERR, "Unsupported xform chain requested");
+		QAT_LOG(ERR, "Unsupported xform chain requested");
 		return -ENOTSUP;
 	}
 	session->qat_cmd = (enum icp_qat_fw_la_cmd_id)qat_cmd_id;
@@ -477,11 +477,11 @@
 	case ICP_QAT_FW_LA_CMD_AUTH_PRE_COMP:
 	case ICP_QAT_FW_LA_CMD_CIPHER_PRE_COMP:
 	case ICP_QAT_FW_LA_CMD_DELIMITER:
-	PMD_DRV_LOG(ERR, "Unsupported Service %u",
+	QAT_LOG(ERR, "Unsupported Service %u",
 		session->qat_cmd);
 		return -ENOTSUP;
 	default:
-	PMD_DRV_LOG(ERR, "Unsupported Service %u",
+	QAT_LOG(ERR, "Unsupported Service %u",
 		session->qat_cmd);
 		return -ENOTSUP;
 	}
@@ -521,7 +521,7 @@
 	case RTE_CRYPTO_AUTH_AES_GMAC:
 		if (qat_sym_validate_aes_key(auth_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES key size");
+			QAT_LOG(ERR, "Invalid AES key size");
 			return -EINVAL;
 		}
 		session->qat_mode = ICP_QAT_HW_CIPHER_CTR_MODE;
@@ -542,7 +542,7 @@
 		break;
 	case RTE_CRYPTO_AUTH_ZUC_EIA3:
 		if (!qat_is_auth_alg_supported(auth_xform->algo, internals)) {
-			PMD_DRV_LOG(ERR, "%s not supported on this device",
+			QAT_LOG(ERR, "%s not supported on this device",
 				rte_crypto_auth_algorithm_strings
 				[auth_xform->algo]);
 			return -ENOTSUP;
@@ -557,11 +557,11 @@
 	case RTE_CRYPTO_AUTH_MD5:
 	case RTE_CRYPTO_AUTH_AES_CMAC:
 	case RTE_CRYPTO_AUTH_AES_CBC_MAC:
-		PMD_DRV_LOG(ERR, "Crypto: Unsupported hash alg %u",
+		QAT_LOG(ERR, "Crypto: Unsupported hash alg %u",
 				auth_xform->algo);
 		return -ENOTSUP;
 	default:
-		PMD_DRV_LOG(ERR, "Crypto: Undefined Hash algo %u specified",
+		QAT_LOG(ERR, "Crypto: Undefined Hash algo %u specified",
 				auth_xform->algo);
 		return -EINVAL;
 	}
@@ -645,7 +645,7 @@
 	case RTE_CRYPTO_AEAD_AES_GCM:
 		if (qat_sym_validate_aes_key(aead_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES key size");
+			QAT_LOG(ERR, "Invalid AES key size");
 			return -EINVAL;
 		}
 		session->qat_mode = ICP_QAT_HW_CIPHER_CTR_MODE;
@@ -654,14 +654,14 @@
 	case RTE_CRYPTO_AEAD_AES_CCM:
 		if (qat_sym_validate_aes_key(aead_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES key size");
+			QAT_LOG(ERR, "Invalid AES key size");
 			return -EINVAL;
 		}
 		session->qat_mode = ICP_QAT_HW_CIPHER_CTR_MODE;
 		session->qat_hash_alg = ICP_QAT_HW_AUTH_ALGO_AES_CBC_MAC;
 		break;
 	default:
-		PMD_DRV_LOG(ERR, "Crypto: Undefined AEAD specified %u\n",
+		QAT_LOG(ERR, "Crypto: Undefined AEAD specified %u\n",
 				aead_xform->algo);
 		return -EINVAL;
 	}
@@ -737,7 +737,7 @@ int qat_cipher_get_block_size(enum icp_qat_hw_cipher_algo qat_cipher_alg)
 	case ICP_QAT_HW_CIPHER_ALGO_AES256:
 		return ICP_QAT_HW_AES_BLK_SZ;
 	default:
-		PMD_DRV_LOG(ERR, "invalid block cipher alg %u", qat_cipher_alg);
+		QAT_LOG(ERR, "invalid block cipher alg %u", qat_cipher_alg);
 		return -EFAULT;
 	};
 	return -EFAULT;
@@ -795,7 +795,7 @@ static int qat_hash_get_state1_size(enum icp_qat_hw_auth_algo qat_hash_alg)
 		return QAT_HW_ROUND_UP(ICP_QAT_HW_SHA512_STATE1_SZ,
 						QAT_HW_DEFAULT_ALIGNMENT);
 	default:
-		PMD_DRV_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
+		QAT_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
 		return -EFAULT;
 	};
 	return -EFAULT;
@@ -821,7 +821,7 @@ static int qat_hash_get_digest_size(enum icp_qat_hw_auth_algo qat_hash_alg)
 		/* return maximum digest size in this case */
 		return ICP_QAT_HW_SHA512_STATE1_SZ;
 	default:
-		PMD_DRV_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
+		QAT_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
 		return -EFAULT;
 	};
 	return -EFAULT;
@@ -849,7 +849,7 @@ static int qat_hash_get_block_size(enum icp_qat_hw_auth_algo qat_hash_alg)
 		/* return maximum block size in this case */
 		return SHA512_CBLOCK;
 	default:
-		PMD_DRV_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
+		QAT_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
 		return -EFAULT;
 	};
 	return -EFAULT;
@@ -981,7 +981,7 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,
 			return -EFAULT;
 		break;
 	default:
-		PMD_DRV_LOG(ERR, "invalid hash alg %u", hash_alg);
+		QAT_LOG(ERR, "invalid hash alg %u", hash_alg);
 		return -EFAULT;
 	}
 
@@ -1021,7 +1021,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 		in = rte_zmalloc("working mem for key",
 				ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ, 16);
 		if (in == NULL) {
-			PMD_DRV_LOG(ERR, "Failed to alloc memory");
+			QAT_LOG(ERR, "Failed to alloc memory");
 			return -ENOMEM;
 		}
 
@@ -1056,7 +1056,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 		in = rte_zmalloc("working mem for key",
 				ICP_QAT_HW_GALOIS_H_SZ, 16);
 		if (in == NULL) {
-			PMD_DRV_LOG(ERR, "Failed to alloc memory");
+			QAT_LOG(ERR, "Failed to alloc memory");
 			return -ENOMEM;
 		}
 
@@ -1081,7 +1081,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 	memset(opad, 0, block_size);
 
 	if (auth_keylen > (unsigned int)block_size) {
-		PMD_DRV_LOG(ERR, "invalid keylen %u", auth_keylen);
+		QAT_LOG(ERR, "invalid keylen %u", auth_keylen);
 		return -EFAULT;
 	}
 	rte_memcpy(ipad, auth_key, auth_keylen);
@@ -1098,7 +1098,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 	if (partial_hash_compute(hash_alg, ipad, p_state_buf)) {
 		memset(ipad, 0, block_size);
 		memset(opad, 0, block_size);
-		PMD_DRV_LOG(ERR, "ipad precompute failed");
+		QAT_LOG(ERR, "ipad precompute failed");
 		return -EFAULT;
 	}
 
@@ -1110,7 +1110,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 	if (partial_hash_compute(hash_alg, opad, p_state_buf + *p_state_len)) {
 		memset(ipad, 0, block_size);
 		memset(opad, 0, block_size);
-		PMD_DRV_LOG(ERR, "opad precompute failed");
+		QAT_LOG(ERR, "opad precompute failed");
 		return -EFAULT;
 	}
 
@@ -1230,7 +1230,7 @@ int qat_sym_session_aead_create_cd_cipher(struct qat_sym_session *cdesc,
 					ICP_QAT_FW_SLICE_DRAM_WR);
 		cdesc->cd_cur_ptr = (uint8_t *)&cdesc->cd;
 	} else if (cdesc->qat_cmd != ICP_QAT_FW_LA_CMD_HASH_CIPHER) {
-		PMD_DRV_LOG(ERR, "Invalid param, must be a cipher command.");
+		QAT_LOG(ERR, "Invalid param, must be a cipher command.");
 		return -EFAULT;
 	}
 
@@ -1379,7 +1379,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 				ICP_QAT_FW_SLICE_DRAM_WR);
 		cdesc->cd_cur_ptr = (uint8_t *)&cdesc->cd;
 	} else if (cdesc->qat_cmd != ICP_QAT_FW_LA_CMD_CIPHER_HASH) {
-		PMD_DRV_LOG(ERR, "Invalid param, must be a hash command.");
+		QAT_LOG(ERR, "Invalid param, must be a hash command.");
 		return -EFAULT;
 	}
 
@@ -1424,7 +1424,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	case ICP_QAT_HW_AUTH_ALGO_SHA1:
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA1,
 			authkey, authkeylen, cdesc->cd_cur_ptr,	&state1_size)) {
-			PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+			QAT_LOG(ERR, "(SHA)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = RTE_ALIGN_CEIL(ICP_QAT_HW_SHA1_STATE2_SZ, 8);
@@ -1432,7 +1432,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	case ICP_QAT_HW_AUTH_ALGO_SHA224:
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA224,
 			authkey, authkeylen, cdesc->cd_cur_ptr, &state1_size)) {
-			PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+			QAT_LOG(ERR, "(SHA)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = ICP_QAT_HW_SHA224_STATE2_SZ;
@@ -1440,7 +1440,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	case ICP_QAT_HW_AUTH_ALGO_SHA256:
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA256,
 			authkey, authkeylen, cdesc->cd_cur_ptr,	&state1_size)) {
-			PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+			QAT_LOG(ERR, "(SHA)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = ICP_QAT_HW_SHA256_STATE2_SZ;
@@ -1448,7 +1448,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	case ICP_QAT_HW_AUTH_ALGO_SHA384:
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA384,
 			authkey, authkeylen, cdesc->cd_cur_ptr, &state1_size)) {
-			PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+			QAT_LOG(ERR, "(SHA)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = ICP_QAT_HW_SHA384_STATE2_SZ;
@@ -1456,7 +1456,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	case ICP_QAT_HW_AUTH_ALGO_SHA512:
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA512,
 			authkey, authkeylen, cdesc->cd_cur_ptr,	&state1_size)) {
-			PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+			QAT_LOG(ERR, "(SHA)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = ICP_QAT_HW_SHA512_STATE2_SZ;
@@ -1466,7 +1466,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC,
 			authkey, authkeylen, cdesc->cd_cur_ptr + state1_size,
 			&state2_size)) {
-			PMD_DRV_LOG(ERR, "(XCBC)precompute failed");
+			QAT_LOG(ERR, "(XCBC)precompute failed");
 			return -EFAULT;
 		}
 		break;
@@ -1477,7 +1477,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 		if (qat_sym_do_precomputes(cdesc->qat_hash_alg,
 			authkey, authkeylen, cdesc->cd_cur_ptr + state1_size,
 			&state2_size)) {
-			PMD_DRV_LOG(ERR, "(GCM)precompute failed");
+			QAT_LOG(ERR, "(GCM)precompute failed");
 			return -EFAULT;
 		}
 		/*
@@ -1537,7 +1537,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_MD5,
 			authkey, authkeylen, cdesc->cd_cur_ptr,
 			&state1_size)) {
-			PMD_DRV_LOG(ERR, "(MD5)precompute failed");
+			QAT_LOG(ERR, "(MD5)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = ICP_QAT_HW_MD5_STATE2_SZ;
@@ -1592,7 +1592,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 			pTempKey[wordIndex] ^= KASUMI_F9_KEY_MODIFIER_4_BYTES;
 		break;
 	default:
-		PMD_DRV_LOG(ERR, "Invalid HASH alg %u", cdesc->qat_hash_alg);
+		QAT_LOG(ERR, "Invalid HASH alg %u", cdesc->qat_hash_alg);
 		return -EFAULT;
 	}
 
-- 
1.7.0.7

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

* [dpdk-dev] [PATCH 4/5] crypto/qat: move to dynamic logging for data-path trace
  2018-05-11 11:31 [dpdk-dev] [PATCH 0/5] crypto/qat: move to dynamic logging Fiona Trahe
                   ` (2 preceding siblings ...)
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 3/5] crypto/qat: rename log macro for non-dp logs Fiona Trahe
@ 2018-05-11 11:31 ` Fiona Trahe
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 5/5] doc/qat: document debug options Fiona Trahe
  2018-06-14 11:03 ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging Tomasz Jozwiak
  5 siblings, 0 replies; 14+ messages in thread
From: Fiona Trahe @ 2018-05-11 11:31 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch, fiona.trahe, tomaszx.jozwiak

From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>

For all trace on the data-path move to dynamic logging.
Add new QAT_DP_LOG macro to separate from non-dp trace.
Use the overall RTE_LOG_DP_LEVEL to override and compile out
debug data-path trace.
Add "unlikely" in two appropriate error checks.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 config/common_base            |    2 -
 drivers/crypto/qat/qat_logs.c |   23 ++++++++++++++
 drivers/crypto/qat/qat_logs.h |   20 ++++++++++++
 drivers/crypto/qat/qat_sym.c  |   65 +++++++++++++++++++---------------------
 drivers/crypto/qat/qat_sym.h  |   30 ++++++++++---------
 5 files changed, 90 insertions(+), 50 deletions(-)

diff --git a/config/common_base b/config/common_base
index e15ebac..3cd702e 100644
--- a/config/common_base
+++ b/config/common_base
@@ -482,8 +482,6 @@ CONFIG_RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS=2048
 # Compile PMD for QuickAssist based devices
 #
 CONFIG_RTE_LIBRTE_PMD_QAT=n
-CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_TX=n
-CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_RX=n
 #
 # Max. number of QuickAssist devices, which can be detected and attached
 #
diff --git a/drivers/crypto/qat/qat_logs.c b/drivers/crypto/qat/qat_logs.c
index c5ee539..da94eb9 100644
--- a/drivers/crypto/qat/qat_logs.c
+++ b/drivers/crypto/qat/qat_logs.c
@@ -3,8 +3,26 @@
  */
 
 #include <rte_log.h>
+#include <rte_hexdump.h>
+
+#include "qat_logs.h"
 
 int qat_gen_logtype;
+int qat_dp_logtype;
+
+int
+qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
+		const void *buf, unsigned int len)
+{
+	if (level > rte_log_get_global_level())
+		return 0;
+	if (level > (uint32_t)(rte_log_get_level(logtype)))
+		return 0;
+
+	rte_hexdump(rte_logs.file == NULL ? stderr : rte_logs.file,
+				title, buf, len);
+	return 0;
+}
 
 static void
 qat_pci_init_log(void)
@@ -13,6 +31,11 @@
 	qat_gen_logtype = rte_log_register("pmd.qat_general");
 	if (qat_gen_logtype >= 0)
 		rte_log_set_level(qat_gen_logtype, RTE_LOG_NOTICE);
+
+	/* data-path logging for all services */
+	qat_dp_logtype = rte_log_register("pmd.qat_dp");
+	if (qat_dp_logtype >= 0)
+		rte_log_set_level(qat_dp_logtype, RTE_LOG_NOTICE);
 }
 
 RTE_INIT(qat_pci_init_log);
diff --git a/drivers/crypto/qat/qat_logs.h b/drivers/crypto/qat/qat_logs.h
index b12f754..4baea12 100644
--- a/drivers/crypto/qat/qat_logs.h
+++ b/drivers/crypto/qat/qat_logs.h
@@ -6,9 +6,29 @@
 #define _QAT_LOGS_H_
 
 extern int qat_gen_logtype;
+extern int qat_dp_logtype;
 
 #define QAT_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, qat_gen_logtype,		\
 			"%s(): " fmt "\n", __func__, ## args)
 
+#define QAT_DP_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, qat_dp_logtype,		\
+			"%s(): " fmt "\n", __func__, ## args)
+
+#define QAT_DP_HEXDUMP_LOG(level, title, buf, len)		\
+	qat_hexdump_log(RTE_LOG_ ## level, qat_dp_logtype, title, buf, len)
+
+/**
+ * qat_hexdump_log - Dump out memory in a special hex dump format.
+ *
+ * Dump out the message buffer in a special hex dump output format with
+ * characters printed for each line of 16 hex values. The message will be sent
+ * to the stream defined by rte_logs.file or to stderr in case of rte_logs.file
+ * is undefined.
+ */
+int
+qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
+		const void *buf, unsigned int len);
+
 #endif /* _QAT_LOGS_H_ */
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 7bedad3..17d63eb 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -6,12 +6,10 @@
 
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
-#include <rte_hexdump.h>
 #include <rte_crypto_sym.h>
 #include <rte_bus_pci.h>
 #include <rte_byteorder.h>
 
-#include "qat_logs.h"
 #include "qat_sym.h"
 
 /** Decrypt a single partial block
@@ -39,7 +37,7 @@
 	return 0;
 
 cipher_decrypt_err:
-	QAT_LOG(ERR, "libcrypto ECB cipher decrypt for BPI IV failed");
+	QAT_DP_LOG(ERR, "libcrypto ECB cipher decrypt for BPI IV failed");
 	return -EINVAL;
 }
 
@@ -78,21 +76,21 @@
 			iv = rte_crypto_op_ctod_offset(op, uint8_t *,
 					ctx->cipher_iv.offset);
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
-		rte_hexdump(stdout, "BPI: src before pre-process:", last_block,
-			last_block_len);
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+		QAT_DP_HEXDUMP_LOG(DEBUG, "BPI: src before pre-process:",
+			last_block, last_block_len);
 		if (sym_op->m_dst != NULL)
-			rte_hexdump(stdout, "BPI: dst before pre-process:", dst,
-				last_block_len);
+			QAT_DP_HEXDUMP_LOG(DEBUG, "BPI:dst before pre-process:",
+			dst, last_block_len);
 #endif
 		bpi_cipher_decrypt(last_block, dst, iv, block_len,
 				last_block_len, ctx->bpi_ctx);
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
-		rte_hexdump(stdout, "BPI: src after pre-process:", last_block,
-			last_block_len);
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+		QAT_DP_HEXDUMP_LOG(DEBUG, "BPI: src after pre-process:",
+			last_block, last_block_len);
 		if (sym_op->m_dst != NULL)
-			rte_hexdump(stdout, "BPI: dst after pre-process:", dst,
-				last_block_len);
+			QAT_DP_HEXDUMP_LOG(DEBUG, "BPI: dst after pre-process:",
+			dst, last_block_len);
 #endif
 	}
 
@@ -163,16 +161,15 @@
 	struct qat_sym_op_cookie *cookie =
 				(struct qat_sym_op_cookie *)op_cookie;
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
 	if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
-		QAT_LOG(ERR, "QAT PMD only supports symmetric crypto "
+		QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
 				"operation requests, op (%p) is not a "
 				"symmetric operation.", op);
 		return -EINVAL;
 	}
-#endif
+
 	if (unlikely(op->sess_type == RTE_CRYPTO_OP_SESSIONLESS)) {
-		QAT_LOG(ERR, "QAT PMD only supports session oriented"
+		QAT_DP_LOG(ERR, "QAT PMD only supports session oriented"
 				" requests, op (%p) is sessionless.", op);
 		return -EINVAL;
 	}
@@ -181,12 +178,12 @@
 			op->sym->session, cryptodev_qat_driver_id);
 
 	if (unlikely(ctx == NULL)) {
-		QAT_LOG(ERR, "Session was not created for this device");
+		QAT_DP_LOG(ERR, "Session was not created for this device");
 		return -EINVAL;
 	}
 
 	if (unlikely(ctx->min_qat_dev_gen > qat_dev_gen)) {
-		QAT_LOG(ERR, "Session alg not supported on this device gen");
+		QAT_DP_LOG(ERR, "Session alg not supported on this device gen");
 		op->status = RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
 		return -EINVAL;
 	}
@@ -231,7 +228,7 @@
 				(cipher_param->cipher_length % BYTE_LENGTH != 0)
 				 || (cipher_param->cipher_offset
 							% BYTE_LENGTH != 0))) {
-				QAT_LOG(ERR,
+				QAT_DP_LOG(ERR,
 		  "SNOW3G/KASUMI/ZUC in QAT PMD only supports byte aligned values");
 				op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 				return -EINVAL;
@@ -265,7 +262,7 @@
 				ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3) {
 			if (unlikely((auth_param->auth_off % BYTE_LENGTH != 0)
 				|| (auth_param->auth_len % BYTE_LENGTH != 0))) {
-				QAT_LOG(ERR,
+				QAT_DP_LOG(ERR,
 		"For SNOW3G/KASUMI/ZUC, QAT PMD only supports byte aligned values");
 				op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 				return -EINVAL;
@@ -500,8 +497,9 @@
 		ret = qat_sgl_fill_array(op->sym->m_src, src_buf_start,
 				&cookie->qat_sgl_src,
 				qat_req->comn_mid.src_length);
-		if (ret) {
-			QAT_LOG(ERR, "QAT PMD Cannot fill sgl array");
+
+		if (unlikely(ret)) {
+			QAT_DP_LOG(ERR, "QAT PMD Cannot fill sgl array");
 			return ret;
 		}
 
@@ -515,9 +513,8 @@
 					&cookie->qat_sgl_dst,
 						qat_req->comn_mid.dst_length);
 
-			if (ret) {
-				QAT_LOG(ERR, "QAT PMD Cannot "
-						"fill sgl array");
+			if (unlikely(ret)) {
+				QAT_DP_LOG(ERR, "QAT PMD can't fill sgl array");
 				return ret;
 			}
 
@@ -531,17 +528,17 @@
 		qat_req->comn_mid.dest_data_addr = dst_buf_start;
 	}
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
-	rte_hexdump(stdout, "qat_req:", qat_req,
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+	QAT_DP_HEXDUMP_LOG(DEBUG, "qat_req:", qat_req,
 			sizeof(struct icp_qat_fw_la_bulk_req));
-	rte_hexdump(stdout, "src_data:",
+	QAT_DP_HEXDUMP_LOG(DEBUG, "src_data:",
 			rte_pktmbuf_mtod(op->sym->m_src, uint8_t*),
 			rte_pktmbuf_data_len(op->sym->m_src));
 	if (do_cipher) {
 		uint8_t *cipher_iv_ptr = rte_crypto_op_ctod_offset(op,
 						uint8_t *,
 						ctx->cipher_iv.offset);
-		rte_hexdump(stdout, "cipher iv:", cipher_iv_ptr,
+		QAT_DP_HEXDUMP_LOG(DEBUG, "cipher iv:", cipher_iv_ptr,
 				ctx->cipher_iv.length);
 	}
 
@@ -550,17 +547,17 @@
 			uint8_t *auth_iv_ptr = rte_crypto_op_ctod_offset(op,
 							uint8_t *,
 							ctx->auth_iv.offset);
-			rte_hexdump(stdout, "auth iv:", auth_iv_ptr,
+			QAT_DP_HEXDUMP_LOG(DEBUG, "auth iv:", auth_iv_ptr,
 						ctx->auth_iv.length);
 		}
-		rte_hexdump(stdout, "digest:", op->sym->auth.digest.data,
+		QAT_DP_HEXDUMP_LOG(DEBUG, "digest:", op->sym->auth.digest.data,
 				ctx->digest_length);
 	}
 
 	if (do_aead) {
-		rte_hexdump(stdout, "digest:", op->sym->aead.digest.data,
+		QAT_DP_HEXDUMP_LOG(DEBUG, "digest:", op->sym->aead.digest.data,
 				ctx->digest_length);
-		rte_hexdump(stdout, "aad:", op->sym->aead.aad.data,
+		QAT_DP_HEXDUMP_LOG(DEBUG, "aad:", op->sym->aead.aad.data,
 				ctx->aad_len);
 	}
 #endif
diff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h
index b693a4d..f9e72a6 100644
--- a/drivers/crypto/qat/qat_sym.h
+++ b/drivers/crypto/qat/qat_sym.h
@@ -6,13 +6,13 @@
 #define _QAT_SYM_H_
 
 #include <rte_cryptodev_pmd.h>
-#include <rte_hexdump.h>
 
 #include <openssl/evp.h>
 
 #include "qat_common.h"
 #include "qat_sym_session.h"
 #include "qat_sym_pmd.h"
+#include "qat_logs.h"
 
 #define BYTE_LENGTH    8
 /* bpi is only used for partial blocks of DES and AES
@@ -59,7 +59,7 @@ struct qat_sym_op_cookie {
 	return 0;
 
 cipher_encrypt_err:
-	QAT_LOG(ERR, "libcrypto ECB cipher encrypt failed");
+	QAT_DP_LOG(ERR, "libcrypto ECB cipher encrypt failed");
 	return -EINVAL;
 }
 
@@ -99,21 +99,23 @@ struct qat_sym_op_cookie {
 			iv = rte_crypto_op_ctod_offset(op, uint8_t *,
 					ctx->cipher_iv.offset);
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_RX
-		rte_hexdump(stdout, "BPI: src before post-process:", last_block,
-			last_block_len);
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+		QAT_DP_HEXDUMP_LOG(DEBUG, "BPI: src before post-process:",
+			last_block, last_block_len);
 		if (sym_op->m_dst != NULL)
-			rte_hexdump(stdout, "BPI: dst before post-process:",
-					dst, last_block_len);
+			QAT_DP_HEXDUMP_LOG(DEBUG,
+				"BPI: dst before post-process:",
+				dst, last_block_len);
 #endif
 		bpi_cipher_encrypt(last_block, dst, iv, block_len,
 				last_block_len, ctx->bpi_ctx);
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_RX
-		rte_hexdump(stdout, "BPI: src after post-process:", last_block,
-			last_block_len);
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+		QAT_DP_HEXDUMP_LOG(DEBUG, "BPI: src after post-process:",
+				last_block, last_block_len);
 		if (sym_op->m_dst != NULL)
-			rte_hexdump(stdout, "BPI: dst after post-process:", dst,
-				last_block_len);
+			QAT_DP_HEXDUMP_LOG(DEBUG,
+				"BPI: dst after post-process:",
+				dst, last_block_len);
 #endif
 	}
 	return sym_op->cipher.data.length - last_block_len;
@@ -128,8 +130,8 @@ struct qat_sym_op_cookie {
 	struct rte_crypto_op *rx_op = (struct rte_crypto_op *)(uintptr_t)
 			(resp_msg->opaque_data);
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_RX
-	rte_hexdump(stdout, "qat_response:", (uint8_t *)resp_msg,
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+	QAT_DP_HEXDUMP_LOG(DEBUG, "qat_response:", (uint8_t *)resp_msg,
 			sizeof(struct icp_qat_fw_comn_resp));
 #endif
 
-- 
1.7.0.7

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

* [dpdk-dev] [PATCH 5/5] doc/qat: document debug options
  2018-05-11 11:31 [dpdk-dev] [PATCH 0/5] crypto/qat: move to dynamic logging Fiona Trahe
                   ` (3 preceding siblings ...)
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 4/5] crypto/qat: move to dynamic logging for data-path trace Fiona Trahe
@ 2018-05-11 11:31 ` Fiona Trahe
  2018-06-14 11:03 ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging Tomasz Jozwiak
  5 siblings, 0 replies; 14+ messages in thread
From: Fiona Trahe @ 2018-05-11 11:31 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch, fiona.trahe, tomaszx.jozwiak

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 doc/guides/cryptodevs/qat.rst |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
index 67176bd..77f8362 100644
--- a/doc/guides/cryptodevs/qat.rst
+++ b/doc/guides/cryptodevs/qat.rst
@@ -371,3 +371,29 @@ Each qat crypto device has a unique name, in format
 <pci bdf>_<service>, e.g. "0000:41:01.0_qat_sym".
 This name can be passed to rte_cryptodev_get_dev_id() to get the device_id.
 This is also the format of the slave parameter passed to the crypto scheduler.
+
+Debugging
+----------------------------------------
+
+There are 2 sets of trace available via the dynamic logging feature:
+
+* pmd.qat_dp exposes trace on the data-path.
+* pmd.qat_general exposes all other trace.
+
+pmd.qat exposes both sets of traces.
+They can be enabled using the log-level option (where 8=maximum log level) on
+the process cmdline, e.g. using any of the following::
+
+    --log-level="pmd.qat_general,8"
+    --log-level="pmd.qat_dp,8"
+    --log-level="pmd.qat,8"
+
+.. Note::
+
+    The global RTE_LOG_DP_LEVEL overrides data-path trace so must be set to
+    RTE_LOG_DEBUG to see all the trace. This variable is in config/rte_config.h
+    for meson build and config/common_base for gnu make.
+    Also the dynamic global log level overrides both sets of trace, so e.g. no
+    QAT trace would display in this case::
+
+	--log-level="7" --log-level="pmd.qat_general,8"
-- 
1.7.0.7

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

* Re: [dpdk-dev] [PATCH 2/5] crypto/qat: move to dynamic logging for non-dp trace
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 2/5] crypto/qat: move to dynamic logging for non-dp trace Fiona Trahe
@ 2018-06-12 15:54   ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 14+ messages in thread
From: De Lara Guarch, Pablo @ 2018-06-12 15:54 UTC (permalink / raw)
  To: Trahe, Fiona, dev; +Cc: Jozwiak, TomaszX

Hi,

> -----Original Message-----
> From: Trahe, Fiona
> Sent: Friday, May 11, 2018 12:32 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; Jozwiak, TomaszX <tomaszx.jozwiak@intel.com>
> Subject: [PATCH 2/5] crypto/qat: move to dynamic logging for non-dp trace
> 
> From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
> 
> For all trace not on the data-path move to dynamic logging.
> 
> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
> Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>

...

> +++ b/drivers/crypto/qat/qat_logs.c
> @@ -0,0 +1,18 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2018 Intel Corporation
> + */
> +
> +#include <rte_log.h>
> +
> +int qat_gen_logtype;
> +
> +static void
> +qat_pci_init_log(void)
> +{
> +	/* Non-data-path logging for pci device and all services */
> +	qat_gen_logtype = rte_log_register("pmd.qat_general");
> +	if (qat_gen_logtype >= 0)
> +		rte_log_set_level(qat_gen_logtype, RTE_LOG_NOTICE); }
> +
> +RTE_INIT(qat_pci_init_log);

I am seeing a compilation error on clang:

drivers/crypto/qat/qat_logs.c:18:1: error:
attribute declaration must precede definition [-Werror,-Wignored-attributes]
RTE_INIT(qat_pci_init_log);
^


Thanks,
Pablo

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

* [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging
  2018-05-11 11:31 [dpdk-dev] [PATCH 0/5] crypto/qat: move to dynamic logging Fiona Trahe
                   ` (4 preceding siblings ...)
  2018-05-11 11:31 ` [dpdk-dev] [PATCH 5/5] doc/qat: document debug options Fiona Trahe
@ 2018-06-14 11:03 ` Tomasz Jozwiak
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 1/5] crypto/qat: cleanup unused and useless trace Tomasz Jozwiak
                     ` (5 more replies)
  5 siblings, 6 replies; 14+ messages in thread
From: Tomasz Jozwiak @ 2018-06-14 11:03 UTC (permalink / raw)
  To: fiona.trahe, tomaszx.jozwiak, dev

Note this patchset is targeting 18.08 release and depends on the qat refactoring patchset:
http://dpdk.org/ml/archives/dev/2018-May/101306.html
 
Move to dynamic logging and cleanup trace.

Changes for v2:
 - fixed some bugs detected in patch 2/5 when using clang

Fiona Trahe (2):
  crypto/qat: rename log macro for non-dp logs
  doc/qat: document debug options

Tomasz Jozwiak (3):
  crypto/qat: cleanup unused and useless trace
  crypto/qat: move to dynamic logging for non-dp trace
  crypto/qat: move to dynamic logging for data-path trace

 config/common_base                   |   4 --
 doc/guides/cryptodevs/qat.rst        |  26 +++++++++
 drivers/crypto/qat/Makefile          |   1 +
 drivers/crypto/qat/meson.build       |   1 +
 drivers/crypto/qat/qat_common.c      |  12 ++--
 drivers/crypto/qat/qat_device.c      |  12 ++--
 drivers/crypto/qat/qat_logs.c        |  40 ++++++++++++++
 drivers/crypto/qat/qat_logs.h        |  65 +++++++++-------------
 drivers/crypto/qat/qat_qp.c          |  63 +++++++++------------
 drivers/crypto/qat/qat_sym.c         |  65 +++++++++++-----------
 drivers/crypto/qat/qat_sym.h         |  30 +++++-----
 drivers/crypto/qat/qat_sym_pmd.c     |  21 +++----
 drivers/crypto/qat/qat_sym_session.c | 103 ++++++++++++++++-------------------
 13 files changed, 234 insertions(+), 209 deletions(-)
 create mode 100644 drivers/crypto/qat/qat_logs.c

-- 
2.7.4

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

* [dpdk-dev] [PATCH v2 1/5] crypto/qat: cleanup unused and useless trace
  2018-06-14 11:03 ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging Tomasz Jozwiak
@ 2018-06-14 11:03   ` Tomasz Jozwiak
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 2/5] crypto/qat: move to dynamic logging for non-dp trace Tomasz Jozwiak
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Tomasz Jozwiak @ 2018-06-14 11:03 UTC (permalink / raw)
  To: fiona.trahe, tomaszx.jozwiak, dev

Removed INIT_FUNC trace and other unused macros.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 config/common_base                   |  1 -
 drivers/crypto/qat/qat_logs.h        | 31 -------------------------------
 drivers/crypto/qat/qat_qp.c          | 11 +----------
 drivers/crypto/qat/qat_sym_pmd.c     |  7 +------
 drivers/crypto/qat/qat_sym_session.c |  9 ---------
 5 files changed, 2 insertions(+), 57 deletions(-)

diff --git a/config/common_base b/config/common_base
index f03f9c3..0e6f2fb 100644
--- a/config/common_base
+++ b/config/common_base
@@ -486,7 +486,6 @@ CONFIG_RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS=2048
 # Compile PMD for QuickAssist based devices
 #
 CONFIG_RTE_LIBRTE_PMD_QAT=n
-CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_INIT=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_DRIVER=n
diff --git a/drivers/crypto/qat/qat_logs.h b/drivers/crypto/qat/qat_logs.h
index c9144bf..e6f8a01 100644
--- a/drivers/crypto/qat/qat_logs.h
+++ b/drivers/crypto/qat/qat_logs.h
@@ -5,37 +5,6 @@
 #ifndef _QAT_LOGS_H_
 #define _QAT_LOGS_H_
 
-#define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, \
-		"PMD: %s(): " fmt "\n", __func__, ##args)
-
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_INIT
-#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
-#else
-#define PMD_INIT_FUNC_TRACE() do { } while (0)
-#endif
-
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
-#endif
-
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
-#endif
-
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX_FREE
-#define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-#else
-#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
-#endif
-
 #ifdef RTE_LIBRTE_PMD_QAT_DEBUG_DRIVER
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index f9d3762..531752b 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -120,7 +120,6 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,
 {
 	const struct rte_memzone *mz;
 
-	PMD_INIT_FUNC_TRACE();
 	mz = rte_memzone_lookup(queue_name);
 	if (mz != 0) {
 		if (((size_t)queue_size <= mz->len) &&
@@ -194,7 +193,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 
 	if (qat_queue_create(qat_dev, &(qp->tx_q), qat_qp_conf,
 					ADF_RING_DIR_TX) != 0) {
-		PMD_INIT_LOG(ERR, "Tx queue create failed "
+		PMD_DRV_LOG(ERR, "Tx queue create failed "
 				"queue_pair_id=%u", queue_pair_id);
 		goto create_err;
 	}
@@ -261,7 +260,6 @@ int qat_qp_release(struct qat_qp **qp_addr)
 	struct qat_qp *qp = *qp_addr;
 	uint32_t i;
 
-	PMD_INIT_FUNC_TRACE();
 	if (qp == NULL) {
 		PMD_DRV_LOG(DEBUG, "qp already freed");
 		return 0;
@@ -418,7 +416,6 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
 static int qat_qp_check_queue_alignment(uint64_t phys_addr,
 					uint32_t queue_size_bytes)
 {
-	PMD_INIT_FUNC_TRACE();
 	if (((queue_size_bytes - 1) & phys_addr) != 0)
 		return -EINVAL;
 	return 0;
@@ -429,7 +426,6 @@ static int adf_verify_queue_size(uint32_t msg_size, uint32_t msg_num,
 {
 	uint8_t i = ADF_MIN_RING_SIZE;
 
-	PMD_INIT_FUNC_TRACE();
 	for (; i <= ADF_MAX_RING_SIZE; i++)
 		if ((msg_size * msg_num) ==
 				(uint32_t)ADF_SIZE_TO_RING_SIZE_IN_BYTES(i)) {
@@ -448,8 +444,6 @@ static void adf_queue_arb_enable(struct qat_queue *txq, void *base_addr,
 							txq->hw_bundle_number);
 	uint32_t value;
 
-	PMD_INIT_FUNC_TRACE();
-
 	rte_spinlock_lock(lock);
 	value = ADF_CSR_RD(base_addr, arb_csr_offset);
 	value |= (0x01 << txq->hw_queue_number);
@@ -465,8 +459,6 @@ static void adf_queue_arb_disable(struct qat_queue *txq, void *base_addr,
 							txq->hw_bundle_number);
 	uint32_t value;
 
-	PMD_INIT_FUNC_TRACE();
-
 	rte_spinlock_lock(lock);
 	value = ADF_CSR_RD(base_addr, arb_csr_offset);
 	value &= ~(0x01 << txq->hw_queue_number);
@@ -479,7 +471,6 @@ static void adf_configure_queues(struct qat_qp *qp)
 	uint32_t queue_config;
 	struct qat_queue *queue = &qp->tx_q;
 
-	PMD_INIT_FUNC_TRACE();
 	queue_config = BUILD_RING_CONFIG(queue->queue_size);
 
 	WRITE_CSR_RING_CONFIG(qp->mmap_bar_addr, queue->hw_bundle_number,
diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c
index c94a8a1..8797c0e 100644
--- a/drivers/crypto/qat/qat_sym_pmd.c
+++ b/drivers/crypto/qat/qat_sym_pmd.c
@@ -33,27 +33,23 @@ static int qat_sym_qp_release(struct rte_cryptodev *dev,
 static int qat_sym_dev_config(__rte_unused struct rte_cryptodev *dev,
 		__rte_unused struct rte_cryptodev_config *config)
 {
-	PMD_INIT_FUNC_TRACE();
 	return 0;
 }
 
 static int qat_sym_dev_start(__rte_unused struct rte_cryptodev *dev)
 {
-	PMD_INIT_FUNC_TRACE();
 	return 0;
 }
 
 static void qat_sym_dev_stop(__rte_unused struct rte_cryptodev *dev)
 {
-	PMD_INIT_FUNC_TRACE();
+	return;
 }
 
 static int qat_sym_dev_close(struct rte_cryptodev *dev)
 {
 	int i, ret;
 
-	PMD_INIT_FUNC_TRACE();
-
 	for (i = 0; i < dev->data->nb_queue_pairs; i++) {
 		ret = qat_sym_qp_release(dev, i);
 		if (ret < 0)
@@ -71,7 +67,6 @@ static void qat_sym_dev_info_get(struct rte_cryptodev *dev,
 		qat_gen_config[internals->qat_dev->qat_dev_gen]
 			      .qp_hw_data[QAT_SERVICE_SYMMETRIC];
 
-	PMD_INIT_FUNC_TRACE();
 	if (info != NULL) {
 		info->max_nb_queue_pairs =
 			qat_qps_per_service(sym_hw_qps, QAT_SERVICE_SYMMETRIC);
diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 689596d..83d0fb1 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -111,7 +111,6 @@ void
 qat_sym_session_clear(struct rte_cryptodev *dev,
 		struct rte_cryptodev_sym_session *sess)
 {
-	PMD_INIT_FUNC_TRACE();
 	uint8_t index = dev->driver_id;
 	void *sess_priv = get_session_private_data(sess, index);
 	struct qat_sym_session *s = (struct qat_sym_session *)sess_priv;
@@ -411,8 +410,6 @@ qat_sym_session_set_parameters(struct rte_cryptodev *dev,
 	int ret;
 	int qat_cmd_id;
 
-	PMD_INIT_FUNC_TRACE();
-
 	/* Set context descriptor physical address */
 	session->cd_paddr = rte_mempool_virt2iova(session) +
 			offsetof(struct qat_sym_session, cd);
@@ -936,7 +933,6 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,
 	uint64_t *hash_state_out_be64;
 	int i;
 
-	PMD_INIT_FUNC_TRACE();
 	digest_size = qat_hash_get_digest_size(hash_alg);
 	if (digest_size <= 0)
 		return -EFAULT;
@@ -1006,7 +1002,6 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 	uint8_t opad[qat_hash_get_block_size(ICP_QAT_HW_AUTH_ALGO_DELIMITER)];
 	int i;
 
-	PMD_INIT_FUNC_TRACE();
 	if (hash_alg == ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC) {
 		static uint8_t qat_aes_xcbc_key_seed[
 					ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ] = {
@@ -1129,7 +1124,6 @@ static void
 qat_sym_session_init_common_hdr(struct icp_qat_fw_comn_req_hdr *header,
 		enum qat_sym_proto_flag proto_flags)
 {
-	PMD_INIT_FUNC_TRACE();
 	header->hdr_flags =
 		ICP_QAT_FW_COMN_HDR_FLAGS_BUILD(ICP_QAT_FW_COMN_REQ_FLAG_SET);
 	header->service_type = ICP_QAT_FW_COMN_REQ_CPM_FW_LA;
@@ -1212,7 +1206,6 @@ int qat_sym_session_aead_create_cd_cipher(struct qat_sym_session *cdesc,
 	uint16_t cipher_offset, cd_size;
 	uint32_t wordIndex  = 0;
 	uint32_t *temp_key = NULL;
-	PMD_INIT_FUNC_TRACE();
 
 	if (cdesc->qat_cmd == ICP_QAT_FW_LA_CMD_CIPHER) {
 		cd_pars->u.s.content_desc_addr = cdesc->cd_paddr;
@@ -1369,8 +1362,6 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	enum qat_sym_proto_flag qat_proto_flag =
 		QAT_CRYPTO_PROTO_FLAG_NONE;
 
-	PMD_INIT_FUNC_TRACE();
-
 	if (cdesc->qat_cmd == ICP_QAT_FW_LA_CMD_AUTH) {
 		ICP_QAT_FW_COMN_CURR_ID_SET(hash_cd_ctrl,
 					ICP_QAT_FW_SLICE_AUTH);
-- 
2.7.4

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

* [dpdk-dev] [PATCH v2 2/5] crypto/qat: move to dynamic logging for non-dp trace
  2018-06-14 11:03 ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging Tomasz Jozwiak
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 1/5] crypto/qat: cleanup unused and useless trace Tomasz Jozwiak
@ 2018-06-14 11:03   ` Tomasz Jozwiak
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 3/5] crypto/qat: rename log macro for non-dp logs Tomasz Jozwiak
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Tomasz Jozwiak @ 2018-06-14 11:03 UTC (permalink / raw)
  To: fiona.trahe, tomaszx.jozwiak, dev

For all trace not on the data-path move to dynamic logging.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 config/common_base             |  1 -
 drivers/crypto/qat/Makefile    |  1 +
 drivers/crypto/qat/meson.build |  1 +
 drivers/crypto/qat/qat_logs.c  | 17 +++++++++++++++++
 drivers/crypto/qat/qat_logs.h  | 12 ++++--------
 5 files changed, 23 insertions(+), 9 deletions(-)
 create mode 100644 drivers/crypto/qat/qat_logs.c

diff --git a/config/common_base b/config/common_base
index 0e6f2fb..7a9b26e 100644
--- a/config/common_base
+++ b/config/common_base
@@ -488,7 +488,6 @@ CONFIG_RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS=2048
 CONFIG_RTE_LIBRTE_PMD_QAT=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_RX=n
-CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_DRIVER=n
 #
 # Max. number of QuickAssist devices, which can be detected and attached
 #
diff --git a/drivers/crypto/qat/Makefile b/drivers/crypto/qat/Makefile
index d467683..ef4a567 100644
--- a/drivers/crypto/qat/Makefile
+++ b/drivers/crypto/qat/Makefile
@@ -26,6 +26,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_device.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_qp.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_sym_session.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_common.c
+SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_logs.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_sym_pmd.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_asym_pmd.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_comp_pmd.c
diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build
index e22e08f..bcab16e 100644
--- a/drivers/crypto/qat/meson.build
+++ b/drivers/crypto/qat/meson.build
@@ -8,6 +8,7 @@ endif
 sources = files('qat_common.c',
 		'qat_qp.c',
 		'qat_device.c',
+		'qat_logs.c',
 		'qat_sym_pmd.c', 'qat_sym.c', 'qat_sym_session.c',
 		'qat_asym_pmd.c',
 		'qat_comp_pmd.c')
diff --git a/drivers/crypto/qat/qat_logs.c b/drivers/crypto/qat/qat_logs.c
new file mode 100644
index 0000000..fc8d9a7
--- /dev/null
+++ b/drivers/crypto/qat/qat_logs.c
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include <rte_log.h>
+
+int qat_gen_logtype;
+
+RTE_INIT(qat_pci_init_log);
+static void
+qat_pci_init_log(void)
+{
+	/* Non-data-path logging for pci device and all services */
+	qat_gen_logtype = rte_log_register("pmd.qat_general");
+	if (qat_gen_logtype >= 0)
+		rte_log_set_level(qat_gen_logtype, RTE_LOG_NOTICE);
+}
diff --git a/drivers/crypto/qat/qat_logs.h b/drivers/crypto/qat/qat_logs.h
index e6f8a01..b00a06b 100644
--- a/drivers/crypto/qat/qat_logs.h
+++ b/drivers/crypto/qat/qat_logs.h
@@ -5,14 +5,10 @@
 #ifndef _QAT_LOGS_H_
 #define _QAT_LOGS_H_
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_DRIVER
-#define PMD_DRV_LOG_RAW(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
-#else
-#define PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0)
-#endif
+extern int qat_gen_logtype;
 
-#define PMD_DRV_LOG(level, fmt, args...) \
-	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+#define PMD_DRV_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, qat_gen_logtype,		\
+			"%s(): " fmt "\n", __func__, ## args)
 
 #endif /* _QAT_LOGS_H_ */
-- 
2.7.4

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

* [dpdk-dev] [PATCH v2 3/5] crypto/qat: rename log macro for non-dp logs
  2018-06-14 11:03 ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging Tomasz Jozwiak
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 1/5] crypto/qat: cleanup unused and useless trace Tomasz Jozwiak
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 2/5] crypto/qat: move to dynamic logging for non-dp trace Tomasz Jozwiak
@ 2018-06-14 11:03   ` Tomasz Jozwiak
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 4/5] crypto/qat: move to dynamic logging for data-path trace Tomasz Jozwiak
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Tomasz Jozwiak @ 2018-06-14 11:03 UTC (permalink / raw)
  To: fiona.trahe, tomaszx.jozwiak, dev

From: Fiona Trahe <fiona.trahe@intel.com>

Rename PMD_DRV_LOG to the more appropriate name QAT_LOG.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 drivers/crypto/qat/qat_common.c      | 12 ++---
 drivers/crypto/qat/qat_device.c      | 12 ++---
 drivers/crypto/qat/qat_logs.h        |  2 +-
 drivers/crypto/qat/qat_qp.c          | 54 ++++++++++-----------
 drivers/crypto/qat/qat_sym.c         | 18 +++----
 drivers/crypto/qat/qat_sym.h         |  2 +-
 drivers/crypto/qat/qat_sym_pmd.c     | 14 +++---
 drivers/crypto/qat/qat_sym_session.c | 94 ++++++++++++++++++------------------
 8 files changed, 104 insertions(+), 104 deletions(-)

diff --git a/drivers/crypto/qat/qat_common.c b/drivers/crypto/qat/qat_common.c
index c10c142..c206d3b 100644
--- a/drivers/crypto/qat/qat_common.c
+++ b/drivers/crypto/qat/qat_common.c
@@ -28,7 +28,7 @@ qat_sgl_fill_array(struct rte_mbuf *buf, uint64_t buf_start,
 	buf = buf->next;
 	while (buf) {
 		if (unlikely(nr == QAT_SGL_MAX_NUMBER)) {
-			PMD_DRV_LOG(ERR,
+			QAT_LOG(ERR,
 				"QAT PMD exceeded size of QAT SGL entry(%u)",
 					QAT_SGL_MAX_NUMBER);
 			return -EINVAL;
@@ -61,7 +61,7 @@ void qat_stats_get(struct qat_pci_device *dev,
 	struct qat_qp **qp;
 
 	if (stats == NULL || dev == NULL || service >= QAT_SERVICE_INVALID) {
-		PMD_DRV_LOG(ERR, "invalid param: stats %p, dev %p, service %d",
+		QAT_LOG(ERR, "invalid param: stats %p, dev %p, service %d",
 				stats, dev, service);
 		return;
 	}
@@ -69,7 +69,7 @@ void qat_stats_get(struct qat_pci_device *dev,
 	qp = dev->qps_in_use[service];
 	for (i = 0; i < ADF_MAX_QPS_ON_ANY_SERVICE; i++) {
 		if (qp[i] == NULL) {
-			PMD_DRV_LOG(DEBUG, "Service %d Uninitialised qp %d",
+			QAT_LOG(DEBUG, "Service %d Uninitialised qp %d",
 					service, i);
 			continue;
 		}
@@ -88,7 +88,7 @@ void qat_stats_reset(struct qat_pci_device *dev,
 	struct qat_qp **qp;
 
 	if (dev == NULL || service >= QAT_SERVICE_INVALID) {
-		PMD_DRV_LOG(ERR, "invalid param: dev %p, service %d",
+		QAT_LOG(ERR, "invalid param: dev %p, service %d",
 				dev, service);
 		return;
 	}
@@ -96,12 +96,12 @@ void qat_stats_reset(struct qat_pci_device *dev,
 	qp = dev->qps_in_use[service];
 	for (i = 0; i < ADF_MAX_QPS_ON_ANY_SERVICE; i++) {
 		if (qp[i] == NULL) {
-			PMD_DRV_LOG(DEBUG, "Service %d Uninitialised qp %d",
+			QAT_LOG(DEBUG, "Service %d Uninitialised qp %d",
 					service, i);
 			continue;
 		}
 		memset(&(qp[i]->stats), 0, sizeof(qp[i]->stats));
 	}
 
-	PMD_DRV_LOG(DEBUG, "QAT: %d stats cleared", service);
+	QAT_LOG(DEBUG, "QAT: %d stats cleared", service);
 }
diff --git a/drivers/crypto/qat/qat_device.c b/drivers/crypto/qat/qat_device.c
index 0cab2e9..4b97c84 100644
--- a/drivers/crypto/qat/qat_device.c
+++ b/drivers/crypto/qat/qat_device.c
@@ -105,14 +105,14 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
 	snprintf(name+strlen(name), QAT_DEV_NAME_MAX_LEN-strlen(name), "_qat");
 	if (qat_pci_get_named_dev(name) != NULL) {
-		PMD_DRV_LOG(ERR, "QAT device with name %s already allocated!",
+		QAT_LOG(ERR, "QAT device with name %s already allocated!",
 				name);
 		return NULL;
 	}
 
 	qat_dev_id = qat_pci_find_free_device_index();
 	if (qat_dev_id == RTE_PMD_QAT_MAX_PCI_DEVICES) {
-		PMD_DRV_LOG(ERR, "Reached maximum number of QAT devices");
+		QAT_LOG(ERR, "Reached maximum number of QAT devices");
 		return NULL;
 	}
 
@@ -131,7 +131,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)
 		qat_dev->qat_dev_gen = QAT_GEN2;
 		break;
 	default:
-		PMD_DRV_LOG(ERR, "Invalid dev_id, can't determine generation");
+		QAT_LOG(ERR, "Invalid dev_id, can't determine generation");
 		return NULL;
 	}
 
@@ -141,7 +141,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)
 
 	qat_nb_pci_devices++;
 
-	PMD_DRV_LOG(DEBUG, "QAT device %d allocated, name %s, total QATs %d",
+	QAT_LOG(DEBUG, "QAT device %d allocated, name %s, total QATs %d",
 			qat_dev->qat_dev_id, qat_dev->name, qat_nb_pci_devices);
 
 	return qat_dev;
@@ -168,7 +168,7 @@ qat_pci_device_release(struct rte_pci_device *pci_dev)
 		qat_dev->attached = QAT_DETACHED;
 		qat_nb_pci_devices--;
 	}
-	PMD_DRV_LOG(DEBUG, "QAT device %s released, total QATs %d",
+	QAT_LOG(DEBUG, "QAT device %s released, total QATs %d",
 				name, qat_nb_pci_devices);
 	return 0;
 }
@@ -189,7 +189,7 @@ static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	int ret = 0;
 	struct qat_pci_device *qat_pci_dev;
 
-	PMD_DRV_LOG(DEBUG, "Found QAT device at %02x:%02x.%x",
+	QAT_LOG(DEBUG, "Found QAT device at %02x:%02x.%x",
 			pci_dev->addr.bus,
 			pci_dev->addr.devid,
 			pci_dev->addr.function);
diff --git a/drivers/crypto/qat/qat_logs.h b/drivers/crypto/qat/qat_logs.h
index b00a06b..b12f754 100644
--- a/drivers/crypto/qat/qat_logs.h
+++ b/drivers/crypto/qat/qat_logs.h
@@ -7,7 +7,7 @@
 
 extern int qat_gen_logtype;
 
-#define PMD_DRV_LOG(level, fmt, args...)			\
+#define QAT_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, qat_gen_logtype,		\
 			"%s(): " fmt "\n", __func__, ## args)
 
diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index 531752b..32c1759 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -125,12 +125,12 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,
 		if (((size_t)queue_size <= mz->len) &&
 				((socket_id == SOCKET_ID_ANY) ||
 					(socket_id == mz->socket_id))) {
-			PMD_DRV_LOG(DEBUG, "re-use memzone already "
+			QAT_LOG(DEBUG, "re-use memzone already "
 					"allocated for %s", queue_name);
 			return mz;
 		}
 
-		PMD_DRV_LOG(ERR, "Incompatible memzone already "
+		QAT_LOG(ERR, "Incompatible memzone already "
 				"allocated %s, size %u, socket %d. "
 				"Requested size %u, socket %u",
 				queue_name, (uint32_t)mz->len,
@@ -138,7 +138,7 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,
 		return NULL;
 	}
 
-	PMD_DRV_LOG(DEBUG, "Allocate memzone for %s, size %u on socket %u",
+	QAT_LOG(DEBUG, "Allocate memzone for %s, size %u on socket %u",
 					queue_name, queue_size, socket_id);
 	return rte_memzone_reserve_aligned(queue_name, queue_size,
 		socket_id, RTE_MEMZONE_IOVA_CONTIG, queue_size);
@@ -155,18 +155,18 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 	char op_cookie_pool_name[RTE_RING_NAMESIZE];
 	uint32_t i;
 
-	PMD_DRV_LOG(DEBUG, "Setup qp %u on qat pci device %d gen %d",
+	QAT_LOG(DEBUG, "Setup qp %u on qat pci device %d gen %d",
 		queue_pair_id, qat_dev->qat_dev_id, qat_dev->qat_dev_gen);
 
 	if ((qat_qp_conf->nb_descriptors > ADF_MAX_DESC) ||
 		(qat_qp_conf->nb_descriptors < ADF_MIN_DESC)) {
-		PMD_DRV_LOG(ERR, "Can't create qp for %u descriptors",
+		QAT_LOG(ERR, "Can't create qp for %u descriptors",
 				qat_qp_conf->nb_descriptors);
 		return -EINVAL;
 	}
 
 	if (pci_dev->mem_resource[0].addr == NULL) {
-		PMD_DRV_LOG(ERR, "Could not find VF config space "
+		QAT_LOG(ERR, "Could not find VF config space "
 				"(UIO driver attached?).");
 		return -EINVAL;
 	}
@@ -175,7 +175,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 	qp = rte_zmalloc("qat PMD qp metadata",
 			sizeof(*qp), RTE_CACHE_LINE_SIZE);
 	if (qp == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to alloc mem for qp struct");
+		QAT_LOG(ERR, "Failed to alloc mem for qp struct");
 		return -ENOMEM;
 	}
 	qp->nb_descriptors = qat_qp_conf->nb_descriptors;
@@ -183,7 +183,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 			qat_qp_conf->nb_descriptors * sizeof(*qp->op_cookies),
 			RTE_CACHE_LINE_SIZE);
 	if (qp->op_cookies == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to alloc mem for cookie");
+		QAT_LOG(ERR, "Failed to alloc mem for cookie");
 		rte_free(qp);
 		return -ENOMEM;
 	}
@@ -193,14 +193,14 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 
 	if (qat_queue_create(qat_dev, &(qp->tx_q), qat_qp_conf,
 					ADF_RING_DIR_TX) != 0) {
-		PMD_DRV_LOG(ERR, "Tx queue create failed "
+		QAT_LOG(ERR, "Tx queue create failed "
 				"queue_pair_id=%u", queue_pair_id);
 		goto create_err;
 	}
 
 	if (qat_queue_create(qat_dev, &(qp->rx_q), qat_qp_conf,
 					ADF_RING_DIR_RX) != 0) {
-		PMD_DRV_LOG(ERR, "Rx queue create failed "
+		QAT_LOG(ERR, "Rx queue create failed "
 				"queue_pair_id=%hu", queue_pair_id);
 		qat_queue_delete(&(qp->tx_q));
 		goto create_err;
@@ -215,7 +215,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 		pci_dev->driver->driver.name, qat_dev->qat_dev_id,
 		qat_qp_conf->service_str, queue_pair_id);
 
-	PMD_DRV_LOG(DEBUG, "cookiepool: %s", op_cookie_pool_name);
+	QAT_LOG(DEBUG, "cookiepool: %s", op_cookie_pool_name);
 	qp->op_cookie_pool = rte_mempool_lookup(op_cookie_pool_name);
 	if (qp->op_cookie_pool == NULL)
 		qp->op_cookie_pool = rte_mempool_create(op_cookie_pool_name,
@@ -224,14 +224,14 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 				NULL, NULL, NULL, NULL, qat_qp_conf->socket_id,
 				0);
 	if (!qp->op_cookie_pool) {
-		PMD_DRV_LOG(ERR, "QAT PMD Cannot create"
+		QAT_LOG(ERR, "QAT PMD Cannot create"
 				" op mempool");
 		goto create_err;
 	}
 
 	for (i = 0; i < qp->nb_descriptors; i++) {
 		if (rte_mempool_get(qp->op_cookie_pool, &qp->op_cookies[i])) {
-			PMD_DRV_LOG(ERR, "QAT PMD Cannot get op_cookie");
+			QAT_LOG(ERR, "QAT PMD Cannot get op_cookie");
 			goto create_err;
 		}
 	}
@@ -241,7 +241,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 	qp->service_type = qat_qp_conf->hw->service_type;
 	qp->qat_dev = qat_dev;
 
-	PMD_DRV_LOG(DEBUG, "QP setup complete: id: %d, cookiepool: %s",
+	QAT_LOG(DEBUG, "QP setup complete: id: %d, cookiepool: %s",
 			queue_pair_id, op_cookie_pool_name);
 
 	*qp_addr = qp;
@@ -261,11 +261,11 @@ int qat_qp_release(struct qat_qp **qp_addr)
 	uint32_t i;
 
 	if (qp == NULL) {
-		PMD_DRV_LOG(DEBUG, "qp already freed");
+		QAT_LOG(DEBUG, "qp already freed");
 		return 0;
 	}
 
-	PMD_DRV_LOG(DEBUG, "Free qp on qat_pci device %d",
+	QAT_LOG(DEBUG, "Free qp on qat_pci device %d",
 				qp->qat_dev->qat_dev_id);
 
 	/* Don't free memory if there are still responses to be processed */
@@ -298,10 +298,10 @@ static void qat_queue_delete(struct qat_queue *queue)
 	int status = 0;
 
 	if (queue == NULL) {
-		PMD_DRV_LOG(DEBUG, "Invalid queue");
+		QAT_LOG(DEBUG, "Invalid queue");
 		return;
 	}
-	PMD_DRV_LOG(DEBUG, "Free ring %d, memzone: %s",
+	QAT_LOG(DEBUG, "Free ring %d, memzone: %s",
 			queue->hw_queue_number, queue->memz_name);
 
 	mz = rte_memzone_lookup(queue->memz_name);
@@ -310,10 +310,10 @@ static void qat_queue_delete(struct qat_queue *queue)
 		memset(queue->base_addr, 0x7F, queue->queue_size);
 		status = rte_memzone_free(mz);
 		if (status != 0)
-			PMD_DRV_LOG(ERR, "Error %d on freeing queue %s",
+			QAT_LOG(ERR, "Error %d on freeing queue %s",
 					status, queue->memz_name);
 	} else {
-		PMD_DRV_LOG(DEBUG, "queue %s doesn't exist",
+		QAT_LOG(DEBUG, "queue %s doesn't exist",
 				queue->memz_name);
 	}
 }
@@ -336,7 +336,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
 			qp_conf->hw->tx_ring_num : qp_conf->hw->rx_ring_num);
 
 	if (desc_size > ADF_MSG_SIZE_TO_BYTES(ADF_MAX_MSG_SIZE)) {
-		PMD_DRV_LOG(ERR, "Invalid descriptor size %d", desc_size);
+		QAT_LOG(ERR, "Invalid descriptor size %d", desc_size);
 		return -EINVAL;
 	}
 
@@ -351,7 +351,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
 	qp_mz = queue_dma_zone_reserve(queue->memz_name, queue_size_bytes,
 			qp_conf->socket_id);
 	if (qp_mz == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to allocate ring memzone");
+		QAT_LOG(ERR, "Failed to allocate ring memzone");
 		return -ENOMEM;
 	}
 
@@ -359,7 +359,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
 	queue->base_phys_addr = qp_mz->iova;
 	if (qat_qp_check_queue_alignment(queue->base_phys_addr,
 			queue_size_bytes)) {
-		PMD_DRV_LOG(ERR, "Invalid alignment on queue create "
+		QAT_LOG(ERR, "Invalid alignment on queue create "
 					" 0x%"PRIx64"\n",
 					queue->base_phys_addr);
 		ret = -EFAULT;
@@ -368,7 +368,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
 
 	if (adf_verify_queue_size(desc_size, qp_conf->nb_descriptors,
 			&(queue->queue_size)) != 0) {
-		PMD_DRV_LOG(ERR, "Invalid num inflights");
+		QAT_LOG(ERR, "Invalid num inflights");
 		ret = -EINVAL;
 		goto queue_create_err;
 	}
@@ -378,7 +378,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
 	queue->modulo_mask = (1 << ADF_RING_SIZE_MODULO(queue->queue_size)) - 1;
 
 	if (queue->max_inflights < 2) {
-		PMD_DRV_LOG(ERR, "Invalid num inflights");
+		QAT_LOG(ERR, "Invalid num inflights");
 		ret = -EINVAL;
 		goto queue_create_err;
 	}
@@ -399,7 +399,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
 	WRITE_CSR_RING_BASE(io_addr, queue->hw_bundle_number,
 			queue->hw_queue_number, queue_base);
 
-	PMD_DRV_LOG(DEBUG, "RING: Name:%s, size in CSR: %u, in bytes %u,"
+	QAT_LOG(DEBUG, "RING: Name:%s, size in CSR: %u, in bytes %u,"
 		" nb msgs %u, msg_size %u, max_inflights %u modulo mask %u",
 			queue->memz_name,
 			queue->queue_size, queue_size_bytes,
@@ -432,7 +432,7 @@ static int adf_verify_queue_size(uint32_t msg_size, uint32_t msg_num,
 			*p_queue_size_for_csr = i;
 			return 0;
 		}
-	PMD_DRV_LOG(ERR, "Invalid ring size %d", msg_size * msg_num);
+	QAT_LOG(ERR, "Invalid ring size %d", msg_size * msg_num);
 	return -EINVAL;
 }
 
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 887d4eb..7bedad3 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -39,7 +39,7 @@ bpi_cipher_decrypt(uint8_t *src, uint8_t *dst,
 	return 0;
 
 cipher_decrypt_err:
-	PMD_DRV_LOG(ERR, "libcrypto ECB cipher decrypt for BPI IV failed");
+	QAT_LOG(ERR, "libcrypto ECB cipher decrypt for BPI IV failed");
 	return -EINVAL;
 }
 
@@ -165,14 +165,14 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 
 #ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
 	if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
-		PMD_DRV_LOG(ERR, "QAT PMD only supports symmetric crypto "
+		QAT_LOG(ERR, "QAT PMD only supports symmetric crypto "
 				"operation requests, op (%p) is not a "
 				"symmetric operation.", op);
 		return -EINVAL;
 	}
 #endif
 	if (unlikely(op->sess_type == RTE_CRYPTO_OP_SESSIONLESS)) {
-		PMD_DRV_LOG(ERR, "QAT PMD only supports session oriented"
+		QAT_LOG(ERR, "QAT PMD only supports session oriented"
 				" requests, op (%p) is sessionless.", op);
 		return -EINVAL;
 	}
@@ -181,12 +181,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 			op->sym->session, cryptodev_qat_driver_id);
 
 	if (unlikely(ctx == NULL)) {
-		PMD_DRV_LOG(ERR, "Session was not created for this device");
+		QAT_LOG(ERR, "Session was not created for this device");
 		return -EINVAL;
 	}
 
 	if (unlikely(ctx->min_qat_dev_gen > qat_dev_gen)) {
-		PMD_DRV_LOG(ERR, "Session alg not supported on this device gen");
+		QAT_LOG(ERR, "Session alg not supported on this device gen");
 		op->status = RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
 		return -EINVAL;
 	}
@@ -231,7 +231,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 				(cipher_param->cipher_length % BYTE_LENGTH != 0)
 				 || (cipher_param->cipher_offset
 							% BYTE_LENGTH != 0))) {
-				PMD_DRV_LOG(ERR,
+				QAT_LOG(ERR,
 		  "SNOW3G/KASUMI/ZUC in QAT PMD only supports byte aligned values");
 				op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 				return -EINVAL;
@@ -265,7 +265,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 				ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3) {
 			if (unlikely((auth_param->auth_off % BYTE_LENGTH != 0)
 				|| (auth_param->auth_len % BYTE_LENGTH != 0))) {
-				PMD_DRV_LOG(ERR,
+				QAT_LOG(ERR,
 		"For SNOW3G/KASUMI/ZUC, QAT PMD only supports byte aligned values");
 				op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 				return -EINVAL;
@@ -501,7 +501,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 				&cookie->qat_sgl_src,
 				qat_req->comn_mid.src_length);
 		if (ret) {
-			PMD_DRV_LOG(ERR, "QAT PMD Cannot fill sgl array");
+			QAT_LOG(ERR, "QAT PMD Cannot fill sgl array");
 			return ret;
 		}
 
@@ -516,7 +516,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 						qat_req->comn_mid.dst_length);
 
 			if (ret) {
-				PMD_DRV_LOG(ERR, "QAT PMD Cannot "
+				QAT_LOG(ERR, "QAT PMD Cannot "
 						"fill sgl array");
 				return ret;
 			}
diff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h
index ddd0f47..b693a4d 100644
--- a/drivers/crypto/qat/qat_sym.h
+++ b/drivers/crypto/qat/qat_sym.h
@@ -59,7 +59,7 @@ bpi_cipher_encrypt(uint8_t *src, uint8_t *dst,
 	return 0;
 
 cipher_encrypt_err:
-	PMD_DRV_LOG(ERR, "libcrypto ECB cipher encrypt failed");
+	QAT_LOG(ERR, "libcrypto ECB cipher encrypt failed");
 	return -EINVAL;
 }
 
diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c
index 8797c0e..1156390 100644
--- a/drivers/crypto/qat/qat_sym_pmd.c
+++ b/drivers/crypto/qat/qat_sym_pmd.c
@@ -85,7 +85,7 @@ static void qat_sym_stats_get(struct rte_cryptodev *dev,
 	struct qat_sym_dev_private *qat_priv;
 
 	if (stats == NULL || dev == NULL) {
-		PMD_DRV_LOG(ERR, "invalid ptr: stats %p, dev %p", stats, dev);
+		QAT_LOG(ERR, "invalid ptr: stats %p, dev %p", stats, dev);
 		return;
 	}
 	qat_priv = dev->data->dev_private;
@@ -102,7 +102,7 @@ static void qat_sym_stats_reset(struct rte_cryptodev *dev)
 	struct qat_sym_dev_private *qat_priv;
 
 	if (dev == NULL) {
-		PMD_DRV_LOG(ERR, "invalid cryptodev ptr %p", dev);
+		QAT_LOG(ERR, "invalid cryptodev ptr %p", dev);
 		return;
 	}
 	qat_priv = dev->data->dev_private;
@@ -115,7 +115,7 @@ static int qat_sym_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)
 {
 	struct qat_sym_dev_private *qat_private = dev->data->dev_private;
 
-	PMD_DRV_LOG(DEBUG, "Release sym qp %u on device %d",
+	QAT_LOG(DEBUG, "Release sym qp %u on device %d",
 				queue_pair_id, dev->data->dev_id);
 
 	qat_private->qat_dev->qps_in_use[QAT_SERVICE_SYMMETRIC][queue_pair_id]
@@ -149,7 +149,7 @@ static int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 			return ret;
 	}
 	if (qp_id >= qat_qps_per_service(sym_hw_qps, QAT_SERVICE_SYMMETRIC)) {
-		PMD_DRV_LOG(ERR, "qp_id %u invalid for this device", qp_id);
+		QAT_LOG(ERR, "qp_id %u invalid for this device", qp_id);
 		return -EINVAL;
 	}
 
@@ -253,7 +253,7 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev)
 
 	snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, "%s_%s",
 			qat_pci_dev->name, "sym");
-	PMD_DRV_LOG(DEBUG, "Creating QAT SYM device %s", name);
+	QAT_LOG(DEBUG, "Creating QAT SYM device %s", name);
 
 	/* Populate subset device to use in cryptodev device creation */
 	qat_pci_dev->sym_rte_dev.driver = &cryptodev_qat_sym_driver;
@@ -293,13 +293,13 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev)
 		break;
 	default:
 		internals->qat_dev_capabilities = qat_gen2_sym_capabilities;
-		PMD_DRV_LOG(DEBUG,
+		QAT_LOG(DEBUG,
 			"QAT gen %d capabilities unknown, default to GEN2",
 					qat_pci_dev->qat_dev_gen);
 		break;
 	}
 
-	PMD_DRV_LOG(DEBUG, "Created QAT SYM device %s as cryptodev instance %d",
+	QAT_LOG(DEBUG, "Created QAT SYM device %s as cryptodev instance %d",
 			cryptodev->data->name, internals->sym_dev_id);
 	return 0;
 }
diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 83d0fb1..dc1c200 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -217,7 +217,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_AES_CBC:
 		if (qat_sym_validate_aes_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES cipher key size");
+			QAT_LOG(ERR, "Invalid AES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -226,7 +226,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_AES_CTR:
 		if (qat_sym_validate_aes_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES cipher key size");
+			QAT_LOG(ERR, "Invalid AES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -235,7 +235,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_SNOW3G_UEA2:
 		if (qat_sym_validate_snow3g_key(cipher_xform->key.length,
 					&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid SNOW 3G cipher key size");
+			QAT_LOG(ERR, "Invalid SNOW 3G cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -247,7 +247,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_KASUMI_F8:
 		if (qat_sym_validate_kasumi_key(cipher_xform->key.length,
 					&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid KASUMI cipher key size");
+			QAT_LOG(ERR, "Invalid KASUMI cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -256,7 +256,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_3DES_CBC:
 		if (qat_sym_validate_3des_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid 3DES cipher key size");
+			QAT_LOG(ERR, "Invalid 3DES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -265,7 +265,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_DES_CBC:
 		if (qat_sym_validate_des_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid DES cipher key size");
+			QAT_LOG(ERR, "Invalid DES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -274,7 +274,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_3DES_CTR:
 		if (qat_sym_validate_3des_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid 3DES cipher key size");
+			QAT_LOG(ERR, "Invalid 3DES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -287,12 +287,12 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 					cipher_xform->key.data,
 					&session->bpi_ctx);
 		if (ret != 0) {
-			PMD_DRV_LOG(ERR, "failed to create DES BPI ctx");
+			QAT_LOG(ERR, "failed to create DES BPI ctx");
 			goto error_out;
 		}
 		if (qat_sym_validate_des_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid DES cipher key size");
+			QAT_LOG(ERR, "Invalid DES cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -305,12 +305,12 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 					cipher_xform->key.data,
 					&session->bpi_ctx);
 		if (ret != 0) {
-			PMD_DRV_LOG(ERR, "failed to create AES BPI ctx");
+			QAT_LOG(ERR, "failed to create AES BPI ctx");
 			goto error_out;
 		}
 		if (qat_sym_validate_aes_docsisbpi_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES DOCSISBPI key size");
+			QAT_LOG(ERR, "Invalid AES DOCSISBPI key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -319,7 +319,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_ZUC_EEA3:
 		if (!qat_is_cipher_alg_supported(
 			cipher_xform->algo, internals)) {
-			PMD_DRV_LOG(ERR, "%s not supported on this device",
+			QAT_LOG(ERR, "%s not supported on this device",
 				rte_crypto_cipher_algorithm_strings
 					[cipher_xform->algo]);
 			ret = -ENOTSUP;
@@ -327,7 +327,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 		}
 		if (qat_sym_validate_zuc_key(cipher_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid ZUC cipher key size");
+			QAT_LOG(ERR, "Invalid ZUC cipher key size");
 			ret = -EINVAL;
 			goto error_out;
 		}
@@ -338,12 +338,12 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_AES_F8:
 	case RTE_CRYPTO_CIPHER_AES_XTS:
 	case RTE_CRYPTO_CIPHER_ARC4:
-		PMD_DRV_LOG(ERR, "Crypto QAT PMD: Unsupported Cipher alg %u",
+		QAT_LOG(ERR, "Crypto QAT PMD: Unsupported Cipher alg %u",
 				cipher_xform->algo);
 		ret = -ENOTSUP;
 		goto error_out;
 	default:
-		PMD_DRV_LOG(ERR, "Crypto: Undefined Cipher specified %u\n",
+		QAT_LOG(ERR, "Crypto: Undefined Cipher specified %u\n",
 				cipher_xform->algo);
 		ret = -EINVAL;
 		goto error_out;
@@ -388,7 +388,7 @@ qat_sym_session_configure(struct rte_cryptodev *dev,
 
 	ret = qat_sym_session_set_parameters(dev, xform, sess_private_data);
 	if (ret != 0) {
-		PMD_DRV_LOG(ERR,
+		QAT_LOG(ERR,
 		    "Crypto QAT PMD: failed to configure session parameters");
 
 		/* Return session to mempool */
@@ -419,7 +419,7 @@ qat_sym_session_set_parameters(struct rte_cryptodev *dev,
 	/* Get requested QAT command id */
 	qat_cmd_id = qat_get_cmd_id(xform);
 	if (qat_cmd_id < 0 || qat_cmd_id >= ICP_QAT_FW_LA_CMD_DELIMITER) {
-		PMD_DRV_LOG(ERR, "Unsupported xform chain requested");
+		QAT_LOG(ERR, "Unsupported xform chain requested");
 		return -ENOTSUP;
 	}
 	session->qat_cmd = (enum icp_qat_fw_la_cmd_id)qat_cmd_id;
@@ -477,11 +477,11 @@ qat_sym_session_set_parameters(struct rte_cryptodev *dev,
 	case ICP_QAT_FW_LA_CMD_AUTH_PRE_COMP:
 	case ICP_QAT_FW_LA_CMD_CIPHER_PRE_COMP:
 	case ICP_QAT_FW_LA_CMD_DELIMITER:
-	PMD_DRV_LOG(ERR, "Unsupported Service %u",
+	QAT_LOG(ERR, "Unsupported Service %u",
 		session->qat_cmd);
 		return -ENOTSUP;
 	default:
-	PMD_DRV_LOG(ERR, "Unsupported Service %u",
+	QAT_LOG(ERR, "Unsupported Service %u",
 		session->qat_cmd);
 		return -ENOTSUP;
 	}
@@ -521,7 +521,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_AUTH_AES_GMAC:
 		if (qat_sym_validate_aes_key(auth_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES key size");
+			QAT_LOG(ERR, "Invalid AES key size");
 			return -EINVAL;
 		}
 		session->qat_mode = ICP_QAT_HW_CIPHER_CTR_MODE;
@@ -542,7 +542,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
 		break;
 	case RTE_CRYPTO_AUTH_ZUC_EIA3:
 		if (!qat_is_auth_alg_supported(auth_xform->algo, internals)) {
-			PMD_DRV_LOG(ERR, "%s not supported on this device",
+			QAT_LOG(ERR, "%s not supported on this device",
 				rte_crypto_auth_algorithm_strings
 				[auth_xform->algo]);
 			return -ENOTSUP;
@@ -557,11 +557,11 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
 	case RTE_CRYPTO_AUTH_MD5:
 	case RTE_CRYPTO_AUTH_AES_CMAC:
 	case RTE_CRYPTO_AUTH_AES_CBC_MAC:
-		PMD_DRV_LOG(ERR, "Crypto: Unsupported hash alg %u",
+		QAT_LOG(ERR, "Crypto: Unsupported hash alg %u",
 				auth_xform->algo);
 		return -ENOTSUP;
 	default:
-		PMD_DRV_LOG(ERR, "Crypto: Undefined Hash algo %u specified",
+		QAT_LOG(ERR, "Crypto: Undefined Hash algo %u specified",
 				auth_xform->algo);
 		return -EINVAL;
 	}
@@ -645,7 +645,7 @@ qat_sym_session_configure_aead(struct rte_crypto_sym_xform *xform,
 	case RTE_CRYPTO_AEAD_AES_GCM:
 		if (qat_sym_validate_aes_key(aead_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES key size");
+			QAT_LOG(ERR, "Invalid AES key size");
 			return -EINVAL;
 		}
 		session->qat_mode = ICP_QAT_HW_CIPHER_CTR_MODE;
@@ -654,14 +654,14 @@ qat_sym_session_configure_aead(struct rte_crypto_sym_xform *xform,
 	case RTE_CRYPTO_AEAD_AES_CCM:
 		if (qat_sym_validate_aes_key(aead_xform->key.length,
 				&session->qat_cipher_alg) != 0) {
-			PMD_DRV_LOG(ERR, "Invalid AES key size");
+			QAT_LOG(ERR, "Invalid AES key size");
 			return -EINVAL;
 		}
 		session->qat_mode = ICP_QAT_HW_CIPHER_CTR_MODE;
 		session->qat_hash_alg = ICP_QAT_HW_AUTH_ALGO_AES_CBC_MAC;
 		break;
 	default:
-		PMD_DRV_LOG(ERR, "Crypto: Undefined AEAD specified %u\n",
+		QAT_LOG(ERR, "Crypto: Undefined AEAD specified %u\n",
 				aead_xform->algo);
 		return -EINVAL;
 	}
@@ -737,7 +737,7 @@ int qat_cipher_get_block_size(enum icp_qat_hw_cipher_algo qat_cipher_alg)
 	case ICP_QAT_HW_CIPHER_ALGO_AES256:
 		return ICP_QAT_HW_AES_BLK_SZ;
 	default:
-		PMD_DRV_LOG(ERR, "invalid block cipher alg %u", qat_cipher_alg);
+		QAT_LOG(ERR, "invalid block cipher alg %u", qat_cipher_alg);
 		return -EFAULT;
 	};
 	return -EFAULT;
@@ -795,7 +795,7 @@ static int qat_hash_get_state1_size(enum icp_qat_hw_auth_algo qat_hash_alg)
 		return QAT_HW_ROUND_UP(ICP_QAT_HW_SHA512_STATE1_SZ,
 						QAT_HW_DEFAULT_ALIGNMENT);
 	default:
-		PMD_DRV_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
+		QAT_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
 		return -EFAULT;
 	};
 	return -EFAULT;
@@ -821,7 +821,7 @@ static int qat_hash_get_digest_size(enum icp_qat_hw_auth_algo qat_hash_alg)
 		/* return maximum digest size in this case */
 		return ICP_QAT_HW_SHA512_STATE1_SZ;
 	default:
-		PMD_DRV_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
+		QAT_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
 		return -EFAULT;
 	};
 	return -EFAULT;
@@ -849,7 +849,7 @@ static int qat_hash_get_block_size(enum icp_qat_hw_auth_algo qat_hash_alg)
 		/* return maximum block size in this case */
 		return SHA512_CBLOCK;
 	default:
-		PMD_DRV_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
+		QAT_LOG(ERR, "invalid hash alg %u", qat_hash_alg);
 		return -EFAULT;
 	};
 	return -EFAULT;
@@ -981,7 +981,7 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,
 			return -EFAULT;
 		break;
 	default:
-		PMD_DRV_LOG(ERR, "invalid hash alg %u", hash_alg);
+		QAT_LOG(ERR, "invalid hash alg %u", hash_alg);
 		return -EFAULT;
 	}
 
@@ -1021,7 +1021,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 		in = rte_zmalloc("working mem for key",
 				ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ, 16);
 		if (in == NULL) {
-			PMD_DRV_LOG(ERR, "Failed to alloc memory");
+			QAT_LOG(ERR, "Failed to alloc memory");
 			return -ENOMEM;
 		}
 
@@ -1056,7 +1056,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 		in = rte_zmalloc("working mem for key",
 				ICP_QAT_HW_GALOIS_H_SZ, 16);
 		if (in == NULL) {
-			PMD_DRV_LOG(ERR, "Failed to alloc memory");
+			QAT_LOG(ERR, "Failed to alloc memory");
 			return -ENOMEM;
 		}
 
@@ -1081,7 +1081,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 	memset(opad, 0, block_size);
 
 	if (auth_keylen > (unsigned int)block_size) {
-		PMD_DRV_LOG(ERR, "invalid keylen %u", auth_keylen);
+		QAT_LOG(ERR, "invalid keylen %u", auth_keylen);
 		return -EFAULT;
 	}
 	rte_memcpy(ipad, auth_key, auth_keylen);
@@ -1098,7 +1098,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 	if (partial_hash_compute(hash_alg, ipad, p_state_buf)) {
 		memset(ipad, 0, block_size);
 		memset(opad, 0, block_size);
-		PMD_DRV_LOG(ERR, "ipad precompute failed");
+		QAT_LOG(ERR, "ipad precompute failed");
 		return -EFAULT;
 	}
 
@@ -1110,7 +1110,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 	if (partial_hash_compute(hash_alg, opad, p_state_buf + *p_state_len)) {
 		memset(ipad, 0, block_size);
 		memset(opad, 0, block_size);
-		PMD_DRV_LOG(ERR, "opad precompute failed");
+		QAT_LOG(ERR, "opad precompute failed");
 		return -EFAULT;
 	}
 
@@ -1230,7 +1230,7 @@ int qat_sym_session_aead_create_cd_cipher(struct qat_sym_session *cdesc,
 					ICP_QAT_FW_SLICE_DRAM_WR);
 		cdesc->cd_cur_ptr = (uint8_t *)&cdesc->cd;
 	} else if (cdesc->qat_cmd != ICP_QAT_FW_LA_CMD_HASH_CIPHER) {
-		PMD_DRV_LOG(ERR, "Invalid param, must be a cipher command.");
+		QAT_LOG(ERR, "Invalid param, must be a cipher command.");
 		return -EFAULT;
 	}
 
@@ -1379,7 +1379,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 				ICP_QAT_FW_SLICE_DRAM_WR);
 		cdesc->cd_cur_ptr = (uint8_t *)&cdesc->cd;
 	} else if (cdesc->qat_cmd != ICP_QAT_FW_LA_CMD_CIPHER_HASH) {
-		PMD_DRV_LOG(ERR, "Invalid param, must be a hash command.");
+		QAT_LOG(ERR, "Invalid param, must be a hash command.");
 		return -EFAULT;
 	}
 
@@ -1424,7 +1424,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	case ICP_QAT_HW_AUTH_ALGO_SHA1:
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA1,
 			authkey, authkeylen, cdesc->cd_cur_ptr,	&state1_size)) {
-			PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+			QAT_LOG(ERR, "(SHA)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = RTE_ALIGN_CEIL(ICP_QAT_HW_SHA1_STATE2_SZ, 8);
@@ -1432,7 +1432,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	case ICP_QAT_HW_AUTH_ALGO_SHA224:
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA224,
 			authkey, authkeylen, cdesc->cd_cur_ptr, &state1_size)) {
-			PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+			QAT_LOG(ERR, "(SHA)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = ICP_QAT_HW_SHA224_STATE2_SZ;
@@ -1440,7 +1440,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	case ICP_QAT_HW_AUTH_ALGO_SHA256:
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA256,
 			authkey, authkeylen, cdesc->cd_cur_ptr,	&state1_size)) {
-			PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+			QAT_LOG(ERR, "(SHA)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = ICP_QAT_HW_SHA256_STATE2_SZ;
@@ -1448,7 +1448,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	case ICP_QAT_HW_AUTH_ALGO_SHA384:
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA384,
 			authkey, authkeylen, cdesc->cd_cur_ptr, &state1_size)) {
-			PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+			QAT_LOG(ERR, "(SHA)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = ICP_QAT_HW_SHA384_STATE2_SZ;
@@ -1456,7 +1456,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 	case ICP_QAT_HW_AUTH_ALGO_SHA512:
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_SHA512,
 			authkey, authkeylen, cdesc->cd_cur_ptr,	&state1_size)) {
-			PMD_DRV_LOG(ERR, "(SHA)precompute failed");
+			QAT_LOG(ERR, "(SHA)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = ICP_QAT_HW_SHA512_STATE2_SZ;
@@ -1466,7 +1466,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC,
 			authkey, authkeylen, cdesc->cd_cur_ptr + state1_size,
 			&state2_size)) {
-			PMD_DRV_LOG(ERR, "(XCBC)precompute failed");
+			QAT_LOG(ERR, "(XCBC)precompute failed");
 			return -EFAULT;
 		}
 		break;
@@ -1477,7 +1477,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 		if (qat_sym_do_precomputes(cdesc->qat_hash_alg,
 			authkey, authkeylen, cdesc->cd_cur_ptr + state1_size,
 			&state2_size)) {
-			PMD_DRV_LOG(ERR, "(GCM)precompute failed");
+			QAT_LOG(ERR, "(GCM)precompute failed");
 			return -EFAULT;
 		}
 		/*
@@ -1537,7 +1537,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 		if (qat_sym_do_precomputes(ICP_QAT_HW_AUTH_ALGO_MD5,
 			authkey, authkeylen, cdesc->cd_cur_ptr,
 			&state1_size)) {
-			PMD_DRV_LOG(ERR, "(MD5)precompute failed");
+			QAT_LOG(ERR, "(MD5)precompute failed");
 			return -EFAULT;
 		}
 		state2_size = ICP_QAT_HW_MD5_STATE2_SZ;
@@ -1592,7 +1592,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 			pTempKey[wordIndex] ^= KASUMI_F9_KEY_MODIFIER_4_BYTES;
 		break;
 	default:
-		PMD_DRV_LOG(ERR, "Invalid HASH alg %u", cdesc->qat_hash_alg);
+		QAT_LOG(ERR, "Invalid HASH alg %u", cdesc->qat_hash_alg);
 		return -EFAULT;
 	}
 
-- 
2.7.4

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

* [dpdk-dev] [PATCH v2 4/5] crypto/qat: move to dynamic logging for data-path trace
  2018-06-14 11:03 ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging Tomasz Jozwiak
                     ` (2 preceding siblings ...)
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 3/5] crypto/qat: rename log macro for non-dp logs Tomasz Jozwiak
@ 2018-06-14 11:03   ` Tomasz Jozwiak
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 5/5] doc/qat: document debug options Tomasz Jozwiak
  2018-06-14 14:05   ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging De Lara Guarch, Pablo
  5 siblings, 0 replies; 14+ messages in thread
From: Tomasz Jozwiak @ 2018-06-14 11:03 UTC (permalink / raw)
  To: fiona.trahe, tomaszx.jozwiak, dev

For all trace on the data-path move to dynamic logging.
Add new QAT_DP_LOG macro to separate from non-dp trace.
Use the overall RTE_LOG_DP_LEVEL to override and compile out
debug data-path trace.
Add "unlikely" in two appropriate error checks.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 config/common_base            |  2 --
 drivers/crypto/qat/qat_logs.c | 23 +++++++++++++++
 drivers/crypto/qat/qat_logs.h | 20 +++++++++++++
 drivers/crypto/qat/qat_sym.c  | 65 +++++++++++++++++++++----------------------
 drivers/crypto/qat/qat_sym.h  | 30 ++++++++++----------
 5 files changed, 90 insertions(+), 50 deletions(-)

diff --git a/config/common_base b/config/common_base
index 7a9b26e..c2b7126 100644
--- a/config/common_base
+++ b/config/common_base
@@ -486,8 +486,6 @@ CONFIG_RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS=2048
 # Compile PMD for QuickAssist based devices
 #
 CONFIG_RTE_LIBRTE_PMD_QAT=n
-CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_TX=n
-CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_RX=n
 #
 # Max. number of QuickAssist devices, which can be detected and attached
 #
diff --git a/drivers/crypto/qat/qat_logs.c b/drivers/crypto/qat/qat_logs.c
index fc8d9a7..fa3df85 100644
--- a/drivers/crypto/qat/qat_logs.c
+++ b/drivers/crypto/qat/qat_logs.c
@@ -3,8 +3,26 @@
  */
 
 #include <rte_log.h>
+#include <rte_hexdump.h>
+
+#include "qat_logs.h"
 
 int qat_gen_logtype;
+int qat_dp_logtype;
+
+int
+qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
+		const void *buf, unsigned int len)
+{
+	if (level > rte_log_get_global_level())
+		return 0;
+	if (level > (uint32_t)(rte_log_get_level(logtype)))
+		return 0;
+
+	rte_hexdump(rte_logs.file == NULL ? stderr : rte_logs.file,
+				title, buf, len);
+	return 0;
+}
 
 RTE_INIT(qat_pci_init_log);
 static void
@@ -14,4 +32,9 @@ qat_pci_init_log(void)
 	qat_gen_logtype = rte_log_register("pmd.qat_general");
 	if (qat_gen_logtype >= 0)
 		rte_log_set_level(qat_gen_logtype, RTE_LOG_NOTICE);
+
+	/* data-path logging for all services */
+	qat_dp_logtype = rte_log_register("pmd.qat_dp");
+	if (qat_dp_logtype >= 0)
+		rte_log_set_level(qat_dp_logtype, RTE_LOG_NOTICE);
 }
diff --git a/drivers/crypto/qat/qat_logs.h b/drivers/crypto/qat/qat_logs.h
index b12f754..4baea12 100644
--- a/drivers/crypto/qat/qat_logs.h
+++ b/drivers/crypto/qat/qat_logs.h
@@ -6,9 +6,29 @@
 #define _QAT_LOGS_H_
 
 extern int qat_gen_logtype;
+extern int qat_dp_logtype;
 
 #define QAT_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, qat_gen_logtype,		\
 			"%s(): " fmt "\n", __func__, ## args)
 
+#define QAT_DP_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, qat_dp_logtype,		\
+			"%s(): " fmt "\n", __func__, ## args)
+
+#define QAT_DP_HEXDUMP_LOG(level, title, buf, len)		\
+	qat_hexdump_log(RTE_LOG_ ## level, qat_dp_logtype, title, buf, len)
+
+/**
+ * qat_hexdump_log - Dump out memory in a special hex dump format.
+ *
+ * Dump out the message buffer in a special hex dump output format with
+ * characters printed for each line of 16 hex values. The message will be sent
+ * to the stream defined by rte_logs.file or to stderr in case of rte_logs.file
+ * is undefined.
+ */
+int
+qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
+		const void *buf, unsigned int len);
+
 #endif /* _QAT_LOGS_H_ */
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 7bedad3..17d63eb 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -6,12 +6,10 @@
 
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
-#include <rte_hexdump.h>
 #include <rte_crypto_sym.h>
 #include <rte_bus_pci.h>
 #include <rte_byteorder.h>
 
-#include "qat_logs.h"
 #include "qat_sym.h"
 
 /** Decrypt a single partial block
@@ -39,7 +37,7 @@ bpi_cipher_decrypt(uint8_t *src, uint8_t *dst,
 	return 0;
 
 cipher_decrypt_err:
-	QAT_LOG(ERR, "libcrypto ECB cipher decrypt for BPI IV failed");
+	QAT_DP_LOG(ERR, "libcrypto ECB cipher decrypt for BPI IV failed");
 	return -EINVAL;
 }
 
@@ -78,21 +76,21 @@ qat_bpicipher_preprocess(struct qat_sym_session *ctx,
 			iv = rte_crypto_op_ctod_offset(op, uint8_t *,
 					ctx->cipher_iv.offset);
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
-		rte_hexdump(stdout, "BPI: src before pre-process:", last_block,
-			last_block_len);
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+		QAT_DP_HEXDUMP_LOG(DEBUG, "BPI: src before pre-process:",
+			last_block, last_block_len);
 		if (sym_op->m_dst != NULL)
-			rte_hexdump(stdout, "BPI: dst before pre-process:", dst,
-				last_block_len);
+			QAT_DP_HEXDUMP_LOG(DEBUG, "BPI:dst before pre-process:",
+			dst, last_block_len);
 #endif
 		bpi_cipher_decrypt(last_block, dst, iv, block_len,
 				last_block_len, ctx->bpi_ctx);
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
-		rte_hexdump(stdout, "BPI: src after pre-process:", last_block,
-			last_block_len);
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+		QAT_DP_HEXDUMP_LOG(DEBUG, "BPI: src after pre-process:",
+			last_block, last_block_len);
 		if (sym_op->m_dst != NULL)
-			rte_hexdump(stdout, "BPI: dst after pre-process:", dst,
-				last_block_len);
+			QAT_DP_HEXDUMP_LOG(DEBUG, "BPI: dst after pre-process:",
+			dst, last_block_len);
 #endif
 	}
 
@@ -163,16 +161,15 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 	struct qat_sym_op_cookie *cookie =
 				(struct qat_sym_op_cookie *)op_cookie;
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
 	if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
-		QAT_LOG(ERR, "QAT PMD only supports symmetric crypto "
+		QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
 				"operation requests, op (%p) is not a "
 				"symmetric operation.", op);
 		return -EINVAL;
 	}
-#endif
+
 	if (unlikely(op->sess_type == RTE_CRYPTO_OP_SESSIONLESS)) {
-		QAT_LOG(ERR, "QAT PMD only supports session oriented"
+		QAT_DP_LOG(ERR, "QAT PMD only supports session oriented"
 				" requests, op (%p) is sessionless.", op);
 		return -EINVAL;
 	}
@@ -181,12 +178,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 			op->sym->session, cryptodev_qat_driver_id);
 
 	if (unlikely(ctx == NULL)) {
-		QAT_LOG(ERR, "Session was not created for this device");
+		QAT_DP_LOG(ERR, "Session was not created for this device");
 		return -EINVAL;
 	}
 
 	if (unlikely(ctx->min_qat_dev_gen > qat_dev_gen)) {
-		QAT_LOG(ERR, "Session alg not supported on this device gen");
+		QAT_DP_LOG(ERR, "Session alg not supported on this device gen");
 		op->status = RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
 		return -EINVAL;
 	}
@@ -231,7 +228,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 				(cipher_param->cipher_length % BYTE_LENGTH != 0)
 				 || (cipher_param->cipher_offset
 							% BYTE_LENGTH != 0))) {
-				QAT_LOG(ERR,
+				QAT_DP_LOG(ERR,
 		  "SNOW3G/KASUMI/ZUC in QAT PMD only supports byte aligned values");
 				op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 				return -EINVAL;
@@ -265,7 +262,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 				ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3) {
 			if (unlikely((auth_param->auth_off % BYTE_LENGTH != 0)
 				|| (auth_param->auth_len % BYTE_LENGTH != 0))) {
-				QAT_LOG(ERR,
+				QAT_DP_LOG(ERR,
 		"For SNOW3G/KASUMI/ZUC, QAT PMD only supports byte aligned values");
 				op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 				return -EINVAL;
@@ -500,8 +497,9 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 		ret = qat_sgl_fill_array(op->sym->m_src, src_buf_start,
 				&cookie->qat_sgl_src,
 				qat_req->comn_mid.src_length);
-		if (ret) {
-			QAT_LOG(ERR, "QAT PMD Cannot fill sgl array");
+
+		if (unlikely(ret)) {
+			QAT_DP_LOG(ERR, "QAT PMD Cannot fill sgl array");
 			return ret;
 		}
 
@@ -515,9 +513,8 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 					&cookie->qat_sgl_dst,
 						qat_req->comn_mid.dst_length);
 
-			if (ret) {
-				QAT_LOG(ERR, "QAT PMD Cannot "
-						"fill sgl array");
+			if (unlikely(ret)) {
+				QAT_DP_LOG(ERR, "QAT PMD can't fill sgl array");
 				return ret;
 			}
 
@@ -531,17 +528,17 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 		qat_req->comn_mid.dest_data_addr = dst_buf_start;
 	}
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_TX
-	rte_hexdump(stdout, "qat_req:", qat_req,
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+	QAT_DP_HEXDUMP_LOG(DEBUG, "qat_req:", qat_req,
 			sizeof(struct icp_qat_fw_la_bulk_req));
-	rte_hexdump(stdout, "src_data:",
+	QAT_DP_HEXDUMP_LOG(DEBUG, "src_data:",
 			rte_pktmbuf_mtod(op->sym->m_src, uint8_t*),
 			rte_pktmbuf_data_len(op->sym->m_src));
 	if (do_cipher) {
 		uint8_t *cipher_iv_ptr = rte_crypto_op_ctod_offset(op,
 						uint8_t *,
 						ctx->cipher_iv.offset);
-		rte_hexdump(stdout, "cipher iv:", cipher_iv_ptr,
+		QAT_DP_HEXDUMP_LOG(DEBUG, "cipher iv:", cipher_iv_ptr,
 				ctx->cipher_iv.length);
 	}
 
@@ -550,17 +547,17 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 			uint8_t *auth_iv_ptr = rte_crypto_op_ctod_offset(op,
 							uint8_t *,
 							ctx->auth_iv.offset);
-			rte_hexdump(stdout, "auth iv:", auth_iv_ptr,
+			QAT_DP_HEXDUMP_LOG(DEBUG, "auth iv:", auth_iv_ptr,
 						ctx->auth_iv.length);
 		}
-		rte_hexdump(stdout, "digest:", op->sym->auth.digest.data,
+		QAT_DP_HEXDUMP_LOG(DEBUG, "digest:", op->sym->auth.digest.data,
 				ctx->digest_length);
 	}
 
 	if (do_aead) {
-		rte_hexdump(stdout, "digest:", op->sym->aead.digest.data,
+		QAT_DP_HEXDUMP_LOG(DEBUG, "digest:", op->sym->aead.digest.data,
 				ctx->digest_length);
-		rte_hexdump(stdout, "aad:", op->sym->aead.aad.data,
+		QAT_DP_HEXDUMP_LOG(DEBUG, "aad:", op->sym->aead.aad.data,
 				ctx->aad_len);
 	}
 #endif
diff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h
index b693a4d..f9e72a6 100644
--- a/drivers/crypto/qat/qat_sym.h
+++ b/drivers/crypto/qat/qat_sym.h
@@ -6,13 +6,13 @@
 #define _QAT_SYM_H_
 
 #include <rte_cryptodev_pmd.h>
-#include <rte_hexdump.h>
 
 #include <openssl/evp.h>
 
 #include "qat_common.h"
 #include "qat_sym_session.h"
 #include "qat_sym_pmd.h"
+#include "qat_logs.h"
 
 #define BYTE_LENGTH    8
 /* bpi is only used for partial blocks of DES and AES
@@ -59,7 +59,7 @@ bpi_cipher_encrypt(uint8_t *src, uint8_t *dst,
 	return 0;
 
 cipher_encrypt_err:
-	QAT_LOG(ERR, "libcrypto ECB cipher encrypt failed");
+	QAT_DP_LOG(ERR, "libcrypto ECB cipher encrypt failed");
 	return -EINVAL;
 }
 
@@ -99,21 +99,23 @@ qat_bpicipher_postprocess(struct qat_sym_session *ctx,
 			iv = rte_crypto_op_ctod_offset(op, uint8_t *,
 					ctx->cipher_iv.offset);
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_RX
-		rte_hexdump(stdout, "BPI: src before post-process:", last_block,
-			last_block_len);
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+		QAT_DP_HEXDUMP_LOG(DEBUG, "BPI: src before post-process:",
+			last_block, last_block_len);
 		if (sym_op->m_dst != NULL)
-			rte_hexdump(stdout, "BPI: dst before post-process:",
-					dst, last_block_len);
+			QAT_DP_HEXDUMP_LOG(DEBUG,
+				"BPI: dst before post-process:",
+				dst, last_block_len);
 #endif
 		bpi_cipher_encrypt(last_block, dst, iv, block_len,
 				last_block_len, ctx->bpi_ctx);
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_RX
-		rte_hexdump(stdout, "BPI: src after post-process:", last_block,
-			last_block_len);
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+		QAT_DP_HEXDUMP_LOG(DEBUG, "BPI: src after post-process:",
+				last_block, last_block_len);
 		if (sym_op->m_dst != NULL)
-			rte_hexdump(stdout, "BPI: dst after post-process:", dst,
-				last_block_len);
+			QAT_DP_HEXDUMP_LOG(DEBUG,
+				"BPI: dst after post-process:",
+				dst, last_block_len);
 #endif
 	}
 	return sym_op->cipher.data.length - last_block_len;
@@ -128,8 +130,8 @@ qat_sym_process_response(void **op, uint8_t *resp)
 	struct rte_crypto_op *rx_op = (struct rte_crypto_op *)(uintptr_t)
 			(resp_msg->opaque_data);
 
-#ifdef RTE_LIBRTE_PMD_QAT_DEBUG_RX
-	rte_hexdump(stdout, "qat_response:", (uint8_t *)resp_msg,
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
+	QAT_DP_HEXDUMP_LOG(DEBUG, "qat_response:", (uint8_t *)resp_msg,
 			sizeof(struct icp_qat_fw_comn_resp));
 #endif
 
-- 
2.7.4

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

* [dpdk-dev] [PATCH v2 5/5] doc/qat: document debug options
  2018-06-14 11:03 ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging Tomasz Jozwiak
                     ` (3 preceding siblings ...)
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 4/5] crypto/qat: move to dynamic logging for data-path trace Tomasz Jozwiak
@ 2018-06-14 11:03   ` Tomasz Jozwiak
  2018-06-14 14:05   ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging De Lara Guarch, Pablo
  5 siblings, 0 replies; 14+ messages in thread
From: Tomasz Jozwiak @ 2018-06-14 11:03 UTC (permalink / raw)
  To: fiona.trahe, tomaszx.jozwiak, dev

From: Fiona Trahe <fiona.trahe@intel.com>

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 doc/guides/cryptodevs/qat.rst | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
index 22a2c71..b899985 100644
--- a/doc/guides/cryptodevs/qat.rst
+++ b/doc/guides/cryptodevs/qat.rst
@@ -371,3 +371,29 @@ Each qat crypto device has a unique name, in format
 <pci bdf>_<service>, e.g. "0000:41:01.0_qat_sym".
 This name can be passed to rte_cryptodev_get_dev_id() to get the device_id.
 This is also the format of the slave parameter passed to the crypto scheduler.
+
+Debugging
+----------------------------------------
+
+There are 2 sets of trace available via the dynamic logging feature:
+
+* pmd.qat_dp exposes trace on the data-path.
+* pmd.qat_general exposes all other trace.
+
+pmd.qat exposes both sets of traces.
+They can be enabled using the log-level option (where 8=maximum log level) on
+the process cmdline, e.g. using any of the following::
+
+    --log-level="pmd.qat_general,8"
+    --log-level="pmd.qat_dp,8"
+    --log-level="pmd.qat,8"
+
+.. Note::
+
+    The global RTE_LOG_DP_LEVEL overrides data-path trace so must be set to
+    RTE_LOG_DEBUG to see all the trace. This variable is in config/rte_config.h
+    for meson build and config/common_base for gnu make.
+    Also the dynamic global log level overrides both sets of trace, so e.g. no
+    QAT trace would display in this case::
+
+	--log-level="7" --log-level="pmd.qat_general,8"
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging
  2018-06-14 11:03 ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging Tomasz Jozwiak
                     ` (4 preceding siblings ...)
  2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 5/5] doc/qat: document debug options Tomasz Jozwiak
@ 2018-06-14 14:05   ` De Lara Guarch, Pablo
  5 siblings, 0 replies; 14+ messages in thread
From: De Lara Guarch, Pablo @ 2018-06-14 14:05 UTC (permalink / raw)
  To: Jozwiak, TomaszX, Trahe, Fiona, Jozwiak, TomaszX, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tomasz Jozwiak
> Sent: Thursday, June 14, 2018 12:03 PM
> To: Trahe, Fiona <fiona.trahe@intel.com>; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>; dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging
> 
> Note this patchset is targeting 18.08 release and depends on the qat refactoring
> patchset:
> http://dpdk.org/ml/archives/dev/2018-May/101306.html
> 
> Move to dynamic logging and cleanup trace.
> 
> Changes for v2:
>  - fixed some bugs detected in patch 2/5 when using clang
> 
> Fiona Trahe (2):
>   crypto/qat: rename log macro for non-dp logs
>   doc/qat: document debug options
> 
> Tomasz Jozwiak (3):
>   crypto/qat: cleanup unused and useless trace
>   crypto/qat: move to dynamic logging for non-dp trace
>   crypto/qat: move to dynamic logging for data-path trace
> 
>  config/common_base                   |   4 --
>  doc/guides/cryptodevs/qat.rst        |  26 +++++++++
>  drivers/crypto/qat/Makefile          |   1 +
>  drivers/crypto/qat/meson.build       |   1 +
>  drivers/crypto/qat/qat_common.c      |  12 ++--
>  drivers/crypto/qat/qat_device.c      |  12 ++--
>  drivers/crypto/qat/qat_logs.c        |  40 ++++++++++++++
>  drivers/crypto/qat/qat_logs.h        |  65 +++++++++-------------
>  drivers/crypto/qat/qat_qp.c          |  63 +++++++++------------
>  drivers/crypto/qat/qat_sym.c         |  65 +++++++++++-----------
>  drivers/crypto/qat/qat_sym.h         |  30 +++++-----
>  drivers/crypto/qat/qat_sym_pmd.c     |  21 +++----
>  drivers/crypto/qat/qat_sym_session.c | 103 ++++++++++++++++-------------------
>  13 files changed, 234 insertions(+), 209 deletions(-)  create mode 100644
> drivers/crypto/qat/qat_logs.c
> 
> --
> 2.7.4

Applied to dpdk-next-crypto.
Thanks,

Pablo

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

end of thread, other threads:[~2018-06-14 14:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-11 11:31 [dpdk-dev] [PATCH 0/5] crypto/qat: move to dynamic logging Fiona Trahe
2018-05-11 11:31 ` [dpdk-dev] [PATCH 1/5] crypto/qat: cleanup unused and useless trace Fiona Trahe
2018-05-11 11:31 ` [dpdk-dev] [PATCH 2/5] crypto/qat: move to dynamic logging for non-dp trace Fiona Trahe
2018-06-12 15:54   ` De Lara Guarch, Pablo
2018-05-11 11:31 ` [dpdk-dev] [PATCH 3/5] crypto/qat: rename log macro for non-dp logs Fiona Trahe
2018-05-11 11:31 ` [dpdk-dev] [PATCH 4/5] crypto/qat: move to dynamic logging for data-path trace Fiona Trahe
2018-05-11 11:31 ` [dpdk-dev] [PATCH 5/5] doc/qat: document debug options Fiona Trahe
2018-06-14 11:03 ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging Tomasz Jozwiak
2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 1/5] crypto/qat: cleanup unused and useless trace Tomasz Jozwiak
2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 2/5] crypto/qat: move to dynamic logging for non-dp trace Tomasz Jozwiak
2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 3/5] crypto/qat: rename log macro for non-dp logs Tomasz Jozwiak
2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 4/5] crypto/qat: move to dynamic logging for data-path trace Tomasz Jozwiak
2018-06-14 11:03   ` [dpdk-dev] [PATCH v2 5/5] doc/qat: document debug options Tomasz Jozwiak
2018-06-14 14:05   ` [dpdk-dev] [PATCH v2 0/5] crypto/qat: move to dynamic logging De Lara Guarch, Pablo

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