DPDK patches and discussions
 help / color / mirror / Atom feed
From: <jerinj@marvell.com>
To: <dev@dpdk.org>, Nipun Gupta <nipun.gupta@nxp.com>,
	Rosen Xu <rosen.xu@intel.com>,
	Tianfei zhang <tianfei.zhang@intel.com>,
	"Bruce Richardson" <bruce.richardson@intel.com>,
	Xiaoyun Li <xiaoyun.li@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>
Cc: <thomas@monjalon.net>, <olivier.matz@6wind.com>,
	<david.marchand@redhat.com>, Jerin Jacob <jerinj@marvell.com>
Subject: [dpdk-dev]  [PATCH 04/13] drivers/raw: use log register macro
Date: Wed, 17 Jun 2020 12:00:38 +0530	[thread overview]
Message-ID: <20200617063047.1555518-5-jerinj@marvell.com> (raw)
In-Reply-To: <20200617063047.1555518-1-jerinj@marvell.com>

From: Jerin Jacob <jerinj@marvell.com>

Use log register macro to avoid the code duplication
in the log registration process.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c  | 11 +----------
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c    | 11 +----------
 drivers/raw/ifpga/ifpga_rawdev.c       | 10 +---------
 drivers/raw/ioat/ioat_rawdev.c         | 12 ++----------
 drivers/raw/ioat/rte_ioat_rawdev.h     |  2 --
 drivers/raw/ntb/ntb.c                  | 10 +---------
 drivers/raw/skeleton/skeleton_rawdev.c | 11 +----------
 7 files changed, 7 insertions(+), 60 deletions(-)

diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
index 7c21c6a52..c7bddbc6c 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
@@ -20,9 +20,6 @@
 #include "dpaa2_cmdif_logs.h"
 #include "rte_pmd_dpaa2_cmdif.h"
 
-/* Dynamic log type identifier */
-int dpaa2_cmdif_logtype;
-
 /* CMDIF driver name */
 #define DPAA2_CMDIF_PMD_NAME dpaa2_dpci
 
@@ -291,10 +288,4 @@ static struct rte_vdev_driver dpaa2_cmdif_drv = {
 };
 
 RTE_PMD_REGISTER_VDEV(DPAA2_CMDIF_PMD_NAME, dpaa2_cmdif_drv);
