DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Xiaolong Ye <xiaolong.ye@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Igor Russkikh <igor.russkikh@aquantia.com>,
	Pavel Belous <pavel.belous@aquantia.com>,
	Allain Legacy <allain.legacy@windriver.com>,
	Matt Peters <matt.peters@windriver.com>,
	Ravi Kumar <ravi1.kumar@amd.com>, Rasesh Mody <rmody@marvell.com>,
	Shahed Shaikh <shshaikh@marvell.com>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>,
	Somnath Kotur <somnath.kotur@broadcom.com>,
	Chas Williams <chas3@att.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@nxp.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Marcin Wojtas <mw@semihalf.com>,
	Michal Krawczyk <mk@semihalf.com>,
	Guy Tzalik <gtzalik@amazon.com>,
	Evgeny Schemeilin <evgenys@amazon.com>,
	Gagandeep Singh <g.singh@nxp.com>,
	John Daley <johndale@cisco.com>,
	Hyong Youb Kim <hyonkim@cisco.com>,
	Gaetan Rivet <gaetan.rivet@6wind.com>,
	Xiao Wang <xiao.w.wang@intel.com>,
	Ziyang Xuan <xuanziyang2@huawei.com>,
	Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>,
	Guoyang Zhou <zhouguoyang@huawei.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Qiming Yang <qiming.yang@intel.com>,
	Rosen Xu <rosen.xu@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Shijith Thotton <sthotton@marvell.com>,
	Srisivasubramanian Srinivasan <srinivasan@marvell.com>,
	Jakub Grajciar <jgrajcia@cisco.com>,
	Matan Azrad <matan@mellanox.com>,
	Shahaf Shuler <shahafs@mellanox.com>,
	Yongseok Koh <yskoh@mellanox.com>,
	Viacheslav Ovsiienko <viacheslavo@mellanox.com>,
	Zyta Szpak <zr@semihalf.com>, Liron Himi <lironh@marvell.com>,
	Tomasz Duszynski <tdu@semihalf.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Alejandro Lucero <alejandro.lucero@netronome.com>,
	Tetsuya Mukawa <mtetsuyah@gmail.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Jasvinder Singh <jasvinder.singh@intel.com>,
	Cristian Dumitrescu <cristian.dumitrescu@intel.com>,
	Jan Remes <remes@netcope.com>,
	Rastislav Cernay <cernay@netcope.com>,
	Keith Wiles <keith.wiles@intel.com>,
	Maciej Czekaj <mczekaj@marvell.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Tiwei Bie <tiwei.bie@intel.com>,
	Zhihong Wang <zhihong.wang@intel.com>,
	Yong Wang <yongwang@vmware.com>
Subject: [dpdk-dev] [PATCH 10/11] drivers/net: use new logtype wrapper
Date: Mon, 19 Aug 2019 13:41:58 +0200	[thread overview]
Message-ID: <1566214919-32250-11-git-send-email-david.marchand@redhat.com> (raw)
In-Reply-To: <1566214919-32250-1-git-send-email-david.marchand@redhat.com>

Make use of the newly introduced wrapper.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/af_packet/rte_eth_af_packet.c |  8 ++------
 drivers/net/af_xdp/rte_eth_af_xdp.c       |  8 ++------
 drivers/net/atlantic/atl_ethdev.c         | 13 ++++---------
 drivers/net/avp/avp_ethdev.c              |  8 ++------
 drivers/net/axgbe/axgbe_ethdev.c          | 13 ++++---------
 drivers/net/bnx2x/bnx2x_ethdev.c          | 13 ++++---------
 drivers/net/bnxt/bnxt_ethdev.c            |  8 ++------
 drivers/net/bonding/rte_eth_bond_pmd.c    |  8 ++------
 drivers/net/dpaa2/dpaa2_ethdev.c          |  8 ++------
 drivers/net/e1000/e1000_logs.c            | 21 +++++----------------
 drivers/net/e1000/e1000_logs.h            |  4 ----
 drivers/net/e1000/em_ethdev.c             |  6 ------
 drivers/net/e1000/igb_ethdev.c            |  6 ------
 drivers/net/ena/ena_ethdev.c              | 13 ++++---------
 drivers/net/enetc/enetc_ethdev.c          |  8 ++------
 drivers/net/enic/enic_ethdev.c            |  8 ++------
 drivers/net/failsafe/failsafe.c           |  8 ++------
 drivers/net/fm10k/fm10k_ethdev.c          | 13 ++++---------
 drivers/net/hinic/hinic_pmd_ethdev.c      |  8 ++------
 drivers/net/i40e/i40e_ethdev.c            | 13 ++++---------
 drivers/net/iavf/iavf_ethdev.c            | 13 ++++---------
 drivers/net/ice/ice_ethdev.c              | 13 ++++---------
 drivers/net/ifc/ifcvf_vdpa.c              |  8 ++------
 drivers/net/ipn3ke/ipn3ke_ethdev.c        |  8 ++------
 drivers/net/ixgbe/ixgbe_ethdev.c          | 13 ++++---------
 drivers/net/kni/rte_eth_kni.c             |  8 ++------
 drivers/net/liquidio/lio_ethdev.c         | 13 ++++---------
 drivers/net/memif/rte_eth_memif.c         |  8 ++------
 drivers/net/mlx4/mlx4.c                   |  8 +++-----
 drivers/net/mlx5/mlx5.c                   |  8 +++-----
 drivers/net/mvneta/mvneta_ethdev.c        |  8 ++------
 drivers/net/mvpp2/mrvl_ethdev.c           |  8 ++------
 drivers/net/netvsc/hn_ethdev.c            | 13 ++++---------
 drivers/net/nfp/nfp_net.c                 | 13 ++++---------
 drivers/net/null/rte_eth_null.c           |  8 ++------
 drivers/net/octeontx/octeontx_ethdev.c    | 20 ++++++--------------
 drivers/net/pcap/rte_eth_pcap.c           |  8 ++------
 drivers/net/qede/qede_ethdev.c            | 13 ++++---------
 drivers/net/ring/rte_eth_ring.c           |  8 ++------
 drivers/net/softnic/rte_eth_softnic.c     |  9 ++-------
 drivers/net/szedata2/rte_eth_szedata2.c   | 13 ++++---------
 drivers/net/tap/rte_eth_tap.c             |  8 ++------
 drivers/net/thunderx/nicvf_ethdev.c       | 20 ++++++--------------
 drivers/net/vdev_netvsc/vdev_netvsc.c     |  9 ++-------
 drivers/net/vhost/rte_eth_vhost.c         |  8 ++------
 drivers/net/virtio/virtio_ethdev.c        | 13 ++++---------
 drivers/net/vmxnet3/vmxnet3_ethdev.c      | 13 ++++---------
 47 files changed, 133 insertions(+), 354 deletions(-)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 82bf2cd..d6b8938 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -1018,9 +1018,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_af_packet,
 	"framecnt=<int> "
 	"qdisc_bypass=<0|1>");
 
