DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
To: fiona.trahe@intel.com, tomaszx.jozwiak@intel.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 2/5] crypto/qat: move to dynamic logging for non-dp trace
Date: Thu, 14 Jun 2018 13:03:03 +0200	[thread overview]
Message-ID: <1528974186-13370-3-git-send-email-tomaszx.jozwiak@intel.com> (raw)
In-Reply-To: <1528974186-13370-1-git-send-email-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  | 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

  parent reply	other threads:[~2018-06-14 11:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Tomasz Jozwiak [this message]
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

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=1528974186-13370-3-git-send-email-tomaszx.jozwiak@intel.com \
    --to=tomaszx.jozwiak@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).