-
-RTE_INIT(dpaa2_cmdif_init_log)
-{
-	dpaa2_cmdif_logtype = rte_log_register("pmd.raw.dpaa2.cmdif");
-	if (dpaa2_cmdif_logtype >= 0)
-		rte_log_set_level(dpaa2_cmdif_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(dpaa2_cmdif_logtype, pmd.raw.dpaa2.cmdif, INFO);
diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
index 1be1b6ddf..0b9c4e3d7 100644
--- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
+++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
@@ -26,9 +26,6 @@
 
 #define DPAA2_QDMA_NO_PREFETCH "no_prefetch"
 
-/* Dynamic log type identifier */
-int dpaa2_qdma_logtype;
-
 uint32_t dpaa2_coherent_no_alloc_cache;
 uint32_t dpaa2_coherent_alloc_cache;
 
@@ -1495,10 +1492,4 @@ static struct rte_dpaa2_driver rte_dpaa2_qdma_pmd = {
 RTE_PMD_REGISTER_DPAA2(dpaa2_qdma, rte_dpaa2_qdma_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(dpaa2_qdma,
 	"no_prefetch=<int> ");
-
-RTE_INIT(dpaa2_qdma_init_log)
-{
-	dpaa2_qdma_logtype = rte_log_register("pmd.raw.dpaa2.qdma");
-	if (dpaa2_qdma_logtype >= 0)
-		rte_log_set_level(dpaa2_qdma_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(dpaa2_qdma_logtype, pmd.raw.dpaa2.qdma, INFO);
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index b8701e155..cc25c662b 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -47,8 +47,6 @@
 #define RTE_PCI_EXT_CAP_ID(header)       (int)(header & 0x0000ffff)
 #define RTE_PCI_EXT_CAP_NEXT(header)     ((header >> 20) & 0xffc)
 
-int ifpga_rawdev_logtype;
-
 #define PCI_VENDOR_ID_INTEL          0x8086
 /* PCI Device ID */
 #define PCIE_DEVICE_ID_PF_INT_5_X    0xBCBD
@@ -1597,13 +1595,7 @@ static struct rte_pci_driver rte_ifpga_rawdev_pmd = {
 RTE_PMD_REGISTER_PCI(ifpga_rawdev_pci_driver, rte_ifpga_rawdev_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(ifpga_rawdev_pci_driver, rte_ifpga_rawdev_pmd);
 RTE_PMD_REGISTER_KMOD_DEP(ifpga_rawdev_pci_driver, "* igb_uio | uio_pci_generic | vfio-pci");
-
-RTE_INIT(ifpga_rawdev_init_log)
-{
-	ifpga_rawdev_logtype = rte_log_register("driver.raw.init");
-	if (ifpga_rawdev_logtype >= 0)
-		rte_log_set_level(ifpga_rawdev_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ifpga_rawdev_logtype, driver.raw.init, NOTICE);
 
 static const char * const valid_args[] = {
 #define IFPGA_ARG_NAME         "ifpga"
diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c
index a8a48f90a..30d9f597e 100644
--- a/drivers/raw/ioat/ioat_rawdev.c
+++ b/drivers/raw/ioat/ioat_rawdev.c
@@ -9,9 +9,6 @@
 
 #include "rte_ioat_rawdev.h"
 
-/* Dynamic log type identifier */
-int ioat_pmd_logtype;
-
 static struct rte_pci_driver ioat_pmd_drv;
 
 #define IOAT_VENDOR_ID		0x8086
@@ -28,6 +25,8 @@ static struct rte_pci_driver ioat_pmd_drv;
 #define IOAT_DEVICE_ID_BDXF	0x6f2F
 #define IOAT_DEVICE_ID_ICX	0x0b00
 
+RTE_LOG_REGISTER(ioat_pmd_logtype,  rawdev.ioat, INFO);
+
 #define IOAT_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
 	ioat_pmd_logtype, "%s(): " fmt "\n", __func__, ##args)
 
@@ -386,10 +385,3 @@ static struct rte_pci_driver ioat_pmd_drv = {
 RTE_PMD_REGISTER_PCI(IOAT_PMD_RAWDEV_NAME, ioat_pmd_drv);
 RTE_PMD_REGISTER_PCI_TABLE(IOAT_PMD_RAWDEV_NAME, pci_id_ioat_map);
 RTE_PMD_REGISTER_KMOD_DEP(IOAT_PMD_RAWDEV_NAME, "* igb_uio | uio_pci_generic");
-
-RTE_INIT(ioat_pmd_init_log)
-{
-	ioat_pmd_logtype = rte_log_register(IOAT_PMD_LOG_NAME);
-	if (ioat_pmd_logtype >= 0)
-		rte_log_set_level(ioat_pmd_logtype, RTE_LOG_INFO);
-}
diff --git a/drivers/raw/ioat/rte_ioat_rawdev.h b/drivers/raw/ioat/rte_ioat_rawdev.h
index 4b271f174..f765a6557 100644
--- a/drivers/raw/ioat/rte_ioat_rawdev.h
+++ b/drivers/raw/ioat/rte_ioat_rawdev.h
@@ -25,8 +25,6 @@
 #define IOAT_PMD_RAWDEV_NAME rawdev_ioat
 /** String reported as the device driver name by rte_rawdev_info_get() */
 #define IOAT_PMD_RAWDEV_NAME_STR "rawdev_ioat"
-/** Name used to adjust the log level for this driver */
-#define IOAT_PMD_LOG_NAME "rawdev.ioat"
 
 /**
  * Configuration structure for an ioat rawdev instance
diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c
index dd0b72f8c..e40412bb7 100644
--- a/drivers/raw/ntb/ntb.c
+++ b/drivers/raw/ntb/ntb.c
@@ -23,8 +23,6 @@
 #include "rte_pmd_ntb.h"
 #include "ntb.h"
 
-int ntb_logtype;
-
 static const struct rte_pci_id pci_id_ntb_map[] = {
 	{ RTE_PCI_DEVICE(NTB_INTEL_VENDOR_ID, NTB_INTEL_DEV_ID_B2B_SKX) },
 	{ .vendor_id = 0, /* sentinel */ },
@@ -1504,10 +1502,4 @@ static struct rte_pci_driver rte_ntb_pmd = {
 RTE_PMD_REGISTER_PCI(raw_ntb, rte_ntb_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(raw_ntb, pci_id_ntb_map);
 RTE_PMD_REGISTER_KMOD_DEP(raw_ntb, "* igb_uio | uio_pci_generic | vfio-pci");
-
-RTE_INIT(ntb_init_log)
-{
-	ntb_logtype = rte_log_register("pmd.raw.ntb");
-	if (ntb_logtype >= 0)
-		rte_log_set_level(ntb_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(ntb_logtype, pmd.raw.ntb, INFO);
diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index 586183a5b..72ece887a 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -28,9 +28,6 @@
 
 #include "skeleton_rawdev.h"
 
-/* Dynamic log type identifier */
-int skeleton_pmd_logtype;
-
 /* Count of instances */
 static uint16_t skeldev_init_once;
 
@@ -759,10 +756,4 @@ static struct rte_vdev_driver skeleton_pmd_drv = {
 };
 
 RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME, skeleton_pmd_drv);
-
-RTE_INIT(skeleton_pmd_init_log)
-{
-	skeleton_pmd_logtype = rte_log_register("rawdev.skeleton");
-	if (skeleton_pmd_logtype >= 0)
-		rte_log_set_level(skeleton_pmd_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(skeleton_pmd_logtype, rawdev.skeleton, INFO);
-- 
2.26.2


  parent reply	other threads:[~2020-06-17  6:30 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  6:30 [dpdk-dev] [PATCH 00/13] rte_log registration usage improvement jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 01/13] eal/log: introduce log register macro jerinj
2020-06-17 10:00   ` Thomas Monjalon
2020-06-17 10:26     ` Andrew Rybchenko
2020-06-24 13:08       ` Jerin Jacob
2020-06-17 10:02   ` David Marchand
2020-06-17 10:21     ` Andrew Rybchenko
2020-06-24 13:11       ` Jerin Jacob
2020-06-24 15:26         ` Andrew Rybchenko
2020-06-24 15:32           ` Jerin Jacob
2020-06-24 15:43             ` Andrew Rybchenko
2020-06-24 18:10               ` Jerin Jacob
2020-06-26 11:16                 ` Jerin Jacob
2020-06-26 11:42                   ` David Marchand
2020-06-26 12:06                     ` Jerin Jacob
2020-06-26 12:13                       ` David Marchand
2020-06-26 12:16                       ` David Marchand
2020-06-26 12:37                         ` Jerin Jacob
2020-06-29 13:39                           ` Jerin Jacob
2020-06-30 13:39                           ` David Marchand
2020-06-30 14:42                             ` Jerin Jacob
2020-06-21  9:30   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 02/13] lib: use " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 03/13] drivers/vdpa: " jerinj
2020-06-17  6:30 ` jerinj [this message]
2020-06-17  6:30 ` [dpdk-dev] [PATCH 05/13] drivers/net: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 06/13] drivers/mempool: " jerinj
2020-06-21  9:46   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 07/13] drivers/event: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 08/13] drivers/crypto: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 09/13] drivers/compress: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 10/13] drivers/common: " jerinj
2020-06-21  9:48   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 11/13] drivers/bus: " jerinj
2020-06-21  9:52   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 12/13] drivers/baseband: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 13/13] app/test: " jerinj
2020-06-25 16:18 ` [dpdk-dev] [PATCH 00/13] rte_log registration usage improvement Dybkowski, AdamX
2020-06-25 16:20   ` Dybkowski, AdamX
2020-07-01  3:58 ` [dpdk-dev] [PATCH v2 " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 01/13] eal/log: introduce log register macro jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 02/13] lib: use " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 03/13] drivers/vdpa: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 04/13] drivers/raw: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 05/13] drivers/net: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 06/13] drivers/mempool: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 07/13] drivers/event: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 08/13] drivers/crypto: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 09/13] drivers/compress: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 10/13] drivers/common: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 11/13] drivers/bus: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 12/13] drivers/baseband: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 13/13] app/test: " jerinj
2020-07-01  6:48   ` [dpdk-dev] [PATCH v3 00/13] rte_log registration usage improvement jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 01/13] eal/log: introduce log register macro jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 02/13] lib: use " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 03/13] drivers/vdpa: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 04/13] drivers/raw: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 05/13] drivers/net: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 06/13] drivers/mempool: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 07/13] drivers/event: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 08/13] drivers/crypto: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 09/13] drivers/compress: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 10/13] drivers/common: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 11/13] drivers/bus: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 12/13] drivers/baseband: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 13/13] app/test: " jerinj
2020-07-01 10:44     ` [dpdk-dev] [PATCH v4 00/13] rte_log registration usage improvement jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 01/13] eal/log: introduce log register macro jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 02/13] lib: use " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 03/13] drivers/vdpa: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 04/13] drivers/raw: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 05/13] drivers/net: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 06/13] drivers/mempool: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 07/13] drivers/event: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 08/13] drivers/crypto: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 09/13] drivers/compress: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 10/13] drivers/common: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 11/13] drivers/bus: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 12/13] drivers/baseband: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 13/13] app/test: " jerinj
2020-07-01 12:33       ` [dpdk-dev] [PATCH v5 00/13] rte_log registration usage improvement jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 01/13] eal/log: introduce log register macro jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 02/13] lib: use " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 03/13] drivers/vdpa: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 04/13] drivers/raw: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 05/13] drivers/net: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 06/13] drivers/mempool: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 07/13] drivers/event: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 08/13] drivers/crypto: " jerinj
2020-07-02 17:59           ` Akhil Goyal
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 09/13] drivers/compress: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 10/13] drivers/common: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 11/13] drivers/bus: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 12/13] drivers/baseband: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 13/13] app/test: " jerinj
2020-07-03 13:55         ` [dpdk-dev] [PATCH v5 00/13] rte_log registration usage improvement David Marchand
2020-07-06  9:31           ` Jerin Jacob

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=20200617063047.1555518-5-jerinj@marvell.com \
    --to=jerinj@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jingjing.wu@intel.com \
    --cc=nipun.gupta@nxp.com \
    --cc=olivier.matz@6wind.com \
    --cc=rosen.xu@intel.com \
    --cc=thomas@monjalon.net \
    --cc=tianfei.zhang@intel.com \
    --cc=xiaoyun.li@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).