-RTE_INIT(af_packet_init_log)
-{
-	af_packet_logtype = rte_log_register("pmd.net.packet");
-	if (af_packet_logtype >= 0)
-		rte_log_set_level(af_packet_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(af_packet_logtype, "pmd.net.packet",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 41ed5b2..6707c61 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -1119,9 +1119,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_af_xdp,
 			      "queue_count=<int> "
 			      "pmd_zero_copy=<0|1>");
 
-RTE_INIT(af_xdp_init_log)
-{
-	af_xdp_logtype = rte_log_register("pmd.net.af_xdp");
-	if (af_xdp_logtype >= 0)
-		rte_log_set_level(af_xdp_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(af_xdp_logtype, "pmd.net.af_xdp",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c
index 3c1b349..129c36a 100644
--- a/drivers/net/atlantic/atl_ethdev.c
+++ b/drivers/net/atlantic/atl_ethdev.c
@@ -1890,12 +1890,7 @@ RTE_PMD_REGISTER_PCI(net_atlantic, rte_atl_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_atlantic, pci_id_atl_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_atlantic, "* igb_uio | uio_pci_generic");
 
-RTE_INIT(atl_init_log)
-{
-	atl_logtype_init = rte_log_register("pmd.net.atlantic.init");
-	if (atl_logtype_init >= 0)
-		rte_log_set_level(atl_logtype_init, RTE_LOG_NOTICE);
-	atl_logtype_driver = rte_log_register("pmd.net.atlantic.driver");
-	if (atl_logtype_driver >= 0)
-		rte_log_set_level(atl_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(atl_logtype_init, "pmd.net.atlantic.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(atl_logtype_driver, "pmd.net.atlantic.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 504435e..66fb5da 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -2299,9 +2299,5 @@ avp_dev_stats_reset(struct rte_eth_dev *eth_dev)
 RTE_PMD_REGISTER_PCI(net_avp, rte_avp_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_avp, pci_id_avp_map);
 
-RTE_INIT(avp_init_log)
-{
-	avp_logtype_driver = rte_log_register("pmd.net.avp.driver");
-	if (avp_logtype_driver >= 0)
-		rte_log_set_level(avp_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(avp_logtype_driver, "pmd.net.avp.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index 4fcede8..e85aea9 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -762,12 +762,7 @@ RTE_PMD_REGISTER_PCI(net_axgbe, rte_axgbe_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_axgbe, pci_id_axgbe_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_axgbe, "* igb_uio | uio_pci_generic | vfio-pci");
 
-RTE_INIT(axgbe_init_log)
-{
-	axgbe_logtype_init = rte_log_register("pmd.net.axgbe.init");
-	if (axgbe_logtype_init >= 0)
-		rte_log_set_level(axgbe_logtype_init, RTE_LOG_NOTICE);
-	axgbe_logtype_driver = rte_log_register("pmd.net.axgbe.driver");
-	if (axgbe_logtype_driver >= 0)
-		rte_log_set_level(axgbe_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(axgbe_logtype_init, "pmd.net.axgbe.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(axgbe_logtype_driver, "pmd.net.axgbe.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index cda29e6..b1d5acb 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -757,12 +757,7 @@ RTE_PMD_REGISTER_PCI(net_bnx2xvf, rte_bnx2xvf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_bnx2xvf, pci_id_bnx2xvf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_bnx2xvf, "* igb_uio | vfio-pci");
 
-RTE_INIT(bnx2x_init_log)
-{
-	bnx2x_logtype_init = rte_log_register("pmd.net.bnx2x.init");
-	if (bnx2x_logtype_init >= 0)
-		rte_log_set_level(bnx2x_logtype_init, RTE_LOG_NOTICE);
-	bnx2x_logtype_driver = rte_log_register("pmd.net.bnx2x.driver");
-	if (bnx2x_logtype_driver >= 0)
-		rte_log_set_level(bnx2x_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bnx2x_logtype_init, "pmd.net.bnx2x.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(bnx2x_logtype_driver, "pmd.net.bnx2x.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7..fd19b9d 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4067,12 +4067,8 @@ bool is_bnxt_supported(struct rte_eth_dev *dev)
 	return is_device_supported(dev, &bnxt_rte_pmd);
 }
 
-RTE_INIT(bnxt_init_log)
-{
-	bnxt_logtype_driver = rte_log_register("pmd.net.bnxt.driver");
-	if (bnxt_logtype_driver >= 0)
-		rte_log_set_level(bnxt_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bnxt_logtype_driver, "pmd.net.bnxt.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 
 RTE_PMD_REGISTER_PCI(net_bnxt, bnxt_rte_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_bnxt, bnxt_pci_id_map);
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 6a6ed89..26d826d 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3640,9 +3640,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_bonding,
 
 int bond_logtype;
 
-RTE_INIT(bond_init_log)
-{
-	bond_logtype = rte_log_register("pmd.net.bond");
-	if (bond_logtype >= 0)
-		rte_log_set_level(bond_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bond_logtype, "pmd.net.bond",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index dd6a78f..01b7c33 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2391,9 +2391,5 @@ static struct rte_dpaa2_driver rte_dpaa2_pmd = {
 RTE_PMD_REGISTER_DPAA2(net_dpaa2, rte_dpaa2_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(net_dpaa2,
 		DRIVER_LOOPBACK_MODE "=<int>");
-RTE_INIT(dpaa2_pmd_init_log)
-{
-	dpaa2_logtype_pmd = rte_log_register("pmd.net.dpaa2");
-	if (dpaa2_logtype_pmd >= 0)
-		rte_log_set_level(dpaa2_logtype_pmd, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_pmd, "pmd.net.dpaa2",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 2217393..a6765f4 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -8,19 +8,8 @@
 int e1000_logtype_init;
 int e1000_logtype_driver;
 
-/* avoids double registering of logs if EM and IGB drivers are in use */
-static int e1000_log_initialized;
-
-void
-e1000_igb_init_log(void)
-{
-	if (!e1000_log_initialized) {
-		e1000_logtype_init = rte_log_register("pmd.net.e1000.init");
-		if (e1000_logtype_init >= 0)
-			rte_log_set_level(e1000_logtype_init, RTE_LOG_NOTICE);
-		e1000_logtype_driver = rte_log_register("pmd.net.e1000.driver");
-		if (e1000_logtype_driver >= 0)
-			rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
-		e1000_log_initialized = 1;
-	}
-}
+/* register only once if EM and IGB drivers are in use */
+RTE_LOG_REGISTER(e1000_logtype_init, "pmd.net.e1000.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(e1000_logtype_driver, "pmd.net.e1000.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 69d3d31..03d75c8 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -43,8 +43,4 @@ extern int e1000_logtype_driver;
 #define PMD_DRV_LOG(level, fmt, args...) \
 	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
 
-
-/* log init function shared by e1000 and igb drivers */
-void e1000_igb_init_log(void);
-
 #endif /* _E1000_LOGS_H_ */
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 20b5406..a7ce4bd 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1826,9 +1826,3 @@ eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
 RTE_PMD_REGISTER_PCI(net_e1000_em, rte_em_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_e1000_em, pci_id_em_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_e1000_em, "* igb_uio | uio_pci_generic | vfio-pci");
-
-/* see e1000_logs.c */
-RTE_INIT(igb_init_log)
-{
-	e1000_igb_init_log();
-}
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index fec2b42..003b338 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -5739,9 +5739,3 @@ RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb, "* igb_uio | uio_pci_generic | vfio-pci
 RTE_PMD_REGISTER_PCI(net_e1000_igb_vf, rte_igbvf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_e1000_igb_vf, pci_id_igbvf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb_vf, "* igb_uio | vfio-pci");
-
-/* see e1000_logs.c */
-RTE_INIT(e1000_init_log)
-{
-	e1000_igb_init_log();
-}
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 7d4a3b2..c352a34 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2594,15 +2594,10 @@ RTE_PMD_REGISTER_PCI(net_ena, rte_ena_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_ena, pci_id_ena_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_ena, "* igb_uio | uio_pci_generic | vfio-pci");
 
-RTE_INIT(ena_init_log)
-{
-	ena_logtype_init = rte_log_register("pmd.net.ena.init");
-	if (ena_logtype_init >= 0)
-		rte_log_set_level(ena_logtype_init, RTE_LOG_NOTICE);
-	ena_logtype_driver = rte_log_register("pmd.net.ena.driver");
-	if (ena_logtype_driver >= 0)
-		rte_log_set_level(ena_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ena_logtype_init, "pmd.net.ena.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(ena_logtype_driver, "pmd.net.ena.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 
 /******************************************************************************
  ******************************** AENQ Handlers *******************************
diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c
index 6c5501a..c49b382 100644
--- a/drivers/net/enetc/enetc_ethdev.c
+++ b/drivers/net/enetc/enetc_ethdev.c
@@ -890,9 +890,5 @@ RTE_PMD_REGISTER_PCI(net_enetc, rte_enetc_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_enetc, pci_id_enetc_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_enetc, "* vfio-pci");
 
-RTE_INIT(enetc_pmd_init_log)
-{
-	enetc_logtype_pmd = rte_log_register("pmd.net.enetc");
-	if (enetc_logtype_pmd >= 0)
-		rte_log_set_level(enetc_logtype_pmd, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(enetc_logtype_pmd, "pmd.net.enetc",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 06dc671..b1e24e7 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -69,12 +69,8 @@ static const struct vic_speed_capa {
 #define ENIC_DEVARG_ENABLE_AVX2_RX "enable-avx2-rx"
 #define ENIC_DEVARG_IG_VLAN_REWRITE "ig-vlan-rewrite"
 
-RTE_INIT(enicpmd_init_log)
-{
-	enic_pmd_logtype = rte_log_register("pmd.net.enic");
-	if (enic_pmd_logtype >= 0)
-		rte_log_set_level(enic_pmd_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(enic_pmd_logtype, "pmd.net.enic",
+	RTE_LOG_INFO, RTE_LOGTYPE_PMD);
 
 static int
 enicpmd_fdir_ctrl_func(struct rte_eth_dev *eth_dev,
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 8af31d7..40390f7 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -410,9 +410,5 @@ static struct rte_vdev_driver failsafe_drv = {
 RTE_PMD_REGISTER_VDEV(net_failsafe, failsafe_drv);
 RTE_PMD_REGISTER_PARAM_STRING(net_failsafe, PMD_FAILSAFE_PARAM_STRING);
 
-RTE_INIT(failsafe_init_log)
-{
-	failsafe_logtype = rte_log_register("pmd.net.failsafe");
-	if (failsafe_logtype >= 0)
-		rte_log_set_level(failsafe_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(failsafe_logtype, "pmd.net.failsafe",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD)
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d721..d104c5d 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3277,12 +3277,7 @@ RTE_PMD_REGISTER_PCI(net_fm10k, rte_pmd_fm10k);
 RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio-pci");
 
-RTE_INIT(fm10k_init_log)
-{
-	fm10k_logtype_init = rte_log_register("pmd.net.fm10k.init");
-	if (fm10k_logtype_init >= 0)
-		rte_log_set_level(fm10k_logtype_init, RTE_LOG_NOTICE);
-	fm10k_logtype_driver = rte_log_register("pmd.net.fm10k.driver");
-	if (fm10k_logtype_driver >= 0)
-		rte_log_set_level(fm10k_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(fm10k_logtype_init, "pmd.net.fm10k.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(fm10k_logtype_driver, "pmd.net.fm10k.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af90..bdaec90 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -2336,9 +2336,5 @@ static struct rte_pci_driver rte_hinic_pmd = {
 RTE_PMD_REGISTER_PCI(net_hinic, rte_hinic_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_hinic, pci_id_hinic_map);
 
-RTE_INIT(hinic_init_log)
-{
-	hinic_logtype = rte_log_register("pmd.net.hinic");
-	if (hinic_logtype >= 0)
-		rte_log_set_level(hinic_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(hinic_logtype, "pmd.net.hinic",
+	RTE_LOG_INFO, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7a..0bfcf25 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12761,15 +12761,10 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 	return 0;
 }
 
-RTE_INIT(i40e_init_log)
-{
-	i40e_logtype_init = rte_log_register("pmd.net.i40e.init");
-	if (i40e_logtype_init >= 0)
-		rte_log_set_level(i40e_logtype_init, RTE_LOG_NOTICE);
-	i40e_logtype_driver = rte_log_register("pmd.net.i40e.driver");
-	if (i40e_logtype_driver >= 0)
-		rte_log_set_level(i40e_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(i40e_logtype_init, "pmd.net.i40e.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(i40e_logtype_driver, "pmd.net.i40e.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 
 RTE_PMD_REGISTER_PARAM_STRING(net_i40e,
 			      ETH_I40E_FLOATING_VEB_ARG "=1"
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 8f39073..a176410 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1411,15 +1411,10 @@ static struct rte_pci_driver rte_iavf_pmd = {
 RTE_PMD_REGISTER_PCI(net_iavf, rte_iavf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_iavf, pci_id_iavf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_iavf, "* igb_uio | vfio-pci");
-RTE_INIT(iavf_init_log)
-{
-	iavf_logtype_init = rte_log_register("pmd.net.iavf.init");
-	if (iavf_logtype_init >= 0)
-		rte_log_set_level(iavf_logtype_init, RTE_LOG_NOTICE);
-	iavf_logtype_driver = rte_log_register("pmd.net.iavf.driver");
-	if (iavf_logtype_driver >= 0)
-		rte_log_set_level(iavf_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(iavf_logtype_init, "pmd.net.iavf.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(iavf_logtype_driver, "pmd.net.iavf.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 
 /* memory func for base code */
 enum iavf_status_code
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 44a14cb..a5dd053 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3797,12 +3797,7 @@ RTE_PMD_REGISTER_KMOD_DEP(net_ice, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(net_ice,
 			      ICE_SAFE_MODE_SUPPORT_ARG "=<0|1>");
 
-RTE_INIT(ice_init_log)
-{
-	ice_logtype_init = rte_log_register("pmd.net.ice.init");
-	if (ice_logtype_init >= 0)
-		rte_log_set_level(ice_logtype_init, RTE_LOG_NOTICE);
-	ice_logtype_driver = rte_log_register("pmd.net.ice.driver");
-	if (ice_logtype_driver >= 0)
-		rte_log_set_level(ice_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ice_logtype_init, "pmd.net.ice.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(ice_logtype_driver, "pmd.net.ice.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c
index 8de9ef1..95dc25d 100644
--- a/drivers/net/ifc/ifcvf_vdpa.c
+++ b/drivers/net/ifc/ifcvf_vdpa.c
@@ -1262,9 +1262,5 @@ RTE_PMD_REGISTER_PCI(net_ifcvf, rte_ifcvf_vdpa);
 RTE_PMD_REGISTER_PCI_TABLE(net_ifcvf, pci_id_ifcvf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_ifcvf, "* vfio-pci");
 
-RTE_INIT(ifcvf_vdpa_init_log)
-{
-	ifcvf_vdpa_logtype = rte_log_register("pmd.net.ifcvf_vdpa");
-	if (ifcvf_vdpa_logtype >= 0)
-		rte_log_set_level(ifcvf_vdpa_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ifcvf_vdpa_logtype, "pmd.net.ifcvf_vdpa",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c b/drivers/net/ipn3ke/ipn3ke_ethdev.c
index c226d63..59fc690 100644
--- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
+++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
@@ -715,9 +715,5 @@ RTE_PMD_REGISTER_PARAM_STRING(ipn3ke_cfg,
 	"fpga_acc=<string>"
 	"i40e_pf=<string>");
 
-RTE_INIT(ipn3ke_afu_init_log)
-{
-	ipn3ke_afu_logtype = rte_log_register("pmd.afu.ipn3ke");
-	if (ipn3ke_afu_logtype >= 0)
-		rte_log_set_level(ipn3ke_afu_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ipn3ke_afu_logtype, "pmd.afu.ipn3ke",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 03fc1f7..e90de0b 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -8728,12 +8728,7 @@ RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe_vf, "* igb_uio | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf,
 			      IXGBEVF_DEVARG_PFLINK_FULLCHK "=<0|1>");
 
-RTE_INIT(ixgbe_init_log)
-{
-	ixgbe_logtype_init = rte_log_register("pmd.net.ixgbe.init");
-	if (ixgbe_logtype_init >= 0)
-		rte_log_set_level(ixgbe_logtype_init, RTE_LOG_NOTICE);
-	ixgbe_logtype_driver = rte_log_register("pmd.net.ixgbe.driver");
-	if (ixgbe_logtype_driver >= 0)
-		rte_log_set_level(ixgbe_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ixgbe_logtype_init, "pmd.net.ixgbe.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(ixgbe_logtype_driver, "pmd.net.ixgbe.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index 515c0aa..1f54cb8 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -491,9 +491,5 @@ static struct rte_vdev_driver eth_kni_drv = {
 RTE_PMD_REGISTER_VDEV(net_kni, eth_kni_drv);
 RTE_PMD_REGISTER_PARAM_STRING(net_kni, ETH_KNI_NO_REQUEST_THREAD_ARG "=<int>");
 
-RTE_INIT(eth_kni_init_log)
-{
-	eth_kni_logtype = rte_log_register("pmd.net.kni");
-	if (eth_kni_logtype >= 0)
-		rte_log_set_level(eth_kni_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eth_kni_logtype, "pmd.net.kni",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab0..8dcc310 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -2142,12 +2142,7 @@ RTE_PMD_REGISTER_PCI(net_liovf, rte_liovf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_liovf, pci_id_liovf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_liovf, "* igb_uio | vfio-pci");
 
-RTE_INIT(lio_init_log)
-{
-	lio_logtype_init = rte_log_register("pmd.net.liquidio.init");
-	if (lio_logtype_init >= 0)
-		rte_log_set_level(lio_logtype_init, RTE_LOG_NOTICE);
-	lio_logtype_driver = rte_log_register("pmd.net.liquidio.driver");
-	if (lio_logtype_driver >= 0)
-		rte_log_set_level(lio_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(lio_logtype_init, "pmd.net.liquidio.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(lio_logtype_driver, "pmd.net.liquidio.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index a59f809..5f4daf8 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1378,9 +1378,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_memif,
 
 int memif_logtype;
 
-RTE_INIT(memif_init_log)
-{
-	memif_logtype = rte_log_register("pmd.net.memif");
-	if (memif_logtype >= 0)
-		rte_log_set_level(memif_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(memif_logtype, "pmd.net.memif",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 931e4f4..c71b68e 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -1274,16 +1274,14 @@ glue_error:
 
 #endif
 
+RTE_LOG_REGISTER(mlx4_logtype, "pmd.net.mlx4",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+
 /**
  * Driver initialization routine.
  */
 RTE_INIT(rte_mlx4_pmd_init)
 {
-	/* Initialize driver log type. */
-	mlx4_logtype = rte_log_register("pmd.net.mlx4");
-	if (mlx4_logtype >= 0)
-		rte_log_set_level(mlx4_logtype, RTE_LOG_NOTICE);
-
 	/*
 	 * MLX4_DEVICE_FATAL_CLEANUP tells ibv_destroy functions we
 	 * want to get success errno value in case of calling them
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 962c0d5..0ed3e52 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2664,16 +2664,14 @@ glue_error:
 
 #endif
 
+RTE_LOG_REGISTER(mlx5_logtype, "pmd.net.mlx5",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+
 /**
  * Driver initialization routine.
  */
 RTE_INIT(rte_mlx5_pmd_init)
 {
-	/* Initialize driver log type. */
-	mlx5_logtype = rte_log_register("pmd.net.mlx5");
-	if (mlx5_logtype >= 0)
-		rte_log_set_level(mlx5_logtype, RTE_LOG_NOTICE);
-
 	/* Build the static tables for Verbs conversion. */
 	mlx5_set_ptype_table();
 	mlx5_set_cksum_table();
diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index a8def8f..9192cc9 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -966,9 +966,5 @@ static struct rte_vdev_driver pmd_mvneta_drv = {
 RTE_PMD_REGISTER_VDEV(net_mvneta, pmd_mvneta_drv);
 RTE_PMD_REGISTER_PARAM_STRING(net_mvneta, "iface=<ifc>");
 
-RTE_INIT(mvneta_init_log)
-{
-	mvneta_logtype = rte_log_register("pmd.net.mvneta");
-	if (mvneta_logtype >= 0)
-		rte_log_set_level(mvneta_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(mvneta_logtype, "pmd.net.mvneta",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 810a703..925f577 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -3005,9 +3005,5 @@ static struct rte_vdev_driver pmd_mrvl_drv = {
 RTE_PMD_REGISTER_VDEV(net_mvpp2, pmd_mrvl_drv);
 RTE_PMD_REGISTER_ALIAS(net_mvpp2, eth_mvpp2);
 
-RTE_INIT(mrvl_init_log)
-{
-	mrvl_logtype = rte_log_register("pmd.net.mvpp2");
-	if (mrvl_logtype >= 0)
-		rte_log_set_level(mrvl_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(mrvl_logtype, "pmd.net.mvpp2",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index 2a90d67..e5214ea 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -1067,12 +1067,7 @@ static struct rte_vmbus_driver rte_netvsc_pmd = {
 RTE_PMD_REGISTER_VMBUS(net_netvsc, rte_netvsc_pmd);
 RTE_PMD_REGISTER_KMOD_DEP(net_netvsc, "* uio_hv_generic");
 
-RTE_INIT(hn_init_log)
-{
-	hn_logtype_init = rte_log_register("pmd.net.netvsc.init");
-	if (hn_logtype_init >= 0)
-		rte_log_set_level(hn_logtype_init, RTE_LOG_NOTICE);
-	hn_logtype_driver = rte_log_register("pmd.net.netvsc.driver");
-	if (hn_logtype_driver >= 0)
-		rte_log_set_level(hn_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(hn_logtype_init, "pmd.net.netvsc.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(hn_logtype_driver, "pmd.net.netvsc.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index f1a3ef2..dbb8638 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -3779,15 +3779,10 @@ RTE_PMD_REGISTER_PCI_TABLE(net_nfp_vf, pci_id_nfp_vf_net_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_nfp_pf, "* igb_uio | uio_pci_generic | vfio");
 RTE_PMD_REGISTER_KMOD_DEP(net_nfp_vf, "* igb_uio | uio_pci_generic | vfio");
 
-RTE_INIT(nfp_init_log)
-{
-	nfp_logtype_init = rte_log_register("pmd.net.nfp.init");
-	if (nfp_logtype_init >= 0)
-		rte_log_set_level(nfp_logtype_init, RTE_LOG_NOTICE);
-	nfp_logtype_driver = rte_log_register("pmd.net.nfp.driver");
-	if (nfp_logtype_driver >= 0)
-		rte_log_set_level(nfp_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(nfp_logtype_init, "pmd.net.nfp.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(nfp_logtype_driver, "pmd.net.nfp.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 /*
  * Local variables:
  * c-file-style: "Linux"
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index b2c92ab..6fbf78e 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -690,9 +690,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_null,
 	"size=<int> "
 	"copy=<int>");
 
-RTE_INIT(eth_null_init_log)
-{
-	eth_null_logtype = rte_log_register("pmd.net.null");
-	if (eth_null_logtype >= 0)
-		rte_log_set_level(eth_null_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eth_null_logtype, "pmd.net.null",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index 27eed47..ea0f6af 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -46,20 +46,12 @@ int otx_net_logtype_mbox;
 int otx_net_logtype_init;
 int otx_net_logtype_driver;
 
-RTE_INIT(otx_net_init_log)
-{
-	otx_net_logtype_mbox = rte_log_register("pmd.net.octeontx.mbox");
-	if (otx_net_logtype_mbox >= 0)
-		rte_log_set_level(otx_net_logtype_mbox, RTE_LOG_NOTICE);
-
-	otx_net_logtype_init = rte_log_register("pmd.net.octeontx.init");
-	if (otx_net_logtype_init >= 0)
-		rte_log_set_level(otx_net_logtype_init, RTE_LOG_NOTICE);
-
-	otx_net_logtype_driver = rte_log_register("pmd.net.octeontx.driver");
-	if (otx_net_logtype_driver >= 0)
-		rte_log_set_level(otx_net_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx_net_logtype_mbox, "pmd.net.octeontx.mbox",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx_net_logtype_init, "pmd.net.octeontx.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx_net_logtype_driver, "pmd.net.octeontx.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 
 /* Parse integer from integer argument */
 static int
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 95d4b5b..fdf06ae 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -1581,9 +1581,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_pcap,
 	ETH_PCAP_PHY_MAC_ARG "=<int>"
 	ETH_PCAP_INFINITE_RX_ARG "=<0|1>");
 
-RTE_INIT(eth_pcap_init_log)
-{
-	eth_pcap_logtype = rte_log_register("pmd.net.pcap");
-	if (eth_pcap_logtype >= 0)
-		rte_log_set_level(eth_pcap_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eth_pcap_logtype, "pmd.net.pcap",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 528b33e..b795890 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -2768,12 +2768,7 @@ RTE_PMD_REGISTER_PCI(net_qede_vf, rte_qedevf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_qede_vf, pci_id_qedevf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_qede_vf, "* igb_uio | vfio-pci");
 
-RTE_INIT(qede_init_log)
-{
-	qede_logtype_init = rte_log_register("pmd.net.qede.init");
-	if (qede_logtype_init >= 0)
-		rte_log_set_level(qede_logtype_init, RTE_LOG_NOTICE);
-	qede_logtype_driver = rte_log_register("pmd.net.qede.driver");
-	if (qede_logtype_driver >= 0)
-		rte_log_set_level(qede_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(qede_logtype_init, "pmd.net.qede.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(qede_logtype_driver, "pmd.net.qede.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 634da63..38596b0 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -696,9 +696,5 @@ RTE_PMD_REGISTER_ALIAS(net_ring, eth_ring);
 RTE_PMD_REGISTER_PARAM_STRING(net_ring,
 	ETH_RING_NUMA_NODE_ACTION_ARG "=name:node:action(ATTACH|CREATE)");
 
-RTE_INIT(eth_ring_init_log)
-{
-	eth_ring_logtype = rte_log_register("pmd.net.ring");
-	if (eth_ring_logtype >= 0)
-		rte_log_set_level(eth_ring_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eth_ring_logtype, "pmd.net.ring",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index e3ad241..5657345 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -688,13 +688,8 @@ RTE_PMD_REGISTER_PARAM_STRING(net_softnic,
 	PMD_PARAM_TM_QSIZE12 "=<uint32>"
 );
 
-
-RTE_INIT(pmd_softnic_init_log)
-{
-	pmd_softnic_logtype = rte_log_register("pmd.net.softnic");
-	if (pmd_softnic_logtype >= 0)
-		rte_log_set_level(pmd_softnic_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(pmd_softnic_logtype, "pmd.net.softnic",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 
 int
 rte_pmd_softnic_manage(uint16_t port_id)
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index d5dec1b..80daad1 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -1928,12 +1928,7 @@ RTE_PMD_REGISTER_PCI_TABLE(RTE_SZEDATA2_DRIVER_NAME, rte_szedata2_pci_id_table);
 RTE_PMD_REGISTER_KMOD_DEP(RTE_SZEDATA2_DRIVER_NAME,
 	"* combo6core & combov3 & szedata2 & ( szedata2_cv3 | szedata2_cv3_fdt )");
 
-RTE_INIT(szedata2_init_log)
-{
-	szedata2_logtype_init = rte_log_register("pmd.net.szedata2.init");
-	if (szedata2_logtype_init >= 0)
-		rte_log_set_level(szedata2_logtype_init, RTE_LOG_NOTICE);
-	szedata2_logtype_driver = rte_log_register("pmd.net.szedata2.driver");
-	if (szedata2_logtype_driver >= 0)
-		rte_log_set_level(szedata2_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(szedata2_logtype_init, "pmd.net.szedata2.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(szedata2_logtype_driver, "pmd.net.szedata2.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 64bd049..a837129 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -2388,9 +2388,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_tap,
 			      ETH_TAP_REMOTE_ARG "=<string>");
 int tap_logtype;
 
-RTE_INIT(tap_init_log)
-{
-	tap_logtype = rte_log_register("pmd.net.tap");
-	if (tap_logtype >= 0)
-		rte_log_set_level(tap_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(tap_logtype, "pmd.net.tap",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 56769ef..c1363ed 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -55,20 +55,12 @@ static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic,
 static int nicvf_vlan_offload_config(struct rte_eth_dev *dev, int mask);
 static int nicvf_vlan_offload_set(struct rte_eth_dev *dev, int mask);
 
-RTE_INIT(nicvf_init_log)
-{
-	nicvf_logtype_mbox = rte_log_register("pmd.net.thunderx.mbox");
-	if (nicvf_logtype_mbox >= 0)
-		rte_log_set_level(nicvf_logtype_mbox, RTE_LOG_NOTICE);
-
-	nicvf_logtype_init = rte_log_register("pmd.net.thunderx.init");
-	if (nicvf_logtype_init >= 0)
-		rte_log_set_level(nicvf_logtype_init, RTE_LOG_NOTICE);
-
-	nicvf_logtype_driver = rte_log_register("pmd.net.thunderx.driver");
-	if (nicvf_logtype_driver >= 0)
-		rte_log_set_level(nicvf_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(nicvf_logtype_mbox, "pmd.net.thunderx.mbox",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(nicvf_logtype_init, "pmd.net.thunderx.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(nicvf_logtype_driver, "pmd.net.thunderx.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 
 static void
 nicvf_link_status_update(struct nicvf *nic,
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index be8f19c..612086c 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -775,13 +775,8 @@ RTE_PMD_REGISTER_PARAM_STRING(net_vdev_netvsc,
 			      VDEV_NETVSC_ARG_FORCE "=<int> "
 			      VDEV_NETVSC_ARG_IGNORE "=<int>");
 
-/** Initialize driver log type. */
-RTE_INIT(vdev_netvsc_init_log)
-{
-	vdev_netvsc_logtype = rte_log_register("pmd.net.vdev_netvsc");
-	if (vdev_netvsc_logtype >= 0)
-		rte_log_set_level(vdev_netvsc_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vdev_netvsc_logtype, "pmd.net.vdev_netvsc",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 
 /** Compare function for vdev find device operation. */
 static int
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index a4892d7..77f8997 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -1468,9 +1468,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_vhost,
 	"iommu-support=<0|1> "
 	"postcopy-support=<0|1>");
 
-RTE_INIT(vhost_init_log)
-{
-	vhost_logtype = rte_log_register("pmd.net.vhost");
-	if (vhost_logtype >= 0)
-		rte_log_set_level(vhost_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vhost_logtype, "pmd.net.vhost",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index f96588b..eb4d6f1 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2453,12 +2453,7 @@ RTE_PMD_EXPORT_NAME(net_virtio, __COUNTER__);
 RTE_PMD_REGISTER_PCI_TABLE(net_virtio, pci_id_virtio_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_virtio, "* igb_uio | uio_pci_generic | vfio-pci");
 
-RTE_INIT(virtio_init_log)
-{
-	virtio_logtype_init = rte_log_register("pmd.net.virtio.init");
-	if (virtio_logtype_init >= 0)
-		rte_log_set_level(virtio_logtype_init, RTE_LOG_NOTICE);
-	virtio_logtype_driver = rte_log_register("pmd.net.virtio.driver");
-	if (virtio_logtype_driver >= 0)
-		rte_log_set_level(virtio_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(virtio_logtype_init, "pmd.net.virtio.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(virtio_logtype_driver, "pmd.net.virtio.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 57feb37..8dc39fd 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1434,12 +1434,7 @@ RTE_PMD_REGISTER_PCI(net_vmxnet3, rte_vmxnet3_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_vmxnet3, pci_id_vmxnet3_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_vmxnet3, "* igb_uio | uio_pci_generic | vfio-pci");
 
-RTE_INIT(vmxnet3_init_log)
-{
-	vmxnet3_logtype_init = rte_log_register("pmd.net.vmxnet3.init");
-	if (vmxnet3_logtype_init >= 0)
-		rte_log_set_level(vmxnet3_logtype_init, RTE_LOG_NOTICE);
-	vmxnet3_logtype_driver = rte_log_register("pmd.net.vmxnet3.driver");
-	if (vmxnet3_logtype_driver >= 0)
-		rte_log_set_level(vmxnet3_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vmxnet3_logtype_init, "pmd.net.vmxnet3.init",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(vmxnet3_logtype_driver, "pmd.net.vmxnet3.driver",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
-- 
1.8.3.1


  parent reply	other threads:[~2019-08-19 11:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 01/11] log: fix plugin level restore with patterns David Marchand
2019-08-19 12:30   ` Andrew Rybchenko
2019-08-19 11:41 ` [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers David Marchand
2019-08-19 12:27   ` Andrew Rybchenko
2019-09-02 14:29   ` Ferruh Yigit
2019-09-03  8:06     ` David Marchand
2019-09-03  8:47       ` Ferruh Yigit
2019-09-04 17:45         ` Thomas Monjalon
2019-09-04 19:21           ` Andrew Rybchenko
2019-09-04 19:41             ` Thomas Monjalon
2019-09-04 19:58               ` Andrew Rybchenko
2019-09-04 20:44                 ` Thomas Monjalon
2019-09-05  6:29                   ` Andrew Rybchenko
2019-09-05  7:13                     ` David Marchand
2019-09-05  7:45                     ` Thomas Monjalon
2019-08-19 11:41 ` [dpdk-dev] [PATCH 03/11] drivers/baseband: use new logtype wrapper David Marchand
2019-08-19 15:39   ` Chautru, Nicolas
2019-08-19 11:41 ` [dpdk-dev] [PATCH 04/11] drivers/bus: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 05/11] drivers/common: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 06/11] drivers/compress: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 07/11] drivers/crypto: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 08/11] drivers/event: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 09/11] drivers/mempool: " David Marchand
2019-08-19 11:41 ` David Marchand [this message]
2019-08-19 14:55   ` [dpdk-dev] [PATCH 10/11] drivers/net: " Legacy, Allain
2019-09-02 16:11   ` Ferruh Yigit
2019-09-03  8:06     ` David Marchand
2019-09-03 15:03       ` Stephen Hemminger
2019-08-19 11:41 ` [dpdk-dev] [PATCH 11/11] drivers/raw: " David Marchand
2019-09-02 14:17 ` [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers Ferruh Yigit
2019-09-03  8:06   ` David Marchand

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=1566214919-32250-11-git-send-email-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=alejandro.lucero@netronome.com \
    --cc=allain.legacy@windriver.com \
    --cc=beilei.xing@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=cernay@netcope.com \
    --cc=chas3@att.com \
    --cc=cloud.wangxiaoyun@huawei.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=ferruh.yigit@intel.com \
    --cc=g.singh@nxp.com \
    --cc=gaetan.rivet@6wind.com \
    --cc=gtzalik@amazon.com \
    --cc=haiyangz@microsoft.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=hyonkim@cisco.com \
    --cc=igor.russkikh@aquantia.com \
    --cc=jasvinder.singh@intel.com \
    --cc=jerinj@marvell.com \
    --cc=jgrajcia@cisco.com \
    --cc=jingjing.wu@intel.com \
    --cc=johndale@cisco.com \
    --cc=keith.wiles@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=kys@microsoft.com \
    --cc=linville@tuxdriver.com \
    --cc=lironh@marvell.com \
    --cc=matan@mellanox.com \
    --cc=matt.peters@windriver.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mczekaj@marvell.com \
    --cc=mk@semihalf.com \
    --cc=mtetsuyah@gmail.com \
    --cc=mw@semihalf.com \
    --cc=pavel.belous@aquantia.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=ravi1.kumar@amd.com \
    --cc=remes@netcope.com \
    --cc=rmody@marvell.com \
    --cc=rosen.xu@intel.com \
    --cc=sachin.saxena@nxp.com \
    --cc=shahafs@mellanox.com \
    --cc=shshaikh@marvell.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=srinivasan@marvell.com \
    --cc=sthemmin@microsoft.com \
    --cc=sthotton@marvell.com \
    --cc=tdu@semihalf.com \
    --cc=tiwei.bie@intel.com \
    --cc=viacheslavo@mellanox.com \
    --cc=wenzhuo.lu@intel.com \
    --cc=xiao.w.wang@intel.com \
    --cc=xiaolong.ye@intel.com \
    --cc=xuanziyang2@huawei.com \
    --cc=yongwang@vmware.com \
    --cc=yskoh@mellanox.com \
    --cc=zhihong.wang@intel.com \
    --cc=zhouguoyang@huawei.com \
    --cc=zr@semihalf.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).