DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] cleanup drivers log registration
@ 2021-03-10 14:01 Thomas Monjalon
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 1/3] log: choose EAL log type on registration failure Thomas Monjalon
                   ` (4 more replies)
  0 siblings, 5 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-03-10 14:01 UTC (permalink / raw)
  To: dev

After working on the option "--log-level help",
it became clear that few adjustments were required
for the log registration of some drivers.

Thomas Monjalon (3):
  log: choose EAL log type on registration failure
  drivers: fix log level after loading
  drivers: align log names

 doc/guides/cryptodevs/qat.rst          | 10 +++---
 drivers/common/mlx5/mlx5_common.c      |  9 +----
 drivers/common/qat/qat_logs.c          |  4 +--
 drivers/crypto/bcmfs/bcmfs_logs.c      | 17 ++-------
 drivers/net/e1000/e1000_logs.c         | 49 +++-----------------------
 drivers/net/e1000/em_ethdev.c          |  6 ----
 drivers/net/e1000/igb_ethdev.c         |  6 ----
 drivers/raw/ifpga/ifpga_rawdev.c       |  2 +-
 drivers/raw/ioat/ioat_rawdev.c         |  2 +-
 drivers/raw/skeleton/skeleton_rawdev.c |  2 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c          |  2 +-
 lib/librte_eal/include/rte_log.h       |  1 +
 12 files changed, 20 insertions(+), 90 deletions(-)

-- 
2.30.1


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

* [dpdk-dev] [PATCH 1/3] log: choose EAL log type on registration failure
  2021-03-10 14:01 [dpdk-dev] [PATCH 0/3] cleanup drivers log registration Thomas Monjalon
@ 2021-03-10 14:01 ` Thomas Monjalon
  2021-03-23 18:22   ` David Marchand
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 2/3] drivers: fix log level after loading Thomas Monjalon
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 37+ messages in thread
From: Thomas Monjalon @ 2021-03-10 14:01 UTC (permalink / raw)
  To: dev

In the unlikely case where something goes wrong
while registering a log type,
the fallback is to use the log type 0, assigned to EAL.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_eal/include/rte_log.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h
index e6192892c3..178a265c3f 100644
--- a/lib/librte_eal/include/rte_log.h
+++ b/lib/librte_eal/include/rte_log.h
@@ -392,6 +392,7 @@ RTE_INIT(__##type)							\
 {									\
 	type = rte_log_register_type_and_pick_level(RTE_STR(name),	\
 						    RTE_LOG_##level);	\
+	type = RTE_MAX(0, type);                                        \
 }
 
 #ifdef __cplusplus
-- 
2.30.1


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

* [dpdk-dev] [PATCH 2/3] drivers: fix log level after loading
  2021-03-10 14:01 [dpdk-dev] [PATCH 0/3] cleanup drivers log registration Thomas Monjalon
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 1/3] log: choose EAL log type on registration failure Thomas Monjalon
@ 2021-03-10 14:01 ` Thomas Monjalon
  2021-03-23 18:25   ` [dpdk-dev] [dpdk-stable] " David Marchand
  2021-03-23 18:50   ` [dpdk-dev] " Ajit Khaparde
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 3/3] drivers: align log names Thomas Monjalon
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-03-10 14:01 UTC (permalink / raw)
  To: dev
  Cc: stable, Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
	Ajit Khaparde, Raveendra Padasalagi, Vikas Gupta, Jeff Guo,
	Haiyue Wang, Adam Dybkowski, Jerin Jacob, Akhil Goyal,
	Sachin Saxena

When compiled as a shared object, and loaded at runtime as a plugin,
the drivers should get the log level set earlier at EAL init
by the user through --log-level option.

The function for applying the log level setting is
rte_log_register_type_and_pick_level().
It is called by most drivers via RTE_LOG_REGISTER().

The drivers common/mlx5, bcmfs and e1000 were missing,
so the user-specified log level was not applied when
those drivers were loaded as plugins.
The macro RTE_LOG_REGISTER() is used for those drivers.

The unnecessary protection for double registration
is removed from e1000.

Fixes: 9c99878aa1b1 ("log: introduce logtype register macro")
Fixes: c8e79da7c676 ("crypto/bcmfs: introduce BCMFS driver")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/common/mlx5/mlx5_common.c |  9 +-----
 drivers/crypto/bcmfs/bcmfs_logs.c | 17 ++---------
 drivers/net/e1000/e1000_logs.c    | 49 ++++---------------------------
 drivers/net/e1000/em_ethdev.c     |  6 ----
 drivers/net/e1000/igb_ethdev.c    |  6 ----
 5 files changed, 8 insertions(+), 79 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
index c26a2cfa30..f92f05bda5 100644
--- a/drivers/common/mlx5/mlx5_common.c
+++ b/drivers/common/mlx5/mlx5_common.c
@@ -14,8 +14,6 @@
 #include "mlx5_common_utils.h"
 #include "mlx5_common_pci.h"
 
-int mlx5_common_logtype;
-
 uint8_t haswell_broadwell_cpu;
 
 /* In case this is an x86_64 intel processor to check if
@@ -41,12 +39,7 @@ static inline void mlx5_cpu_id(unsigned int level,
 }
 #endif
 
-RTE_INIT_PRIO(mlx5_log_init, LOG)
-{
-	mlx5_common_logtype = rte_log_register("pmd.common.mlx5");
-	if (mlx5_common_logtype >= 0)
-		rte_log_set_level(mlx5_common_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(mlx5_common_logtype, pmd.common.mlx5, NOTICE)
 
 static bool mlx5_common_initialized;
 
diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c b/drivers/crypto/bcmfs/bcmfs_logs.c
index 86f4ff3b53..701da9ecf3 100644
--- a/drivers/crypto/bcmfs/bcmfs_logs.c
+++ b/drivers/crypto/bcmfs/bcmfs_logs.c
@@ -8,9 +8,6 @@
 
 #include "bcmfs_logs.h"
 
-int bcmfs_conf_logtype;
-int bcmfs_dp_logtype;
-
 int
 bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 		const void *buf, unsigned int len)
@@ -24,15 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 	return 0;
 }
 
-RTE_INIT(bcmfs_device_init_log)
-{
-	/* Configuration and general logs */
-	bcmfs_conf_logtype = rte_log_register("pmd.bcmfs_config");
-	if (bcmfs_conf_logtype >= 0)
-		rte_log_set_level(bcmfs_conf_logtype, RTE_LOG_NOTICE);
-
-	/* data-path logs */
-	bcmfs_dp_logtype = rte_log_register("pmd.bcmfs_fp");
-	if (bcmfs_dp_logtype >= 0)
-		rte_log_set_level(bcmfs_dp_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
+RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 231f5c03ef..d9b8a4672f 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -4,53 +4,14 @@
 
 #include "e1000_logs.h"
 
-/* declared as extern in e1000_logs.h */
-int e1000_logtype_init;
-int e1000_logtype_driver;
-
+RTE_LOG_REGISTER(e1000_logtype_init, pmd.net.e1000.init, NOTICE)
+RTE_LOG_REGISTER(e1000_logtype_driver, pmd.net.e1000.driver, NOTICE)
 #ifdef RTE_LIBRTE_E1000_DEBUG_RX
-int e1000_logtype_rx;
+RTE_LOG_REGISTER(e1000_logtype_rx, pmd.net.e1000.rx, DEBUG)
 #endif
 #ifdef RTE_LIBRTE_E1000_DEBUG_TX
-int e1000_logtype_tx;
+RTE_LOG_REGISTER(e1000_logtype_tx, pmd.net.e1000.tx, DEBUG)
 #endif
 #ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-int e1000_logtype_tx_free;
+RTE_LOG_REGISTER(e1000_logtype_tx_free, pmd.net.e1000.tx_free, DEBUG)
 #endif
-
-/* 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)
-		return;
-
-	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);
-
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
-	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
-	if (e1000_logtype_rx >= 0)
-		rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
-#endif
-
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
-	e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
-	if (e1000_logtype_tx >= 0)
-		rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
-#endif
-
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-	e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
-	if (e1000_logtype_tx_free >= 0)
-		rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
-#endif
-
-	e1000_log_initialized = 1;
-}
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 9b8c4a7de5..79a6d8f461 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1846,9 +1846,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 5323504e98..395dc3f5aa 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -5434,9 +5434,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();
-}
-- 
2.30.1


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

* [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-10 14:01 [dpdk-dev] [PATCH 0/3] cleanup drivers log registration Thomas Monjalon
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 1/3] log: choose EAL log type on registration failure Thomas Monjalon
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 2/3] drivers: fix log level after loading Thomas Monjalon
@ 2021-03-10 14:01 ` Thomas Monjalon
  2021-03-10 14:36   ` Bruce Richardson
                     ` (6 more replies)
  2021-04-05 10:02 ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
  2021-04-06 13:22 ` [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration Thomas Monjalon
  4 siblings, 7 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-03-10 14:01 UTC (permalink / raw)
  To: dev
  Cc: John Griffin, Fiona Trahe, Deepak Kumar Jain, Ajit Khaparde,
	Raveendra Padasalagi, Vikas Gupta, Rosen Xu, Tianfei zhang,
	Bruce Richardson, Nipun Gupta, Hemant Agrawal, Xiao Wang

The log levels are configured by using the name of the logs.
Some drivers are aligned to follow a common log name standard:
	pmd.class.driver[.sub]
Some "common" drivers skip the "class" part:
	pmd.driver.sub

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 doc/guides/cryptodevs/qat.rst          | 10 +++++-----
 drivers/common/qat/qat_logs.c          |  4 ++--
 drivers/crypto/bcmfs/bcmfs_logs.c      |  4 ++--
 drivers/raw/ifpga/ifpga_rawdev.c       |  2 +-
 drivers/raw/ioat/ioat_rawdev.c         |  2 +-
 drivers/raw/skeleton/skeleton_rawdev.c |  2 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c          |  2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
index cf16f03503..224b22b3f7 100644
--- a/doc/guides/cryptodevs/qat.rst
+++ b/doc/guides/cryptodevs/qat.rst
@@ -659,15 +659,15 @@ 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.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.general,8"
+    --log-level="pmd.qat.dp,8"
     --log-level="pmd.qat,8"
 
 .. Note::
@@ -678,4 +678,4 @@ the process cmdline, e.g. using any of the following::
     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"
+	--log-level="7" --log-level="pmd.qat.general,8"
diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
index fa48be53c3..adbe163cd9 100644
--- a/drivers/common/qat/qat_logs.c
+++ b/drivers/common/qat/qat_logs.c
@@ -17,5 +17,5 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 	return 0;
 }
 
-RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat_general, NOTICE);
-RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat_dp, NOTICE);
+RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat.general, NOTICE);
+RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat.dp, NOTICE);
diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c b/drivers/crypto/bcmfs/bcmfs_logs.c
index 701da9ecf3..9faf12f238 100644
--- a/drivers/crypto/bcmfs/bcmfs_logs.c
+++ b/drivers/crypto/bcmfs/bcmfs_logs.c
@@ -21,5 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 	return 0;
 }
 
-RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
-RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
+RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.crypto.bcmfs.config, NOTICE)
+RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.crypto.bcmfs.fp, NOTICE)
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index 27129b133e..56b1866f77 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -1611,7 +1611,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_LOG_REGISTER(ifpga_rawdev_logtype, driver.raw.init, NOTICE);
+RTE_LOG_REGISTER(ifpga_rawdev_logtype, pmd.raw.ifpga, 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 a95854d5ac..15af07017c 100644
--- a/drivers/raw/ioat/ioat_rawdev.c
+++ b/drivers/raw/ioat/ioat_rawdev.c
@@ -28,7 +28,7 @@ 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);
+RTE_LOG_REGISTER(ioat_pmd_logtype, pmd.raw.ioat, INFO);
 
 #define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc)
 #define COMPLETION_SZ sizeof(__m128i)
diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index aa3beaad18..8896f0c9c5 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -768,4 +768,4 @@ static struct rte_vdev_driver skeleton_pmd_drv = {
 };
 
 RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME, skeleton_pmd_drv);
-RTE_LOG_REGISTER(skeleton_pmd_logtype, rawdev.skeleton, INFO);
+RTE_LOG_REGISTER(skeleton_pmd_logtype, pmd.raw.skeleton, INFO);
diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 6a1b44bc77..bf7afe4610 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -25,7 +25,7 @@
 
 #include "base/ifcvf.h"
 
-RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
+RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
 #define DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
 		"IFCVF %s(): " fmt "\n", __func__, ##args)
-- 
2.30.1


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

* Re: [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 3/3] drivers: align log names Thomas Monjalon
@ 2021-03-10 14:36   ` Bruce Richardson
  2021-03-11  2:54   ` Xu, Rosen
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 37+ messages in thread
From: Bruce Richardson @ 2021-03-10 14:36 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, John Griffin, Fiona Trahe, Deepak Kumar Jain, Ajit Khaparde,
	Raveendra Padasalagi, Vikas Gupta, Rosen Xu, Tianfei zhang,
	Nipun Gupta, Hemant Agrawal, Xiao Wang

On Wed, Mar 10, 2021 at 03:01:07PM +0100, Thomas Monjalon wrote:
> The log levels are configured by using the name of the logs.
> Some drivers are aligned to follow a common log name standard:
> 	pmd.class.driver[.sub]
> Some "common" drivers skip the "class" part:
> 	pmd.driver.sub
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 3/3] drivers: align log names Thomas Monjalon
  2021-03-10 14:36   ` Bruce Richardson
@ 2021-03-11  2:54   ` Xu, Rosen
  2021-03-11  3:02   ` Wang, Xiao W
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 37+ messages in thread
From: Xu, Rosen @ 2021-03-11  2:54 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: Griffin, John, Trahe, Fiona, Jain, Deepak K, Ajit Khaparde,
	Raveendra Padasalagi, Vikas Gupta, Zhang, Tianfei, Richardson,
	Bruce, Nipun Gupta, Hemant Agrawal, Wang, Xiao W

Hi,

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, March 10, 2021 22:01
> To: dev@dpdk.org
> Cc: Griffin, John <john.griffin@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; Jain, Deepak K <deepak.k.jain@intel.com>; Ajit
> Khaparde <ajit.khaparde@broadcom.com>; Raveendra Padasalagi
> <raveendra.padasalagi@broadcom.com>; Vikas Gupta
> <vikas.gupta@broadcom.com>; Xu, Rosen <rosen.xu@intel.com>; Zhang,
> Tianfei <tianfei.zhang@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; Nipun Gupta <nipun.gupta@nxp.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Wang, Xiao W
> <xiao.w.wang@intel.com>
> Subject: [PATCH 3/3] drivers: align log names
> 
> The log levels are configured by using the name of the logs.
> Some drivers are aligned to follow a common log name standard:
> 	pmd.class.driver[.sub]
> Some "common" drivers skip the "class" part:
> 	pmd.driver.sub
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  doc/guides/cryptodevs/qat.rst          | 10 +++++-----
>  drivers/common/qat/qat_logs.c          |  4 ++--
>  drivers/crypto/bcmfs/bcmfs_logs.c      |  4 ++--
>  drivers/raw/ifpga/ifpga_rawdev.c       |  2 +-
>  drivers/raw/ioat/ioat_rawdev.c         |  2 +-
>  drivers/raw/skeleton/skeleton_rawdev.c |  2 +-
>  drivers/vdpa/ifc/ifcvf_vdpa.c          |  2 +-
>  7 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
> index cf16f03503..224b22b3f7 100644
> --- a/doc/guides/cryptodevs/qat.rst
> +++ b/doc/guides/cryptodevs/qat.rst
> @@ -659,15 +659,15 @@ 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.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.general,8"
> +    --log-level="pmd.qat.dp,8"
>      --log-level="pmd.qat,8"
> 
>  .. Note::
> @@ -678,4 +678,4 @@ the process cmdline, e.g. using any of the following::
>      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"
> +	--log-level="7" --log-level="pmd.qat.general,8"
> diff --git a/drivers/common/qat/qat_logs.c
> b/drivers/common/qat/qat_logs.c index fa48be53c3..adbe163cd9 100644
> --- a/drivers/common/qat/qat_logs.c
> +++ b/drivers/common/qat/qat_logs.c
> @@ -17,5 +17,5 @@ qat_hexdump_log(uint32_t level, uint32_t logtype,
> const char *title,
>  	return 0;
>  }
> 
> -RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat_general, NOTICE); -
> RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat_dp, NOTICE);
> +RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat.general, NOTICE);
> +RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat.dp, NOTICE);
> diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c
> b/drivers/crypto/bcmfs/bcmfs_logs.c
> index 701da9ecf3..9faf12f238 100644
> --- a/drivers/crypto/bcmfs/bcmfs_logs.c
> +++ b/drivers/crypto/bcmfs/bcmfs_logs.c
> @@ -21,5 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype,
> const char *title,
>  	return 0;
>  }
> 
> -RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE) -
> RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
> +RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.crypto.bcmfs.config, NOTICE)
> +RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.crypto.bcmfs.fp, NOTICE)
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> b/drivers/raw/ifpga/ifpga_rawdev.c
> index 27129b133e..56b1866f77 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -1611,7 +1611,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_LOG_REGISTER(ifpga_rawdev_logtype,
> driver.raw.init, NOTICE);
> +RTE_LOG_REGISTER(ifpga_rawdev_logtype, pmd.raw.ifpga, 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 a95854d5ac..15af07017c 100644
> --- a/drivers/raw/ioat/ioat_rawdev.c
> +++ b/drivers/raw/ioat/ioat_rawdev.c
> @@ -28,7 +28,7 @@ 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);
> +RTE_LOG_REGISTER(ioat_pmd_logtype, pmd.raw.ioat, INFO);
> 
>  #define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc)  #define
> COMPLETION_SZ sizeof(__m128i) diff --git
> a/drivers/raw/skeleton/skeleton_rawdev.c
> b/drivers/raw/skeleton/skeleton_rawdev.c
> index aa3beaad18..8896f0c9c5 100644
> --- a/drivers/raw/skeleton/skeleton_rawdev.c
> +++ b/drivers/raw/skeleton/skeleton_rawdev.c
> @@ -768,4 +768,4 @@ static struct rte_vdev_driver skeleton_pmd_drv = {  };
> 
>  RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME,
> skeleton_pmd_drv); -RTE_LOG_REGISTER(skeleton_pmd_logtype,
> rawdev.skeleton, INFO);
> +RTE_LOG_REGISTER(skeleton_pmd_logtype, pmd.raw.skeleton, INFO);
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 6a1b44bc77..bf7afe4610 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -25,7 +25,7 @@
> 
>  #include "base/ifcvf.h"
> 
> -RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
> +RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
>  #define DRV_LOG(level, fmt, args...) \
>  	rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
>  		"IFCVF %s(): " fmt "\n", __func__, ##args)
> --
> 2.30.1

Acked-by: Rosen Xu <rosen.xu@intel.com>

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

* Re: [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 3/3] drivers: align log names Thomas Monjalon
  2021-03-10 14:36   ` Bruce Richardson
  2021-03-11  2:54   ` Xu, Rosen
@ 2021-03-11  3:02   ` Wang, Xiao W
  2021-03-12  7:39   ` Hemant Agrawal
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 37+ messages in thread
From: Wang, Xiao W @ 2021-03-11  3:02 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: Griffin, John, Trahe, Fiona, Jain, Deepak K, Ajit Khaparde,
	Raveendra Padasalagi, Vikas Gupta, Xu, Rosen, Zhang, Tianfei,
	Richardson, Bruce, Nipun Gupta, Hemant Agrawal

Hi,

BRs,
Xiao

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, March 10, 2021 10:01 PM
> To: dev@dpdk.org
> Cc: Griffin, John <john.griffin@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; Jain, Deepak K <deepak.k.jain@intel.com>; Ajit
> Khaparde <ajit.khaparde@broadcom.com>; Raveendra Padasalagi
> <raveendra.padasalagi@broadcom.com>; Vikas Gupta
> <vikas.gupta@broadcom.com>; Xu, Rosen <rosen.xu@intel.com>; Zhang,
> Tianfei <tianfei.zhang@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; Nipun Gupta <nipun.gupta@nxp.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Wang, Xiao W
> <xiao.w.wang@intel.com>
> Subject: [PATCH 3/3] drivers: align log names
> 
> The log levels are configured by using the name of the logs.
> Some drivers are aligned to follow a common log name standard:
> 	pmd.class.driver[.sub]
> Some "common" drivers skip the "class" part:
> 	pmd.driver.sub
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  doc/guides/cryptodevs/qat.rst          | 10 +++++-----
>  drivers/common/qat/qat_logs.c          |  4 ++--
>  drivers/crypto/bcmfs/bcmfs_logs.c      |  4 ++--
>  drivers/raw/ifpga/ifpga_rawdev.c       |  2 +-
>  drivers/raw/ioat/ioat_rawdev.c         |  2 +-
>  drivers/raw/skeleton/skeleton_rawdev.c |  2 +-
>  drivers/vdpa/ifc/ifcvf_vdpa.c          |  2 +-
>  7 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
> index cf16f03503..224b22b3f7 100644
> --- a/doc/guides/cryptodevs/qat.rst
> +++ b/doc/guides/cryptodevs/qat.rst
> @@ -659,15 +659,15 @@ 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.dp exposes trace on the data-path.
> +* pmd.qat.general exposes all other trace.
> 

[...]

> b/drivers/raw/skeleton/skeleton_rawdev.c
> index aa3beaad18..8896f0c9c5 100644
> --- a/drivers/raw/skeleton/skeleton_rawdev.c
> +++ b/drivers/raw/skeleton/skeleton_rawdev.c
> @@ -768,4 +768,4 @@ static struct rte_vdev_driver skeleton_pmd_drv = {
>  };
> 
>  RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME,
> skeleton_pmd_drv);
> -RTE_LOG_REGISTER(skeleton_pmd_logtype, rawdev.skeleton, INFO);
> +RTE_LOG_REGISTER(skeleton_pmd_logtype, pmd.raw.skeleton, INFO);
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 6a1b44bc77..bf7afe4610 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -25,7 +25,7 @@
> 
>  #include "base/ifcvf.h"
> 
> -RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
> +RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
>  #define DRV_LOG(level, fmt, args...) \
>  	rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
>  		"IFCVF %s(): " fmt "\n", __func__, ##args)
> --
> 2.30.1

For vdpa/ifc part:
Acked-by: Xiao Wang <xiao.w.wang@intel.com>


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

* Re: [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 3/3] drivers: align log names Thomas Monjalon
                     ` (2 preceding siblings ...)
  2021-03-11  3:02   ` Wang, Xiao W
@ 2021-03-12  7:39   ` Hemant Agrawal
  2021-03-19 16:29   ` David Marchand
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 37+ messages in thread
From: Hemant Agrawal @ 2021-03-12  7:39 UTC (permalink / raw)
  To: dev

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>



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

* Re: [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 3/3] drivers: align log names Thomas Monjalon
                     ` (3 preceding siblings ...)
  2021-03-12  7:39   ` Hemant Agrawal
@ 2021-03-19 16:29   ` David Marchand
  2021-03-19 17:14     ` Thomas Monjalon
  2021-03-19 16:53   ` Ajit Khaparde
  2021-03-22 10:33   ` David Marchand
  6 siblings, 1 reply; 37+ messages in thread
From: David Marchand @ 2021-03-19 16:29 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, John Griffin, Fiona Trahe, Deepak Kumar Jain, Ajit Khaparde,
	Raveendra Padasalagi, Vikas Gupta, Rosen Xu, Tianfei zhang,
	Bruce Richardson, Nipun Gupta, Hemant Agrawal, Xiao Wang

On Wed, Mar 10, 2021 at 3:02 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The log levels are configured by using the name of the logs.
> Some drivers are aligned to follow a common log name standard:
>         pmd.class.driver[.sub]
> Some "common" drivers skip the "class" part:
>         pmd.driver.sub

Without a check, this is likely to happen again.
I cooked this:

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 78a408ef98..dc52569792 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -199,6 +199,41 @@ check_internal_tags() { # <patch>
        return $res
 }

+check_log_levels() { # <patch>
+       res=0
+
+       cat "$1" |awk '
+       BEGIN {
+               pattern = "";
+               ret = 0;
+       }
+       /^+++ b\// {
+               count = split($2, path, "/")
+               if (count >= 4 && path[2] == "lib") {
+                       pattern = "lib\\." gensub(/librte_(.*)/,
"\\1", "", path[3])
+               } else if (count >= 5 && path[2] == "drivers") {
+                       pattern = "pmd\\." path[3] "\\." path[4]
+               } else {
+                       pattern = "";
+               }
+       }
+       /^+.*RTE_LOG_REGISTER\([^,]+,[^,]+,/ {
+               if (pattern == "") {
+                       next;
+               }
+               if (! ($0 ~ "RTE_LOG_REGISTER\\([^,]+, " pattern
"(|\\.[^,]+),")) {
+                       print $0
+                       print "Added logtype does not comply with
pattern: " gensub(/\\/, "", "g", pattern)
+                       ret = 1;
+               }
+       }
+       END {
+               exit ret;
+       }' || res=1
+
+       return $res
+}
+
 number=0
 range='origin/main..'
 quiet=false
@@ -290,6 +325,14 @@ check () { # <patch> <commit> <title>
                ret=1
        fi

+       ! $verbose || printf '\nChecking RTE_LOG_REGISTER:\n'
+       report=$(check_log_levels "$tmpinput")
+       if [ $? -ne 0 ] ; then
+               $headline_printed || print_headline "$3"
+               printf '%s\n' "$report"
+               ret=1
+       fi
+
        if [ "$tmpinput" != "$1" ]; then
                rm -f "$tmpinput"
                trap - INT


Which for following patch:

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 761a0f26bb..ef6e3b2d0c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -8452,7 +8452,8 @@ 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_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.init, NOTICE);
+RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgb.init, NOTICE);
+RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.plop, NOTICE);
 RTE_LOG_REGISTER(ixgbe_logtype_driver, pmd.net.ixgbe.driver, NOTICE);

 #ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
diff --git a/lib/librte_compressdev/rte_compressdev.c
b/lib/librte_compressdev/rte_compressdev.c
index 49a342f400..d444685053 100644
--- a/lib/librte_compressdev/rte_compressdev.c
+++ b/lib/librte_compressdev/rte_compressdev.c
@@ -764,3 +764,5 @@ rte_compressdev_name_get(uint8_t dev_id)
 }

 RTE_LOG_REGISTER(compressdev_logtype, lib.compressdev, NOTICE);
+RTE_LOG_REGISTER(compressdev_logtype, lib.compressdev, NOTICE);
+RTE_LOG_REGISTER(compressdev_logtype, lib.compressde, NOTICE);


Triggers:

$ ./devtools/checkpatches.sh -n1
...

+RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgb.init, NOTICE);
Added logtype does not comply with pattern: pmd.net.ixgbe
+RTE_LOG_REGISTER(compressdev_logtype, lib.compressde, NOTICE);
Added logtype does not comply with pattern: lib.compressdev


WDYT?


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 3/3] drivers: align log names Thomas Monjalon
                     ` (4 preceding siblings ...)
  2021-03-19 16:29   ` David Marchand
@ 2021-03-19 16:53   ` Ajit Khaparde
  2021-03-22 10:33   ` David Marchand
  6 siblings, 0 replies; 37+ messages in thread
From: Ajit Khaparde @ 2021-03-19 16:53 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dpdk-dev, John Griffin, Fiona Trahe, Deepak Kumar Jain,
	Raveendra Padasalagi, Vikas Gupta, Rosen Xu, Tianfei zhang,
	Bruce Richardson, Nipun Gupta, Hemant Agrawal, Xiao Wang

[-- Attachment #1: Type: text/plain, Size: 5561 bytes --]

On Wed, Mar 10, 2021 at 6:01 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The log levels are configured by using the name of the logs.
> Some drivers are aligned to follow a common log name standard:
>         pmd.class.driver[.sub]
> Some "common" drivers skip the "class" part:
>         pmd.driver.sub
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  doc/guides/cryptodevs/qat.rst          | 10 +++++-----
>  drivers/common/qat/qat_logs.c          |  4 ++--
>  drivers/crypto/bcmfs/bcmfs_logs.c      |  4 ++--
For bcmfs,
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

>  drivers/raw/ifpga/ifpga_rawdev.c       |  2 +-
>  drivers/raw/ioat/ioat_rawdev.c         |  2 +-
>  drivers/raw/skeleton/skeleton_rawdev.c |  2 +-
>  drivers/vdpa/ifc/ifcvf_vdpa.c          |  2 +-
>  7 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
> index cf16f03503..224b22b3f7 100644
> --- a/doc/guides/cryptodevs/qat.rst
> +++ b/doc/guides/cryptodevs/qat.rst
> @@ -659,15 +659,15 @@ 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.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.general,8"
> +    --log-level="pmd.qat.dp,8"
>      --log-level="pmd.qat,8"
>
>  .. Note::
> @@ -678,4 +678,4 @@ the process cmdline, e.g. using any of the following::
>      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"
> +       --log-level="7" --log-level="pmd.qat.general,8"
> diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
> index fa48be53c3..adbe163cd9 100644
> --- a/drivers/common/qat/qat_logs.c
> +++ b/drivers/common/qat/qat_logs.c
> @@ -17,5 +17,5 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
>         return 0;
>  }
>
> -RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat_general, NOTICE);
> -RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat_dp, NOTICE);
> +RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat.general, NOTICE);
> +RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat.dp, NOTICE);
> diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c b/drivers/crypto/bcmfs/bcmfs_logs.c
> index 701da9ecf3..9faf12f238 100644
> --- a/drivers/crypto/bcmfs/bcmfs_logs.c
> +++ b/drivers/crypto/bcmfs/bcmfs_logs.c
> @@ -21,5 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
>         return 0;
>  }
>
> -RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
> -RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
> +RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.crypto.bcmfs.config, NOTICE)
> +RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.crypto.bcmfs.fp, NOTICE)
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
> index 27129b133e..56b1866f77 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -1611,7 +1611,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_LOG_REGISTER(ifpga_rawdev_logtype, driver.raw.init, NOTICE);
> +RTE_LOG_REGISTER(ifpga_rawdev_logtype, pmd.raw.ifpga, 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 a95854d5ac..15af07017c 100644
> --- a/drivers/raw/ioat/ioat_rawdev.c
> +++ b/drivers/raw/ioat/ioat_rawdev.c
> @@ -28,7 +28,7 @@ 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);
> +RTE_LOG_REGISTER(ioat_pmd_logtype, pmd.raw.ioat, INFO);
>
>  #define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc)
>  #define COMPLETION_SZ sizeof(__m128i)
> diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
> index aa3beaad18..8896f0c9c5 100644
> --- a/drivers/raw/skeleton/skeleton_rawdev.c
> +++ b/drivers/raw/skeleton/skeleton_rawdev.c
> @@ -768,4 +768,4 @@ static struct rte_vdev_driver skeleton_pmd_drv = {
>  };
>
>  RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME, skeleton_pmd_drv);
> -RTE_LOG_REGISTER(skeleton_pmd_logtype, rawdev.skeleton, INFO);
> +RTE_LOG_REGISTER(skeleton_pmd_logtype, pmd.raw.skeleton, INFO);
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 6a1b44bc77..bf7afe4610 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -25,7 +25,7 @@
>
>  #include "base/ifcvf.h"
>
> -RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
> +RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
>  #define DRV_LOG(level, fmt, args...) \
>         rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
>                 "IFCVF %s(): " fmt "\n", __func__, ##args)
> --
> 2.30.1
>

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

* Re: [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-19 16:29   ` David Marchand
@ 2021-03-19 17:14     ` Thomas Monjalon
  2021-03-19 20:38       ` David Marchand
  0 siblings, 1 reply; 37+ messages in thread
From: Thomas Monjalon @ 2021-03-19 17:14 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, John Griffin, Fiona Trahe, Deepak Kumar Jain, Ajit Khaparde,
	Raveendra Padasalagi, Vikas Gupta, Rosen Xu, Tianfei zhang,
	Bruce Richardson, Nipun Gupta, Hemant Agrawal, Xiao Wang

19/03/2021 17:29, David Marchand:
> On Wed, Mar 10, 2021 at 3:02 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > The log levels are configured by using the name of the logs.
> > Some drivers are aligned to follow a common log name standard:
> >         pmd.class.driver[.sub]
> > Some "common" drivers skip the "class" part:
> >         pmd.driver.sub
> 
> Without a check, this is likely to happen again.
> I cooked this:
[...]
> +RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgb.init, NOTICE);
> Added logtype does not comply with pattern: pmd.net.ixgbe
> +RTE_LOG_REGISTER(compressdev_logtype, lib.compressde, NOTICE);
> Added logtype does not comply with pattern: lib.compressdev
> 
> WDYT?

I cannot parse awk but it looks nice.
And in general, have more tools is a good thing.
Would you submit this tool as a patch?




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

* Re: [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-19 17:14     ` Thomas Monjalon
@ 2021-03-19 20:38       ` David Marchand
  0 siblings, 0 replies; 37+ messages in thread
From: David Marchand @ 2021-03-19 20:38 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, John Griffin, Fiona Trahe, Deepak Kumar Jain, Ajit Khaparde,
	Raveendra Padasalagi, Vikas Gupta, Rosen Xu, Tianfei zhang,
	Bruce Richardson, Nipun Gupta, Hemant Agrawal, Xiao Wang

On Fri, Mar 19, 2021 at 6:15 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 19/03/2021 17:29, David Marchand:
> > On Wed, Mar 10, 2021 at 3:02 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > >
> > > The log levels are configured by using the name of the logs.
> > > Some drivers are aligned to follow a common log name standard:
> > >         pmd.class.driver[.sub]
> > > Some "common" drivers skip the "class" part:
> > >         pmd.driver.sub
> >
> > Without a check, this is likely to happen again.
> > I cooked this:
> [...]
> > +RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgb.init, NOTICE);
> > Added logtype does not comply with pattern: pmd.net.ixgbe
> > +RTE_LOG_REGISTER(compressdev_logtype, lib.compressde, NOTICE);
> > Added logtype does not comply with pattern: lib.compressdev
> >
> > WDYT?
>
> I cannot parse awk but it looks nice.
> And in general, have more tools is a good thing.
> Would you submit this tool as a patch?

http://inbox.dpdk.org/dev/20210319203737.13526-1-david.marchand@redhat.com/T/#u


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 3/3] drivers: align log names Thomas Monjalon
                     ` (5 preceding siblings ...)
  2021-03-19 16:53   ` Ajit Khaparde
@ 2021-03-22 10:33   ` David Marchand
  2021-04-05  9:52     ` Thomas Monjalon
  6 siblings, 1 reply; 37+ messages in thread
From: David Marchand @ 2021-03-22 10:33 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, John Griffin, Fiona Trahe, Deepak Kumar Jain, Ajit Khaparde,
	Raveendra Padasalagi, Vikas Gupta, Rosen Xu, Tianfei zhang,
	Bruce Richardson, Nipun Gupta, Hemant Agrawal, Xiao Wang

On Wed, Mar 10, 2021 at 3:02 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 6a1b44bc77..bf7afe4610 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -25,7 +25,7 @@
>
>  #include "base/ifcvf.h"
>
> -RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
> +RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);

The driver is in drivers/vdpa/ifc, I would expect pmd.vdpa.ifc


We have some little variations for the af_packet and bonding drivers,
worth aligning from my pov.
drivers/net/af_packet/rte_eth_af_packet.c:RTE_LOG_REGISTER(af_packet_logtype,
pmd.net.packet, NOTICE);
drivers/net/bonding/rte_eth_bond_pmd.c:RTE_LOG_REGISTER(bond_logtype,
pmd.net.bond, NOTICE);


And ipn3ke is odd too:
drivers/net/ipn3ke/ipn3ke_ethdev.c:RTE_LOG_REGISTER(ipn3ke_afu_logtype,
pmd.afu.ipn3ke, NOTICE);


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH 1/3] log: choose EAL log type on registration failure
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 1/3] log: choose EAL log type on registration failure Thomas Monjalon
@ 2021-03-23 18:22   ` David Marchand
  2021-03-23 18:43     ` Thomas Monjalon
  0 siblings, 1 reply; 37+ messages in thread
From: David Marchand @ 2021-03-23 18:22 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Andrew Rybchenko

On Wed, Mar 10, 2021 at 3:01 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> In the unlikely case where something goes wrong
> while registering a log type,
> the fallback is to use the log type 0, assigned to EAL.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  lib/librte_eal/include/rte_log.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h
> index e6192892c3..178a265c3f 100644
> --- a/lib/librte_eal/include/rte_log.h
> +++ b/lib/librte_eal/include/rte_log.h
> @@ -392,6 +392,7 @@ RTE_INIT(__##type)                                                  \
>  {                                                                      \
>         type = rte_log_register_type_and_pick_level(RTE_STR(name),      \
>                                                     RTE_LOG_##level);   \
> +       type = RTE_MAX(0, type);                                        \
>  }

Hard to read and to grep, can we use explicit logtype?

if (type < 0)
    type = RTE_LOGTYPE_EAL;


-- 
David Marchand


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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 2/3] drivers: fix log level after loading
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 2/3] drivers: fix log level after loading Thomas Monjalon
@ 2021-03-23 18:25   ` David Marchand
  2021-03-23 18:50   ` [dpdk-dev] " Ajit Khaparde
  1 sibling, 0 replies; 37+ messages in thread
From: David Marchand @ 2021-03-23 18:25 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, dpdk stable, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Ajit Khaparde, Raveendra Padasalagi,
	Vikas Gupta, Jeff Guo, Haiyue Wang, Adam Dybkowski, Jerin Jacob,
	Akhil Goyal, Sachin Saxena

On Wed, Mar 10, 2021 at 3:01 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> When compiled as a shared object, and loaded at runtime as a plugin,
> the drivers should get the log level set earlier at EAL init
> by the user through --log-level option.
>
> The function for applying the log level setting is
> rte_log_register_type_and_pick_level().
> It is called by most drivers via RTE_LOG_REGISTER().
>
> The drivers common/mlx5, bcmfs and e1000 were missing,
> so the user-specified log level was not applied when
> those drivers were loaded as plugins.
> The macro RTE_LOG_REGISTER() is used for those drivers.
>
> The unnecessary protection for double registration
> is removed from e1000.
>
> Fixes: 9c99878aa1b1 ("log: introduce logtype register macro")
> Fixes: c8e79da7c676 ("crypto/bcmfs: introduce BCMFS driver")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH 1/3] log: choose EAL log type on registration failure
  2021-03-23 18:22   ` David Marchand
@ 2021-03-23 18:43     ` Thomas Monjalon
  0 siblings, 0 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-03-23 18:43 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Andrew Rybchenko

23/03/2021 19:22, David Marchand:
> On Wed, Mar 10, 2021 at 3:01 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > In the unlikely case where something goes wrong
> > while registering a log type,
> > the fallback is to use the log type 0, assigned to EAL.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
[...]
> >  {                                                                      \
> >         type = rte_log_register_type_and_pick_level(RTE_STR(name),      \
> >                                                     RTE_LOG_##level);   \
> > +       type = RTE_MAX(0, type);                                        \
> >  }
> 
> Hard to read and to grep, can we use explicit logtype?
> 
> if (type < 0)
>     type = RTE_LOGTYPE_EAL;

Yes I agree it is better because we can grep the explicit name.



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

* Re: [dpdk-dev] [PATCH 2/3] drivers: fix log level after loading
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 2/3] drivers: fix log level after loading Thomas Monjalon
  2021-03-23 18:25   ` [dpdk-dev] [dpdk-stable] " David Marchand
@ 2021-03-23 18:50   ` Ajit Khaparde
  1 sibling, 0 replies; 37+ messages in thread
From: Ajit Khaparde @ 2021-03-23 18:50 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dpdk-dev, dpdk stable, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Raveendra Padasalagi, Vikas Gupta,
	Jeff Guo, Haiyue Wang, Adam Dybkowski, Jerin Jacob, Akhil Goyal,
	Sachin Saxena

[-- Attachment #1: Type: text/plain, Size: 6756 bytes --]

On Wed, Mar 10, 2021 at 6:01 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> When compiled as a shared object, and loaded at runtime as a plugin,
> the drivers should get the log level set earlier at EAL init
> by the user through --log-level option.
>
> The function for applying the log level setting is
> rte_log_register_type_and_pick_level().
> It is called by most drivers via RTE_LOG_REGISTER().
>
> The drivers common/mlx5, bcmfs and e1000 were missing,
> so the user-specified log level was not applied when
> those drivers were loaded as plugins.
> The macro RTE_LOG_REGISTER() is used for those drivers.
>
> The unnecessary protection for double registration
> is removed from e1000.
>
> Fixes: 9c99878aa1b1 ("log: introduce logtype register macro")
> Fixes: c8e79da7c676 ("crypto/bcmfs: introduce BCMFS driver")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/common/mlx5/mlx5_common.c |  9 +-----
>  drivers/crypto/bcmfs/bcmfs_logs.c | 17 ++---------
For bcmfs,
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

>  drivers/net/e1000/e1000_logs.c    | 49 ++++---------------------------
>  drivers/net/e1000/em_ethdev.c     |  6 ----
>  drivers/net/e1000/igb_ethdev.c    |  6 ----
>  5 files changed, 8 insertions(+), 79 deletions(-)
>
> diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
> index c26a2cfa30..f92f05bda5 100644
> --- a/drivers/common/mlx5/mlx5_common.c
> +++ b/drivers/common/mlx5/mlx5_common.c
> @@ -14,8 +14,6 @@
>  #include "mlx5_common_utils.h"
>  #include "mlx5_common_pci.h"
>
> -int mlx5_common_logtype;
> -
>  uint8_t haswell_broadwell_cpu;
>
>  /* In case this is an x86_64 intel processor to check if
> @@ -41,12 +39,7 @@ static inline void mlx5_cpu_id(unsigned int level,
>  }
>  #endif
>
> -RTE_INIT_PRIO(mlx5_log_init, LOG)
> -{
> -       mlx5_common_logtype = rte_log_register("pmd.common.mlx5");
> -       if (mlx5_common_logtype >= 0)
> -               rte_log_set_level(mlx5_common_logtype, RTE_LOG_NOTICE);
> -}
> +RTE_LOG_REGISTER(mlx5_common_logtype, pmd.common.mlx5, NOTICE)
>
>  static bool mlx5_common_initialized;
>
> diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c b/drivers/crypto/bcmfs/bcmfs_logs.c
> index 86f4ff3b53..701da9ecf3 100644
> --- a/drivers/crypto/bcmfs/bcmfs_logs.c
> +++ b/drivers/crypto/bcmfs/bcmfs_logs.c
> @@ -8,9 +8,6 @@
>
>  #include "bcmfs_logs.h"
>
> -int bcmfs_conf_logtype;
> -int bcmfs_dp_logtype;
> -
>  int
>  bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
>                 const void *buf, unsigned int len)
> @@ -24,15 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
>         return 0;
>  }
>
> -RTE_INIT(bcmfs_device_init_log)
> -{
> -       /* Configuration and general logs */
> -       bcmfs_conf_logtype = rte_log_register("pmd.bcmfs_config");
> -       if (bcmfs_conf_logtype >= 0)
> -               rte_log_set_level(bcmfs_conf_logtype, RTE_LOG_NOTICE);
> -
> -       /* data-path logs */
> -       bcmfs_dp_logtype = rte_log_register("pmd.bcmfs_fp");
> -       if (bcmfs_dp_logtype >= 0)
> -               rte_log_set_level(bcmfs_dp_logtype, RTE_LOG_NOTICE);
> -}
> +RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
> +RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
> diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
> index 231f5c03ef..d9b8a4672f 100644
> --- a/drivers/net/e1000/e1000_logs.c
> +++ b/drivers/net/e1000/e1000_logs.c
> @@ -4,53 +4,14 @@
>
>  #include "e1000_logs.h"
>
> -/* declared as extern in e1000_logs.h */
> -int e1000_logtype_init;
> -int e1000_logtype_driver;
> -
> +RTE_LOG_REGISTER(e1000_logtype_init, pmd.net.e1000.init, NOTICE)
> +RTE_LOG_REGISTER(e1000_logtype_driver, pmd.net.e1000.driver, NOTICE)
>  #ifdef RTE_LIBRTE_E1000_DEBUG_RX
> -int e1000_logtype_rx;
> +RTE_LOG_REGISTER(e1000_logtype_rx, pmd.net.e1000.rx, DEBUG)
>  #endif
>  #ifdef RTE_LIBRTE_E1000_DEBUG_TX
> -int e1000_logtype_tx;
> +RTE_LOG_REGISTER(e1000_logtype_tx, pmd.net.e1000.tx, DEBUG)
>  #endif
>  #ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
> -int e1000_logtype_tx_free;
> +RTE_LOG_REGISTER(e1000_logtype_tx_free, pmd.net.e1000.tx_free, DEBUG)
>  #endif
> -
> -/* 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)
> -               return;
> -
> -       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);
> -
> -#ifdef RTE_LIBRTE_E1000_DEBUG_RX
> -       e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
> -       if (e1000_logtype_rx >= 0)
> -               rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
> -#endif
> -
> -#ifdef RTE_LIBRTE_E1000_DEBUG_TX
> -       e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
> -       if (e1000_logtype_tx >= 0)
> -               rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
> -#endif
> -
> -#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
> -       e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
> -       if (e1000_logtype_tx_free >= 0)
> -               rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
> -#endif
> -
> -       e1000_log_initialized = 1;
> -}
> diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
> index 9b8c4a7de5..79a6d8f461 100644
> --- a/drivers/net/e1000/em_ethdev.c
> +++ b/drivers/net/e1000/em_ethdev.c
> @@ -1846,9 +1846,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 5323504e98..395dc3f5aa 100644
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -5434,9 +5434,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();
> -}
> --
> 2.30.1
>

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

* Re: [dpdk-dev] [PATCH 3/3] drivers: align log names
  2021-03-22 10:33   ` David Marchand
@ 2021-04-05  9:52     ` Thomas Monjalon
  0 siblings, 0 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-05  9:52 UTC (permalink / raw)
  To: Rosen Xu, Xiao Wang, David Marchand
  Cc: dev, John Griffin, Fiona Trahe, Deepak Kumar Jain, Ajit Khaparde,
	Raveendra Padasalagi, Vikas Gupta, Tianfei zhang,
	Bruce Richardson, Nipun Gupta, Hemant Agrawal

22/03/2021 11:33, David Marchand:
> On Wed, Mar 10, 2021 at 3:02 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> > index 6a1b44bc77..bf7afe4610 100644
> > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> > @@ -25,7 +25,7 @@
> >
> >  #include "base/ifcvf.h"
> >
> > -RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
> > +RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
> 
> The driver is in drivers/vdpa/ifc, I would expect pmd.vdpa.ifc

I'm not sure for this one.
My understanding is that the name of the driver can be
a little different of the directory name, especially if having
multiple drivers in a directory.
Here there is only VF in IFC.

> We have some little variations for the af_packet and bonding drivers,
> worth aligning from my pov.
> drivers/net/af_packet/rte_eth_af_packet.c:RTE_LOG_REGISTER(af_packet_logtype,
> pmd.net.packet, NOTICE);
> drivers/net/bonding/rte_eth_bond_pmd.c:RTE_LOG_REGISTER(bond_logtype,
> pmd.net.bond, NOTICE);

Yes good catch, will align these two.

> And ipn3ke is odd too:
> drivers/net/ipn3ke/ipn3ke_ethdev.c:RTE_LOG_REGISTER(ipn3ke_afu_logtype,
> pmd.afu.ipn3ke, NOTICE);

I agree it's strange, but I don't understand ifpga and ipn3ke enough
to have a good judgement.
I feel more naming have to be carified in this driver.

I will highlight ifc and ipn3ke in v2 to have a conclusion.

Rosen, Xiao, please comment.



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

* [dpdk-dev] [PATCH v2 0/3] drivers: align log names
  2021-03-10 14:01 [dpdk-dev] [PATCH 0/3] cleanup drivers log registration Thomas Monjalon
                   ` (2 preceding siblings ...)
  2021-03-10 14:01 ` [dpdk-dev] [PATCH 3/3] drivers: align log names Thomas Monjalon
@ 2021-04-05 10:02 ` Thomas Monjalon
  2021-04-05 10:02   ` [dpdk-dev] [PATCH v2 1/3] log: choose EAL log type on registration failure Thomas Monjalon
                     ` (3 more replies)
  2021-04-06 13:22 ` [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration Thomas Monjalon
  4 siblings, 4 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-05 10:02 UTC (permalink / raw)
  To: dev

After working on the option "--log-level help",
it became clear that few adjustments were required
for the log registration of some drivers.

v2:
   - align bonding and af_packet
   - make explicit the RTE_LOGTYPE_EAL default

Thomas Monjalon (3):
  log: choose EAL log type on registration failure
  drivers: fix log level after loading
  drivers: align log names

 doc/guides/cryptodevs/qat.rst             | 10 ++---
 drivers/common/mlx5/mlx5_common.c         |  9 +----
 drivers/common/qat/qat_logs.c             |  4 +-
 drivers/crypto/bcmfs/bcmfs_logs.c         | 17 +-------
 drivers/net/af_packet/rte_eth_af_packet.c |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c    |  2 +-
 drivers/net/e1000/e1000_logs.c            | 49 +++--------------------
 drivers/net/e1000/em_ethdev.c             |  6 ---
 drivers/net/e1000/igb_ethdev.c            |  6 ---
 drivers/raw/ifpga/ifpga_rawdev.c          |  2 +-
 drivers/raw/ioat/ioat_rawdev.c            |  2 +-
 drivers/raw/skeleton/skeleton_rawdev.c    |  2 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c             |  2 +-
 lib/librte_eal/include/rte_log.h          |  2 +
 14 files changed, 23 insertions(+), 92 deletions(-)

-- 
2.31.1


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

* [dpdk-dev] [PATCH v2 1/3] log: choose EAL log type on registration failure
  2021-04-05 10:02 ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
@ 2021-04-05 10:02   ` Thomas Monjalon
  2021-04-06  9:17     ` David Marchand
  2021-04-05 10:03   ` [dpdk-dev] [PATCH v2 2/3] drivers: fix log level after loading Thomas Monjalon
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-05 10:02 UTC (permalink / raw)
  To: dev

In the unlikely case where something goes wrong
while registering a log type,
the fallback is to use the log type 0, assigned to EAL.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_eal/include/rte_log.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h
index 173004fd71..21a7d16340 100644
--- a/lib/librte_eal/include/rte_log.h
+++ b/lib/librte_eal/include/rte_log.h
@@ -380,6 +380,8 @@ RTE_INIT(__##type)							\
 {									\
 	type = rte_log_register_type_and_pick_level(RTE_STR(name),	\
 						    RTE_LOG_##level);	\
+	if (type < 0)                                                   \
+		type = RTE_LOGTYPE_EAL;                                 \
 }
 
 #ifdef __cplusplus
-- 
2.31.1


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

* [dpdk-dev] [PATCH v2 2/3] drivers: fix log level after loading
  2021-04-05 10:02 ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
  2021-04-05 10:02   ` [dpdk-dev] [PATCH v2 1/3] log: choose EAL log type on registration failure Thomas Monjalon
@ 2021-04-05 10:03   ` Thomas Monjalon
  2021-04-05 10:03   ` [dpdk-dev] [PATCH v2 3/3] drivers: align log names Thomas Monjalon
  2021-04-05 10:05   ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
  3 siblings, 0 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-05 10:03 UTC (permalink / raw)
  To: dev
  Cc: stable, David Marchand, Ajit Khaparde, Matan Azrad,
	Shahaf Shuler, Viacheslav Ovsiienko, Raveendra Padasalagi,
	Vikas Gupta, Jeff Guo, Haiyue Wang, Jerin Jacob, Adam Dybkowski,
	Sachin Saxena, Akhil Goyal

When compiled as a shared object, and loaded at runtime as a plugin,
the drivers should get the log level set earlier at EAL init
by the user through --log-level option.

The function for applying the log level setting is
rte_log_register_type_and_pick_level().
It is called by most drivers via RTE_LOG_REGISTER().

The drivers common/mlx5, bcmfs and e1000 were missing,
so the user-specified log level was not applied when
those drivers were loaded as plugins.
The macro RTE_LOG_REGISTER() is used for those drivers.

The unnecessary protection for double registration
is removed from e1000.

Fixes: 9c99878aa1b1 ("log: introduce logtype register macro")
Fixes: c8e79da7c676 ("crypto/bcmfs: introduce BCMFS driver")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/common/mlx5/mlx5_common.c |  9 +-----
 drivers/crypto/bcmfs/bcmfs_logs.c | 17 ++---------
 drivers/net/e1000/e1000_logs.c    | 49 ++++---------------------------
 drivers/net/e1000/em_ethdev.c     |  6 ----
 drivers/net/e1000/igb_ethdev.c    |  6 ----
 5 files changed, 8 insertions(+), 79 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
index c26a2cfa30..f92f05bda5 100644
--- a/drivers/common/mlx5/mlx5_common.c
+++ b/drivers/common/mlx5/mlx5_common.c
@@ -14,8 +14,6 @@
 #include "mlx5_common_utils.h"
 #include "mlx5_common_pci.h"
 
-int mlx5_common_logtype;
-
 uint8_t haswell_broadwell_cpu;
 
 /* In case this is an x86_64 intel processor to check if
@@ -41,12 +39,7 @@ static inline void mlx5_cpu_id(unsigned int level,
 }
 #endif
 
-RTE_INIT_PRIO(mlx5_log_init, LOG)
-{
-	mlx5_common_logtype = rte_log_register("pmd.common.mlx5");
-	if (mlx5_common_logtype >= 0)
-		rte_log_set_level(mlx5_common_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(mlx5_common_logtype, pmd.common.mlx5, NOTICE)
 
 static bool mlx5_common_initialized;
 
diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c b/drivers/crypto/bcmfs/bcmfs_logs.c
index 86f4ff3b53..701da9ecf3 100644
--- a/drivers/crypto/bcmfs/bcmfs_logs.c
+++ b/drivers/crypto/bcmfs/bcmfs_logs.c
@@ -8,9 +8,6 @@
 
 #include "bcmfs_logs.h"
 
-int bcmfs_conf_logtype;
-int bcmfs_dp_logtype;
-
 int
 bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 		const void *buf, unsigned int len)
@@ -24,15 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 	return 0;
 }
 
-RTE_INIT(bcmfs_device_init_log)
-{
-	/* Configuration and general logs */
-	bcmfs_conf_logtype = rte_log_register("pmd.bcmfs_config");
-	if (bcmfs_conf_logtype >= 0)
-		rte_log_set_level(bcmfs_conf_logtype, RTE_LOG_NOTICE);
-
-	/* data-path logs */
-	bcmfs_dp_logtype = rte_log_register("pmd.bcmfs_fp");
-	if (bcmfs_dp_logtype >= 0)
-		rte_log_set_level(bcmfs_dp_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
+RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 231f5c03ef..d9b8a4672f 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -4,53 +4,14 @@
 
 #include "e1000_logs.h"
 
-/* declared as extern in e1000_logs.h */
-int e1000_logtype_init;
-int e1000_logtype_driver;
-
+RTE_LOG_REGISTER(e1000_logtype_init, pmd.net.e1000.init, NOTICE)
+RTE_LOG_REGISTER(e1000_logtype_driver, pmd.net.e1000.driver, NOTICE)
 #ifdef RTE_LIBRTE_E1000_DEBUG_RX
-int e1000_logtype_rx;
+RTE_LOG_REGISTER(e1000_logtype_rx, pmd.net.e1000.rx, DEBUG)
 #endif
 #ifdef RTE_LIBRTE_E1000_DEBUG_TX
-int e1000_logtype_tx;
+RTE_LOG_REGISTER(e1000_logtype_tx, pmd.net.e1000.tx, DEBUG)
 #endif
 #ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-int e1000_logtype_tx_free;
+RTE_LOG_REGISTER(e1000_logtype_tx_free, pmd.net.e1000.tx_free, DEBUG)
 #endif
-
-/* 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)
-		return;
-
-	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);
-
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
-	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
-	if (e1000_logtype_rx >= 0)
-		rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
-#endif
-
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
-	e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
-	if (e1000_logtype_tx >= 0)
-		rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
-#endif
-
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-	e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
-	if (e1000_logtype_tx_free >= 0)
-		rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
-#endif
-
-	e1000_log_initialized = 1;
-}
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 3c6f643c19..3e7ccdbf09 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1850,9 +1850,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 17ee6e91a0..a1a72339ba 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -5421,9 +5421,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();
-}
-- 
2.31.1


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

* [dpdk-dev] [PATCH v2 3/3] drivers: align log names
  2021-04-05 10:02 ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
  2021-04-05 10:02   ` [dpdk-dev] [PATCH v2 1/3] log: choose EAL log type on registration failure Thomas Monjalon
  2021-04-05 10:03   ` [dpdk-dev] [PATCH v2 2/3] drivers: fix log level after loading Thomas Monjalon
@ 2021-04-05 10:03   ` Thomas Monjalon
  2021-04-06  1:19     ` Wang, Xiao W
                       ` (2 more replies)
  2021-04-05 10:05   ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
  3 siblings, 3 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-05 10:03 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, Rosen Xu, Xiao Wang, Hemant Agrawal,
	Ajit Khaparde, John Griffin, Fiona Trahe, Deepak Kumar Jain,
	Raveendra Padasalagi, Vikas Gupta, John W. Linville,
	Chas Williams, Min Hu (Connor),
	Tianfei zhang, Nipun Gupta

The log levels are configured by using the name of the logs.
Some drivers are aligned to follow a common log name standard:
	pmd.class.driver[.sub]
Some "common" drivers skip the "class" part:
	pmd.driver.sub

Two drivers have exceptions to be clarified:
	pmd.vdpa.ifcvf instead of pmd.vdpa.ifc
	pmd.afu.ipn3ke instead of pmd.net.ipn3ke

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 doc/guides/cryptodevs/qat.rst             | 10 +++++-----
 drivers/common/qat/qat_logs.c             |  4 ++--
 drivers/crypto/bcmfs/bcmfs_logs.c         |  4 ++--
 drivers/net/af_packet/rte_eth_af_packet.c |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c    |  2 +-
 drivers/raw/ifpga/ifpga_rawdev.c          |  2 +-
 drivers/raw/ioat/ioat_rawdev.c            |  2 +-
 drivers/raw/skeleton/skeleton_rawdev.c    |  2 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c             |  2 +-
 9 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
index cf16f03503..224b22b3f7 100644
--- a/doc/guides/cryptodevs/qat.rst
+++ b/doc/guides/cryptodevs/qat.rst
@@ -659,15 +659,15 @@ 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.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.general,8"
+    --log-level="pmd.qat.dp,8"
     --log-level="pmd.qat,8"
 
 .. Note::
@@ -678,4 +678,4 @@ the process cmdline, e.g. using any of the following::
     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"
+	--log-level="7" --log-level="pmd.qat.general,8"
diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
index fa48be53c3..adbe163cd9 100644
--- a/drivers/common/qat/qat_logs.c
+++ b/drivers/common/qat/qat_logs.c
@@ -17,5 +17,5 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 	return 0;
 }
 
-RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat_general, NOTICE);
-RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat_dp, NOTICE);
+RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat.general, NOTICE);
+RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat.dp, NOTICE);
diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c b/drivers/crypto/bcmfs/bcmfs_logs.c
index 701da9ecf3..9faf12f238 100644
--- a/drivers/crypto/bcmfs/bcmfs_logs.c
+++ b/drivers/crypto/bcmfs/bcmfs_logs.c
@@ -21,5 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 	return 0;
 }
 
-RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
-RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
+RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.crypto.bcmfs.config, NOTICE)
+RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.crypto.bcmfs.fp, NOTICE)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index bfe5a0a451..a04f7c773a 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -97,7 +97,7 @@ static struct rte_eth_link pmd_link = {
 	.link_autoneg = ETH_LINK_FIXED,
 };
 
-RTE_LOG_REGISTER(af_packet_logtype, pmd.net.packet, NOTICE);
+RTE_LOG_REGISTER(af_packet_logtype, pmd.net.af_packet, NOTICE);
 
 #define PMD_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, af_packet_logtype, \
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 24e3cf3c2e..2e9cea5b8e 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3775,4 +3775,4 @@ RTE_PMD_REGISTER_PARAM_STRING(net_bonding,
 	"up_delay=<int> "
 	"down_delay=<int>");
 
-RTE_LOG_REGISTER(bond_logtype, pmd.net.bond, NOTICE);
+RTE_LOG_REGISTER(bond_logtype, pmd.net.bonding, NOTICE);
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index 05d79bfcc2..d9a46ef915 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -1611,7 +1611,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_LOG_REGISTER(ifpga_rawdev_logtype, driver.raw.init, NOTICE);
+RTE_LOG_REGISTER(ifpga_rawdev_logtype, pmd.raw.ifpga, 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 a95854d5ac..15af07017c 100644
--- a/drivers/raw/ioat/ioat_rawdev.c
+++ b/drivers/raw/ioat/ioat_rawdev.c
@@ -28,7 +28,7 @@ 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);
+RTE_LOG_REGISTER(ioat_pmd_logtype, pmd.raw.ioat, INFO);
 
 #define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc)
 #define COMPLETION_SZ sizeof(__m128i)
diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index aa3beaad18..8896f0c9c5 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -768,4 +768,4 @@ static struct rte_vdev_driver skeleton_pmd_drv = {
 };
 
 RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME, skeleton_pmd_drv);
-RTE_LOG_REGISTER(skeleton_pmd_logtype, rawdev.skeleton, INFO);
+RTE_LOG_REGISTER(skeleton_pmd_logtype, pmd.raw.skeleton, INFO);
diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 39237aecf7..7a06f97429 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -26,7 +26,7 @@
 
 #include "base/ifcvf.h"
 
-RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
+RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
 #define DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
 		"IFCVF %s(): " fmt "\n", __func__, ##args)
-- 
2.31.1


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

* Re: [dpdk-dev] [PATCH v2 0/3] drivers: align log names
  2021-04-05 10:02 ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
                     ` (2 preceding siblings ...)
  2021-04-05 10:03   ` [dpdk-dev] [PATCH v2 3/3] drivers: align log names Thomas Monjalon
@ 2021-04-05 10:05   ` Thomas Monjalon
  3 siblings, 0 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-05 10:05 UTC (permalink / raw)
  To: dev

Sorry the name of the series should be "cleanup drivers log registration"

05/04/2021 12:02, Thomas Monjalon:
> After working on the option "--log-level help",
> it became clear that few adjustments were required
> for the log registration of some drivers.
> 
> v2:
>    - align bonding and af_packet
>    - make explicit the RTE_LOGTYPE_EAL default
> 
> Thomas Monjalon (3):
>   log: choose EAL log type on registration failure
>   drivers: fix log level after loading
>   drivers: align log names




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

* Re: [dpdk-dev] [PATCH v2 3/3] drivers: align log names
  2021-04-05 10:03   ` [dpdk-dev] [PATCH v2 3/3] drivers: align log names Thomas Monjalon
@ 2021-04-06  1:19     ` Wang, Xiao W
  2021-04-06  5:27     ` Xu, Rosen
  2021-04-06  6:02     ` Min Hu (Connor)
  2 siblings, 0 replies; 37+ messages in thread
From: Wang, Xiao W @ 2021-04-06  1:19 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: Richardson, Bruce, Xu, Rosen, Hemant Agrawal, Ajit Khaparde,
	Griffin, John, Trahe, Fiona, Jain, Deepak K,
	Raveendra Padasalagi, Vikas Gupta, John W. Linville,
	Chas Williams, Min Hu (Connor),
	Zhang, Tianfei, Nipun Gupta

Hi Thomas,	

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, April 5, 2021 6:03 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Xu, Rosen
> <rosen.xu@intel.com>; Wang, Xiao W <xiao.w.wang@intel.com>; Hemant
> Agrawal <hemant.agrawal@nxp.com>; Ajit Khaparde
> <ajit.khaparde@broadcom.com>; Griffin, John <john.griffin@intel.com>;
> Trahe, Fiona <fiona.trahe@intel.com>; Jain, Deepak K
> <deepak.k.jain@intel.com>; Raveendra Padasalagi
> <raveendra.padasalagi@broadcom.com>; Vikas Gupta
> <vikas.gupta@broadcom.com>; John W. Linville <linville@tuxdriver.com>;
> Chas Williams <chas3@att.com>; Min Hu (Connor)
> <humin29@huawei.com>; Zhang, Tianfei <tianfei.zhang@intel.com>; Nipun
> Gupta <nipun.gupta@nxp.com>
> Subject: [PATCH v2 3/3] drivers: align log names
> 
> The log levels are configured by using the name of the logs.
> Some drivers are aligned to follow a common log name standard:
> 	pmd.class.driver[.sub]
> Some "common" drivers skip the "class" part:
> 	pmd.driver.sub
> 
> Two drivers have exceptions to be clarified:
> 	pmd.vdpa.ifcvf instead of pmd.vdpa.ifc
> 	pmd.afu.ipn3ke instead of pmd.net.ipn3ke
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Rosen Xu <rosen.xu@intel.com>
> Acked-by: Xiao Wang <xiao.w.wang@intel.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>  doc/guides/cryptodevs/qat.rst             | 10 +++++-----
>  drivers/common/qat/qat_logs.c             |  4 ++--
>  drivers/crypto/bcmfs/bcmfs_logs.c         |  4 ++--
>  drivers/net/af_packet/rte_eth_af_packet.c |  2 +-
>  drivers/net/bonding/rte_eth_bond_pmd.c    |  2 +-
>  drivers/raw/ifpga/ifpga_rawdev.c          |  2 +-
>  drivers/raw/ioat/ioat_rawdev.c            |  2 +-
>  drivers/raw/skeleton/skeleton_rawdev.c    |  2 +-
>  drivers/vdpa/ifc/ifcvf_vdpa.c             |  2 +-
>  9 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
> index cf16f03503..224b22b3f7 100644
> --- a/doc/guides/cryptodevs/qat.rst
> +++ b/doc/guides/cryptodevs/qat.rst
> @@ -659,15 +659,15 @@ 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.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.general,8"
> +    --log-level="pmd.qat.dp,8"
>      --log-level="pmd.qat,8"
> 
>  .. Note::
> @@ -678,4 +678,4 @@ the process cmdline, e.g. using any of the following::
>      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"
> +	--log-level="7" --log-level="pmd.qat.general,8"
> diff --git a/drivers/common/qat/qat_logs.c
> b/drivers/common/qat/qat_logs.c
> index fa48be53c3..adbe163cd9 100644
> --- a/drivers/common/qat/qat_logs.c
> +++ b/drivers/common/qat/qat_logs.c
> @@ -17,5 +17,5 @@ qat_hexdump_log(uint32_t level, uint32_t logtype,
> const char *title,
>  	return 0;
>  }
> 
> -RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat_general, NOTICE);
> -RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat_dp, NOTICE);
> +RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat.general, NOTICE);
> +RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat.dp, NOTICE);
> diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c
> b/drivers/crypto/bcmfs/bcmfs_logs.c
> index 701da9ecf3..9faf12f238 100644
> --- a/drivers/crypto/bcmfs/bcmfs_logs.c
> +++ b/drivers/crypto/bcmfs/bcmfs_logs.c
> @@ -21,5 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype,
> const char *title,
>  	return 0;
>  }
> 
> -RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
> -RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
> +RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.crypto.bcmfs.config,
> NOTICE)
> +RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.crypto.bcmfs.fp, NOTICE)
> diff --git a/drivers/net/af_packet/rte_eth_af_packet.c
> b/drivers/net/af_packet/rte_eth_af_packet.c
> index bfe5a0a451..a04f7c773a 100644
> --- a/drivers/net/af_packet/rte_eth_af_packet.c
> +++ b/drivers/net/af_packet/rte_eth_af_packet.c
> @@ -97,7 +97,7 @@ static struct rte_eth_link pmd_link = {
>  	.link_autoneg = ETH_LINK_FIXED,
>  };
> 
> -RTE_LOG_REGISTER(af_packet_logtype, pmd.net.packet, NOTICE);
> +RTE_LOG_REGISTER(af_packet_logtype, pmd.net.af_packet, NOTICE);
> 
>  #define PMD_LOG(level, fmt, args...) \
>  	rte_log(RTE_LOG_ ## level, af_packet_logtype, \
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c
> b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 24e3cf3c2e..2e9cea5b8e 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -3775,4 +3775,4 @@
> RTE_PMD_REGISTER_PARAM_STRING(net_bonding,
>  	"up_delay=<int> "
>  	"down_delay=<int>");
> 
> -RTE_LOG_REGISTER(bond_logtype, pmd.net.bond, NOTICE);
> +RTE_LOG_REGISTER(bond_logtype, pmd.net.bonding, NOTICE);
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> b/drivers/raw/ifpga/ifpga_rawdev.c
> index 05d79bfcc2..d9a46ef915 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -1611,7 +1611,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_LOG_REGISTER(ifpga_rawdev_logtype, driver.raw.init, NOTICE);
> +RTE_LOG_REGISTER(ifpga_rawdev_logtype, pmd.raw.ifpga, 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 a95854d5ac..15af07017c 100644
> --- a/drivers/raw/ioat/ioat_rawdev.c
> +++ b/drivers/raw/ioat/ioat_rawdev.c
> @@ -28,7 +28,7 @@ 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);
> +RTE_LOG_REGISTER(ioat_pmd_logtype, pmd.raw.ioat, INFO);
> 
>  #define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc)
>  #define COMPLETION_SZ sizeof(__m128i)
> diff --git a/drivers/raw/skeleton/skeleton_rawdev.c
> b/drivers/raw/skeleton/skeleton_rawdev.c
> index aa3beaad18..8896f0c9c5 100644
> --- a/drivers/raw/skeleton/skeleton_rawdev.c
> +++ b/drivers/raw/skeleton/skeleton_rawdev.c
> @@ -768,4 +768,4 @@ static struct rte_vdev_driver skeleton_pmd_drv = {
>  };
> 
>  RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME,
> skeleton_pmd_drv);
> -RTE_LOG_REGISTER(skeleton_pmd_logtype, rawdev.skeleton, INFO);
> +RTE_LOG_REGISTER(skeleton_pmd_logtype, pmd.raw.skeleton, INFO);
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 39237aecf7..7a06f97429 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -26,7 +26,7 @@
> 
>  #include "base/ifcvf.h"
> 
> -RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
> +RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
>  #define DRV_LOG(level, fmt, args...) \
>  	rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
>  		"IFCVF %s(): " fmt "\n", __func__, ##args)
> --
> 2.31.1

For this vdpa/ifc part:
Acked-by: Xiao Wang <xiao.w.wang@intel.com>

BRs,
Xiao


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

* Re: [dpdk-dev] [PATCH v2 3/3] drivers: align log names
  2021-04-05 10:03   ` [dpdk-dev] [PATCH v2 3/3] drivers: align log names Thomas Monjalon
  2021-04-06  1:19     ` Wang, Xiao W
@ 2021-04-06  5:27     ` Xu, Rosen
  2021-04-06  9:31       ` Thomas Monjalon
  2021-04-06  6:02     ` Min Hu (Connor)
  2 siblings, 1 reply; 37+ messages in thread
From: Xu, Rosen @ 2021-04-06  5:27 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: Richardson, Bruce, Wang, Xiao W, Hemant Agrawal, Ajit Khaparde,
	Griffin, John, Trahe, Fiona, Jain, Deepak K,
	Raveendra Padasalagi, Vikas Gupta, John W. Linville,
	Chas Williams, Min Hu (Connor),
	Zhang, Tianfei, Nipun Gupta

Hi,

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, April 05, 2021 18:03
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Xu, Rosen
> <rosen.xu@intel.com>; Wang, Xiao W <xiao.w.wang@intel.com>; Hemant
> Agrawal <hemant.agrawal@nxp.com>; Ajit Khaparde
> <ajit.khaparde@broadcom.com>; Griffin, John <john.griffin@intel.com>;
> Trahe, Fiona <fiona.trahe@intel.com>; Jain, Deepak K
> <deepak.k.jain@intel.com>; Raveendra Padasalagi
> <raveendra.padasalagi@broadcom.com>; Vikas Gupta
> <vikas.gupta@broadcom.com>; John W. Linville <linville@tuxdriver.com>;
> Chas Williams <chas3@att.com>; Min Hu (Connor) <humin29@huawei.com>;
> Zhang, Tianfei <tianfei.zhang@intel.com>; Nipun Gupta
> <nipun.gupta@nxp.com>
> Subject: [PATCH v2 3/3] drivers: align log names
> 
> The log levels are configured by using the name of the logs.
> Some drivers are aligned to follow a common log name standard:
> 	pmd.class.driver[.sub]
> Some "common" drivers skip the "class" part:
> 	pmd.driver.sub
> 
> Two drivers have exceptions to be clarified:
> 	pmd.vdpa.ifcvf instead of pmd.vdpa.ifc
> 	pmd.afu.ipn3ke instead of pmd.net.ipn3ke
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Rosen Xu <rosen.xu@intel.com>
> Acked-by: Xiao Wang <xiao.w.wang@intel.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>  doc/guides/cryptodevs/qat.rst             | 10 +++++-----
>  drivers/common/qat/qat_logs.c             |  4 ++--
>  drivers/crypto/bcmfs/bcmfs_logs.c         |  4 ++--
>  drivers/net/af_packet/rte_eth_af_packet.c |  2 +-
>  drivers/net/bonding/rte_eth_bond_pmd.c    |  2 +-
>  drivers/raw/ifpga/ifpga_rawdev.c          |  2 +-
>  drivers/raw/ioat/ioat_rawdev.c            |  2 +-
>  drivers/raw/skeleton/skeleton_rawdev.c    |  2 +-
>  drivers/vdpa/ifc/ifcvf_vdpa.c             |  2 +-
>  9 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
> index cf16f03503..224b22b3f7 100644
> --- a/doc/guides/cryptodevs/qat.rst
> +++ b/doc/guides/cryptodevs/qat.rst
> @@ -659,15 +659,15 @@ 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.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.general,8"
> +    --log-level="pmd.qat.dp,8"
>      --log-level="pmd.qat,8"
> 
>  .. Note::
> @@ -678,4 +678,4 @@ the process cmdline, e.g. using any of the following::
>      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"
> +	--log-level="7" --log-level="pmd.qat.general,8"
> diff --git a/drivers/common/qat/qat_logs.c
> b/drivers/common/qat/qat_logs.c index fa48be53c3..adbe163cd9 100644
> --- a/drivers/common/qat/qat_logs.c
> +++ b/drivers/common/qat/qat_logs.c
> @@ -17,5 +17,5 @@ qat_hexdump_log(uint32_t level, uint32_t logtype,
> const char *title,
>  	return 0;
>  }
> 
> -RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat_general, NOTICE); -
> RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat_dp, NOTICE);
> +RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat.general, NOTICE);
> +RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat.dp, NOTICE);
> diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c
> b/drivers/crypto/bcmfs/bcmfs_logs.c
> index 701da9ecf3..9faf12f238 100644
> --- a/drivers/crypto/bcmfs/bcmfs_logs.c
> +++ b/drivers/crypto/bcmfs/bcmfs_logs.c
> @@ -21,5 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype,
> const char *title,
>  	return 0;
>  }
> 
> -RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE) -
> RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
> +RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.crypto.bcmfs.config, NOTICE)
> +RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.crypto.bcmfs.fp, NOTICE)
> diff --git a/drivers/net/af_packet/rte_eth_af_packet.c
> b/drivers/net/af_packet/rte_eth_af_packet.c
> index bfe5a0a451..a04f7c773a 100644
> --- a/drivers/net/af_packet/rte_eth_af_packet.c
> +++ b/drivers/net/af_packet/rte_eth_af_packet.c
> @@ -97,7 +97,7 @@ static struct rte_eth_link pmd_link = {
>  	.link_autoneg = ETH_LINK_FIXED,
>  };
> 
> -RTE_LOG_REGISTER(af_packet_logtype, pmd.net.packet, NOTICE);
> +RTE_LOG_REGISTER(af_packet_logtype, pmd.net.af_packet, NOTICE);
> 
>  #define PMD_LOG(level, fmt, args...) \
>  	rte_log(RTE_LOG_ ## level, af_packet_logtype, \ diff --git
> a/drivers/net/bonding/rte_eth_bond_pmd.c
> b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 24e3cf3c2e..2e9cea5b8e 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -3775,4 +3775,4 @@
> RTE_PMD_REGISTER_PARAM_STRING(net_bonding,
>  	"up_delay=<int> "
>  	"down_delay=<int>");
> 
> -RTE_LOG_REGISTER(bond_logtype, pmd.net.bond, NOTICE);
> +RTE_LOG_REGISTER(bond_logtype, pmd.net.bonding, NOTICE);
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> b/drivers/raw/ifpga/ifpga_rawdev.c
> index 05d79bfcc2..d9a46ef915 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -1611,7 +1611,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_LOG_REGISTER(ifpga_rawdev_logtype,
> driver.raw.init, NOTICE);
> +RTE_LOG_REGISTER(ifpga_rawdev_logtype, pmd.raw.ifpga, 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 a95854d5ac..15af07017c 100644
> --- a/drivers/raw/ioat/ioat_rawdev.c
> +++ b/drivers/raw/ioat/ioat_rawdev.c
> @@ -28,7 +28,7 @@ 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);
> +RTE_LOG_REGISTER(ioat_pmd_logtype, pmd.raw.ioat, INFO);
> 
>  #define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc)  #define
> COMPLETION_SZ sizeof(__m128i) diff --git
> a/drivers/raw/skeleton/skeleton_rawdev.c
> b/drivers/raw/skeleton/skeleton_rawdev.c
> index aa3beaad18..8896f0c9c5 100644
> --- a/drivers/raw/skeleton/skeleton_rawdev.c
> +++ b/drivers/raw/skeleton/skeleton_rawdev.c
> @@ -768,4 +768,4 @@ static struct rte_vdev_driver skeleton_pmd_drv = {  };
> 
>  RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME,
> skeleton_pmd_drv); -RTE_LOG_REGISTER(skeleton_pmd_logtype,
> rawdev.skeleton, INFO);
> +RTE_LOG_REGISTER(skeleton_pmd_logtype, pmd.raw.skeleton, INFO);
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 39237aecf7..7a06f97429 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -26,7 +26,7 @@
> 
>  #include "base/ifcvf.h"
> 
> -RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
> +RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
>  #define DRV_LOG(level, fmt, args...) \
>  	rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
>  		"IFCVF %s(): " fmt "\n", __func__, ##args)
> --
> 2.31.1

Acked-by: Rosen Xu <rosen.xu@intel.com>

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

* Re: [dpdk-dev] [PATCH v2 3/3] drivers: align log names
  2021-04-05 10:03   ` [dpdk-dev] [PATCH v2 3/3] drivers: align log names Thomas Monjalon
  2021-04-06  1:19     ` Wang, Xiao W
  2021-04-06  5:27     ` Xu, Rosen
@ 2021-04-06  6:02     ` Min Hu (Connor)
  2 siblings, 0 replies; 37+ messages in thread
From: Min Hu (Connor) @ 2021-04-06  6:02 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: Bruce Richardson, Rosen Xu, Xiao Wang, Hemant Agrawal,
	Ajit Khaparde, John Griffin, Fiona Trahe, Deepak Kumar Jain,
	Raveendra Padasalagi, Vikas Gupta, John W. Linville,
	Chas Williams, Tianfei zhang, Nipun Gupta

Acked-by: Min Hu (Connor) <humin29@huawei.com>

在 2021/4/5 18:03, Thomas Monjalon 写道:
> The log levels are configured by using the name of the logs.
> Some drivers are aligned to follow a common log name standard:
> 	pmd.class.driver[.sub]
> Some "common" drivers skip the "class" part:
> 	pmd.driver.sub
> 
> Two drivers have exceptions to be clarified:
> 	pmd.vdpa.ifcvf instead of pmd.vdpa.ifc
> 	pmd.afu.ipn3ke instead of pmd.net.ipn3ke
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Rosen Xu <rosen.xu@intel.com>
> Acked-by: Xiao Wang <xiao.w.wang@intel.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>   doc/guides/cryptodevs/qat.rst             | 10 +++++-----
>   drivers/common/qat/qat_logs.c             |  4 ++--
>   drivers/crypto/bcmfs/bcmfs_logs.c         |  4 ++--
>   drivers/net/af_packet/rte_eth_af_packet.c |  2 +-
>   drivers/net/bonding/rte_eth_bond_pmd.c    |  2 +-
>   drivers/raw/ifpga/ifpga_rawdev.c          |  2 +-
>   drivers/raw/ioat/ioat_rawdev.c            |  2 +-
>   drivers/raw/skeleton/skeleton_rawdev.c    |  2 +-
>   drivers/vdpa/ifc/ifcvf_vdpa.c             |  2 +-
>   9 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
> index cf16f03503..224b22b3f7 100644
> --- a/doc/guides/cryptodevs/qat.rst
> +++ b/doc/guides/cryptodevs/qat.rst
> @@ -659,15 +659,15 @@ 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.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.general,8"
> +    --log-level="pmd.qat.dp,8"
>       --log-level="pmd.qat,8"
>   
>   .. Note::
> @@ -678,4 +678,4 @@ the process cmdline, e.g. using any of the following::
>       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"
> +	--log-level="7" --log-level="pmd.qat.general,8"
> diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
> index fa48be53c3..adbe163cd9 100644
> --- a/drivers/common/qat/qat_logs.c
> +++ b/drivers/common/qat/qat_logs.c
> @@ -17,5 +17,5 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
>   	return 0;
>   }
>   
> -RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat_general, NOTICE);
> -RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat_dp, NOTICE);
> +RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat.general, NOTICE);
> +RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat.dp, NOTICE);
> diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c b/drivers/crypto/bcmfs/bcmfs_logs.c
> index 701da9ecf3..9faf12f238 100644
> --- a/drivers/crypto/bcmfs/bcmfs_logs.c
> +++ b/drivers/crypto/bcmfs/bcmfs_logs.c
> @@ -21,5 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
>   	return 0;
>   }
>   
> -RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
> -RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
> +RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.crypto.bcmfs.config, NOTICE)
> +RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.crypto.bcmfs.fp, NOTICE)
> diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
> index bfe5a0a451..a04f7c773a 100644
> --- a/drivers/net/af_packet/rte_eth_af_packet.c
> +++ b/drivers/net/af_packet/rte_eth_af_packet.c
> @@ -97,7 +97,7 @@ static struct rte_eth_link pmd_link = {
>   	.link_autoneg = ETH_LINK_FIXED,
>   };
>   
> -RTE_LOG_REGISTER(af_packet_logtype, pmd.net.packet, NOTICE);
> +RTE_LOG_REGISTER(af_packet_logtype, pmd.net.af_packet, NOTICE);
>   
>   #define PMD_LOG(level, fmt, args...) \
>   	rte_log(RTE_LOG_ ## level, af_packet_logtype, \
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 24e3cf3c2e..2e9cea5b8e 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -3775,4 +3775,4 @@ RTE_PMD_REGISTER_PARAM_STRING(net_bonding,
>   	"up_delay=<int> "
>   	"down_delay=<int>");
>   
> -RTE_LOG_REGISTER(bond_logtype, pmd.net.bond, NOTICE);
> +RTE_LOG_REGISTER(bond_logtype, pmd.net.bonding, NOTICE);
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
> index 05d79bfcc2..d9a46ef915 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -1611,7 +1611,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_LOG_REGISTER(ifpga_rawdev_logtype, driver.raw.init, NOTICE);
> +RTE_LOG_REGISTER(ifpga_rawdev_logtype, pmd.raw.ifpga, 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 a95854d5ac..15af07017c 100644
> --- a/drivers/raw/ioat/ioat_rawdev.c
> +++ b/drivers/raw/ioat/ioat_rawdev.c
> @@ -28,7 +28,7 @@ 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);
> +RTE_LOG_REGISTER(ioat_pmd_logtype, pmd.raw.ioat, INFO);
>   
>   #define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc)
>   #define COMPLETION_SZ sizeof(__m128i)
> diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
> index aa3beaad18..8896f0c9c5 100644
> --- a/drivers/raw/skeleton/skeleton_rawdev.c
> +++ b/drivers/raw/skeleton/skeleton_rawdev.c
> @@ -768,4 +768,4 @@ static struct rte_vdev_driver skeleton_pmd_drv = {
>   };
>   
>   RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME, skeleton_pmd_drv);
> -RTE_LOG_REGISTER(skeleton_pmd_logtype, rawdev.skeleton, INFO);
> +RTE_LOG_REGISTER(skeleton_pmd_logtype, pmd.raw.skeleton, INFO);
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 39237aecf7..7a06f97429 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -26,7 +26,7 @@
>   
>   #include "base/ifcvf.h"
>   
> -RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
> +RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
>   #define DRV_LOG(level, fmt, args...) \
>   	rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
>   		"IFCVF %s(): " fmt "\n", __func__, ##args)
> 

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

* Re: [dpdk-dev] [PATCH v2 1/3] log: choose EAL log type on registration failure
  2021-04-05 10:02   ` [dpdk-dev] [PATCH v2 1/3] log: choose EAL log type on registration failure Thomas Monjalon
@ 2021-04-06  9:17     ` David Marchand
  2021-04-06  9:49       ` Thomas Monjalon
  0 siblings, 1 reply; 37+ messages in thread
From: David Marchand @ 2021-04-06  9:17 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Mon, Apr 5, 2021 at 12:03 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> In the unlikely case where something goes wrong
> while registering a log type,
> the fallback is to use the log type 0, assigned to EAL.

How about simply:
the fallback is to use the EAL log type.

>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH v2 3/3] drivers: align log names
  2021-04-06  5:27     ` Xu, Rosen
@ 2021-04-06  9:31       ` Thomas Monjalon
  2021-04-06  9:48         ` Xu, Rosen
  0 siblings, 1 reply; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-06  9:31 UTC (permalink / raw)
  To: Xu, Rosen, Wang, Xiao W
  Cc: dev, Richardson, Bruce, Hemant Agrawal, Ajit Khaparde, Griffin,
	John, Trahe, Fiona, Jain, Deepak K, Raveendra Padasalagi,
	Vikas Gupta, John W. Linville, Chas Williams, Min Hu (Connor),
	Zhang, Tianfei, Nipun Gupta, david.marchand

Hi Rosen,

You already gave your ack in previous version, no need to re-ack.
Instead, please give your opinion and explanation as requested below.
We want to replace pmd.afu.ipn3ke with pmd.net.ipn3ke.
The use of AFU in the driver is not clear.

Xiao, we need your opinion as well about ifcvf vs ifc name.


> > The log levels are configured by using the name of the logs.
> > Some drivers are aligned to follow a common log name standard:
> > 	pmd.class.driver[.sub]
> > Some "common" drivers skip the "class" part:
> > 	pmd.driver.sub
> > 
> > Two drivers have exceptions to be clarified:
> > 	pmd.vdpa.ifcvf instead of pmd.vdpa.ifc
> > 	pmd.afu.ipn3ke instead of pmd.net.ipn3ke
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > Acked-by: Rosen Xu <rosen.xu@intel.com>
> > Acked-by: Xiao Wang <xiao.w.wang@intel.com>
> > Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> > Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
[...]
> Acked-by: Rosen Xu <rosen.xu@intel.com>




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

* Re: [dpdk-dev] [PATCH v2 3/3] drivers: align log names
  2021-04-06  9:31       ` Thomas Monjalon
@ 2021-04-06  9:48         ` Xu, Rosen
  2021-04-07  0:49           ` Wang, Xiao W
  0 siblings, 1 reply; 37+ messages in thread
From: Xu, Rosen @ 2021-04-06  9:48 UTC (permalink / raw)
  To: Thomas Monjalon, Wang, Xiao W
  Cc: dev, Richardson, Bruce, Hemant Agrawal, Ajit Khaparde, Griffin,
	John, Trahe, Fiona, Jain, Deepak K, Raveendra Padasalagi,
	Vikas Gupta, John W. Linville, Chas Williams, Min Hu (Connor),
	Zhang, Tianfei, Nipun Gupta, david.marchand

HI Thomas,

I'm ok, if you replace pmd.afu.ipn3ke with pmd.net.ipn3ke. Thanks your reminder.

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, April 06, 2021 17:31
> To: Xu, Rosen <rosen.xu@intel.com>; Wang, Xiao W
> <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Ajit Khaparde
> <ajit.khaparde@broadcom.com>; Griffin, John <john.griffin@intel.com>;
> Trahe, Fiona <fiona.trahe@intel.com>; Jain, Deepak K
> <deepak.k.jain@intel.com>; Raveendra Padasalagi
> <raveendra.padasalagi@broadcom.com>; Vikas Gupta
> <vikas.gupta@broadcom.com>; John W. Linville <linville@tuxdriver.com>;
> Chas Williams <chas3@att.com>; Min Hu (Connor) <humin29@huawei.com>;
> Zhang, Tianfei <tianfei.zhang@intel.com>; Nipun Gupta
> <nipun.gupta@nxp.com>; david.marchand@redhat.com
> Subject: Re: [PATCH v2 3/3] drivers: align log names
> 
> Hi Rosen,
> 
> You already gave your ack in previous version, no need to re-ack.
> Instead, please give your opinion and explanation as requested below.
> We want to replace pmd.afu.ipn3ke with pmd.net.ipn3ke.
> The use of AFU in the driver is not clear.
> 
> Xiao, we need your opinion as well about ifcvf vs ifc name.
> 
> 
> > > The log levels are configured by using the name of the logs.
> > > Some drivers are aligned to follow a common log name standard:
> > > 	pmd.class.driver[.sub]
> > > Some "common" drivers skip the "class" part:
> > > 	pmd.driver.sub
> > >
> > > Two drivers have exceptions to be clarified:
> > > 	pmd.vdpa.ifcvf instead of pmd.vdpa.ifc
> > > 	pmd.afu.ipn3ke instead of pmd.net.ipn3ke
> > >
> > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > Acked-by: Rosen Xu <rosen.xu@intel.com>
> > > Acked-by: Xiao Wang <xiao.w.wang@intel.com>
> > > Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> > > Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> [...]
> > Acked-by: Rosen Xu <rosen.xu@intel.com>
> 
> 


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

* Re: [dpdk-dev] [PATCH v2 1/3] log: choose EAL log type on registration failure
  2021-04-06  9:17     ` David Marchand
@ 2021-04-06  9:49       ` Thomas Monjalon
  0 siblings, 0 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-06  9:49 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

06/04/2021 11:17, David Marchand:
> On Mon, Apr 5, 2021 at 12:03 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > In the unlikely case where something goes wrong
> > while registering a log type,
> > the fallback is to use the log type 0, assigned to EAL.
> 
> How about simply:
> the fallback is to use the EAL log type.

OK, no need to mention 0.

> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> 
> 
> 






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

* [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration
  2021-03-10 14:01 [dpdk-dev] [PATCH 0/3] cleanup drivers log registration Thomas Monjalon
                   ` (3 preceding siblings ...)
  2021-04-05 10:02 ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
@ 2021-04-06 13:22 ` Thomas Monjalon
  2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 1/3] log: choose EAL log type on registration failure Thomas Monjalon
                     ` (3 more replies)
  4 siblings, 4 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-06 13:22 UTC (permalink / raw)
  To: dev; +Cc: david.marchand

After working on the option "--log-level help",
it became clear that few adjustments were required
for the log registration of some drivers.

v3:
   - rename pmd.afu.ipn3ke log type to pmd.net.ipn3ke
v2:
   - align bonding and af_packet
   - make explicit the RTE_LOGTYPE_EAL default

Thomas Monjalon (3):
  log: choose EAL log type on registration failure
  drivers: fix log level after loading
  drivers: align log names

 doc/guides/cryptodevs/qat.rst             | 10 ++---
 drivers/common/mlx5/mlx5_common.c         |  9 +----
 drivers/common/qat/qat_logs.c             |  4 +-
 drivers/crypto/bcmfs/bcmfs_logs.c         | 17 +-------
 drivers/net/af_packet/rte_eth_af_packet.c |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c    |  2 +-
 drivers/net/e1000/e1000_logs.c            | 49 +++--------------------
 drivers/net/e1000/em_ethdev.c             |  6 ---
 drivers/net/e1000/igb_ethdev.c            |  6 ---
 drivers/net/ipn3ke/ipn3ke_ethdev.c        |  2 +-
 drivers/raw/ifpga/ifpga_rawdev.c          |  2 +-
 drivers/raw/ioat/ioat_rawdev.c            |  2 +-
 drivers/raw/skeleton/skeleton_rawdev.c    |  2 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c             |  2 +-
 lib/librte_eal/include/rte_log.h          |  2 +
 15 files changed, 24 insertions(+), 93 deletions(-)

-- 
2.31.1


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

* [dpdk-dev] [PATCH v3 1/3] log: choose EAL log type on registration failure
  2021-04-06 13:22 ` [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration Thomas Monjalon
@ 2021-04-06 13:22   ` Thomas Monjalon
  2021-04-07  8:17     ` Andrew Rybchenko
  2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 2/3] drivers: fix log level after loading Thomas Monjalon
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-06 13:22 UTC (permalink / raw)
  To: dev; +Cc: david.marchand

In the unlikely case where something goes wrong
while registering a log type,
the fallback is to use the EAL log type.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/include/rte_log.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h
index 173004fd71..21a7d16340 100644
--- a/lib/librte_eal/include/rte_log.h
+++ b/lib/librte_eal/include/rte_log.h
@@ -380,6 +380,8 @@ RTE_INIT(__##type)							\
 {									\
 	type = rte_log_register_type_and_pick_level(RTE_STR(name),	\
 						    RTE_LOG_##level);	\
+	if (type < 0)                                                   \
+		type = RTE_LOGTYPE_EAL;                                 \
 }
 
 #ifdef __cplusplus
-- 
2.31.1


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

* [dpdk-dev] [PATCH v3 2/3] drivers: fix log level after loading
  2021-04-06 13:22 ` [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration Thomas Monjalon
  2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 1/3] log: choose EAL log type on registration failure Thomas Monjalon
@ 2021-04-06 13:22   ` Thomas Monjalon
  2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 3/3] drivers: align log names Thomas Monjalon
  2021-04-08 16:43   ` [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration David Marchand
  3 siblings, 0 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-06 13:22 UTC (permalink / raw)
  To: dev
  Cc: david.marchand, stable, Ajit Khaparde, Matan Azrad,
	Shahaf Shuler, Viacheslav Ovsiienko, Raveendra Padasalagi,
	Vikas Gupta, Jeff Guo, Haiyue Wang, Akhil Goyal, Sachin Saxena,
	Adam Dybkowski, Jerin Jacob

When compiled as a shared object, and loaded at runtime as a plugin,
the drivers should get the log level set earlier at EAL init
by the user through --log-level option.

The function for applying the log level setting is
rte_log_register_type_and_pick_level().
It is called by most drivers via RTE_LOG_REGISTER().

The drivers common/mlx5, bcmfs and e1000 were missing,
so the user-specified log level was not applied when
those drivers were loaded as plugins.
The macro RTE_LOG_REGISTER() is used for those drivers.

The unnecessary protection for double registration
is removed from e1000.

Fixes: 9c99878aa1b1 ("log: introduce logtype register macro")
Fixes: c8e79da7c676 ("crypto/bcmfs: introduce BCMFS driver")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/common/mlx5/mlx5_common.c |  9 +-----
 drivers/crypto/bcmfs/bcmfs_logs.c | 17 ++---------
 drivers/net/e1000/e1000_logs.c    | 49 ++++---------------------------
 drivers/net/e1000/em_ethdev.c     |  6 ----
 drivers/net/e1000/igb_ethdev.c    |  6 ----
 5 files changed, 8 insertions(+), 79 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
index c26a2cfa30..f92f05bda5 100644
--- a/drivers/common/mlx5/mlx5_common.c
+++ b/drivers/common/mlx5/mlx5_common.c
@@ -14,8 +14,6 @@
 #include "mlx5_common_utils.h"
 #include "mlx5_common_pci.h"
 
-int mlx5_common_logtype;
-
 uint8_t haswell_broadwell_cpu;
 
 /* In case this is an x86_64 intel processor to check if
@@ -41,12 +39,7 @@ static inline void mlx5_cpu_id(unsigned int level,
 }
 #endif
 
-RTE_INIT_PRIO(mlx5_log_init, LOG)
-{
-	mlx5_common_logtype = rte_log_register("pmd.common.mlx5");
-	if (mlx5_common_logtype >= 0)
-		rte_log_set_level(mlx5_common_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(mlx5_common_logtype, pmd.common.mlx5, NOTICE)
 
 static bool mlx5_common_initialized;
 
diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c b/drivers/crypto/bcmfs/bcmfs_logs.c
index 86f4ff3b53..701da9ecf3 100644
--- a/drivers/crypto/bcmfs/bcmfs_logs.c
+++ b/drivers/crypto/bcmfs/bcmfs_logs.c
@@ -8,9 +8,6 @@
 
 #include "bcmfs_logs.h"
 
-int bcmfs_conf_logtype;
-int bcmfs_dp_logtype;
-
 int
 bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 		const void *buf, unsigned int len)
@@ -24,15 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 	return 0;
 }
 
-RTE_INIT(bcmfs_device_init_log)
-{
-	/* Configuration and general logs */
-	bcmfs_conf_logtype = rte_log_register("pmd.bcmfs_config");
-	if (bcmfs_conf_logtype >= 0)
-		rte_log_set_level(bcmfs_conf_logtype, RTE_LOG_NOTICE);
-
-	/* data-path logs */
-	bcmfs_dp_logtype = rte_log_register("pmd.bcmfs_fp");
-	if (bcmfs_dp_logtype >= 0)
-		rte_log_set_level(bcmfs_dp_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
+RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 231f5c03ef..d9b8a4672f 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -4,53 +4,14 @@
 
 #include "e1000_logs.h"
 
-/* declared as extern in e1000_logs.h */
-int e1000_logtype_init;
-int e1000_logtype_driver;
-
+RTE_LOG_REGISTER(e1000_logtype_init, pmd.net.e1000.init, NOTICE)
+RTE_LOG_REGISTER(e1000_logtype_driver, pmd.net.e1000.driver, NOTICE)
 #ifdef RTE_LIBRTE_E1000_DEBUG_RX
-int e1000_logtype_rx;
+RTE_LOG_REGISTER(e1000_logtype_rx, pmd.net.e1000.rx, DEBUG)
 #endif
 #ifdef RTE_LIBRTE_E1000_DEBUG_TX
-int e1000_logtype_tx;
+RTE_LOG_REGISTER(e1000_logtype_tx, pmd.net.e1000.tx, DEBUG)
 #endif
 #ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-int e1000_logtype_tx_free;
+RTE_LOG_REGISTER(e1000_logtype_tx_free, pmd.net.e1000.tx_free, DEBUG)
 #endif
-
-/* 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)
-		return;
-
-	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);
-
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
-	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
-	if (e1000_logtype_rx >= 0)
-		rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
-#endif
-
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
-	e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
-	if (e1000_logtype_tx >= 0)
-		rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
-#endif
-
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-	e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
-	if (e1000_logtype_tx_free >= 0)
-		rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
-#endif
-
-	e1000_log_initialized = 1;
-}
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 3c6f643c19..3e7ccdbf09 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1850,9 +1850,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 17ee6e91a0..a1a72339ba 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -5421,9 +5421,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();
-}
-- 
2.31.1


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

* [dpdk-dev] [PATCH v3 3/3] drivers: align log names
  2021-04-06 13:22 ` [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration Thomas Monjalon
  2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 1/3] log: choose EAL log type on registration failure Thomas Monjalon
  2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 2/3] drivers: fix log level after loading Thomas Monjalon
@ 2021-04-06 13:22   ` Thomas Monjalon
  2021-04-08 16:43   ` [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration David Marchand
  3 siblings, 0 replies; 37+ messages in thread
From: Thomas Monjalon @ 2021-04-06 13:22 UTC (permalink / raw)
  To: dev
  Cc: david.marchand, Bruce Richardson, Rosen Xu, Xiao Wang,
	Hemant Agrawal, Ajit Khaparde, Min Hu, John Griffin, Fiona Trahe,
	Deepak Kumar Jain, Raveendra Padasalagi, Vikas Gupta,
	John W. Linville, Chas Williams, Tianfei zhang, Nipun Gupta

The log levels are configured by using the name of the logs.
Some drivers are aligned to follow a common log name standard:
	pmd.class.driver[.sub]
Some "common" drivers skip the "class" part:
	pmd.driver.sub

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
---
 doc/guides/cryptodevs/qat.rst             | 10 +++++-----
 drivers/common/qat/qat_logs.c             |  4 ++--
 drivers/crypto/bcmfs/bcmfs_logs.c         |  4 ++--
 drivers/net/af_packet/rte_eth_af_packet.c |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c    |  2 +-
 drivers/net/ipn3ke/ipn3ke_ethdev.c        |  2 +-
 drivers/raw/ifpga/ifpga_rawdev.c          |  2 +-
 drivers/raw/ioat/ioat_rawdev.c            |  2 +-
 drivers/raw/skeleton/skeleton_rawdev.c    |  2 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c             |  2 +-
 10 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
index cf16f03503..224b22b3f7 100644
--- a/doc/guides/cryptodevs/qat.rst
+++ b/doc/guides/cryptodevs/qat.rst
@@ -659,15 +659,15 @@ 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.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.general,8"
+    --log-level="pmd.qat.dp,8"
     --log-level="pmd.qat,8"
 
 .. Note::
@@ -678,4 +678,4 @@ the process cmdline, e.g. using any of the following::
     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"
+	--log-level="7" --log-level="pmd.qat.general,8"
diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
index fa48be53c3..adbe163cd9 100644
--- a/drivers/common/qat/qat_logs.c
+++ b/drivers/common/qat/qat_logs.c
@@ -17,5 +17,5 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 	return 0;
 }
 
-RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat_general, NOTICE);
-RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat_dp, NOTICE);
+RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat.general, NOTICE);
+RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat.dp, NOTICE);
diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c b/drivers/crypto/bcmfs/bcmfs_logs.c
index 701da9ecf3..9faf12f238 100644
--- a/drivers/crypto/bcmfs/bcmfs_logs.c
+++ b/drivers/crypto/bcmfs/bcmfs_logs.c
@@ -21,5 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
 	return 0;
 }
 
-RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
-RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
+RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.crypto.bcmfs.config, NOTICE)
+RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.crypto.bcmfs.fp, NOTICE)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index bfe5a0a451..a04f7c773a 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -97,7 +97,7 @@ static struct rte_eth_link pmd_link = {
 	.link_autoneg = ETH_LINK_FIXED,
 };
 
-RTE_LOG_REGISTER(af_packet_logtype, pmd.net.packet, NOTICE);
+RTE_LOG_REGISTER(af_packet_logtype, pmd.net.af_packet, NOTICE);
 
 #define PMD_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, af_packet_logtype, \
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 24e3cf3c2e..2e9cea5b8e 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3775,4 +3775,4 @@ RTE_PMD_REGISTER_PARAM_STRING(net_bonding,
 	"up_delay=<int> "
 	"down_delay=<int>");
 
-RTE_LOG_REGISTER(bond_logtype, pmd.net.bond, NOTICE);
+RTE_LOG_REGISTER(bond_logtype, pmd.net.bonding, NOTICE);
diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c b/drivers/net/ipn3ke/ipn3ke_ethdev.c
index f8e751cb09..e83bd92bac 100644
--- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
+++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
@@ -583,4 +583,4 @@ static struct rte_afu_driver afu_ipn3ke_driver = {
 };
 
 RTE_PMD_REGISTER_AFU(net_ipn3ke_afu, afu_ipn3ke_driver);
-RTE_LOG_REGISTER(ipn3ke_afu_logtype, pmd.afu.ipn3ke, NOTICE);
+RTE_LOG_REGISTER(ipn3ke_afu_logtype, pmd.net.ipn3ke, NOTICE);
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index 05d79bfcc2..d9a46ef915 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -1611,7 +1611,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_LOG_REGISTER(ifpga_rawdev_logtype, driver.raw.init, NOTICE);
+RTE_LOG_REGISTER(ifpga_rawdev_logtype, pmd.raw.ifpga, 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 a95854d5ac..15af07017c 100644
--- a/drivers/raw/ioat/ioat_rawdev.c
+++ b/drivers/raw/ioat/ioat_rawdev.c
@@ -28,7 +28,7 @@ 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);
+RTE_LOG_REGISTER(ioat_pmd_logtype, pmd.raw.ioat, INFO);
 
 #define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc)
 #define COMPLETION_SZ sizeof(__m128i)
diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index aa3beaad18..8896f0c9c5 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -768,4 +768,4 @@ static struct rte_vdev_driver skeleton_pmd_drv = {
 };
 
 RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME, skeleton_pmd_drv);
-RTE_LOG_REGISTER(skeleton_pmd_logtype, rawdev.skeleton, INFO);
+RTE_LOG_REGISTER(skeleton_pmd_logtype, pmd.raw.skeleton, INFO);
diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 39237aecf7..7a06f97429 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -26,7 +26,7 @@
 
 #include "base/ifcvf.h"
 
-RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE);
+RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
 #define DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
 		"IFCVF %s(): " fmt "\n", __func__, ##args)
-- 
2.31.1


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

* Re: [dpdk-dev] [PATCH v2 3/3] drivers: align log names
  2021-04-06  9:48         ` Xu, Rosen
@ 2021-04-07  0:49           ` Wang, Xiao W
  0 siblings, 0 replies; 37+ messages in thread
From: Wang, Xiao W @ 2021-04-07  0:49 UTC (permalink / raw)
  To: Xu, Rosen, Thomas Monjalon
  Cc: dev, Richardson, Bruce, Hemant Agrawal, Ajit Khaparde, Griffin,
	John, Trahe, Fiona, Jain, Deepak K, Raveendra Padasalagi,
	Vikas Gupta, John W. Linville, Chas Williams, Min Hu (Connor),
	Zhang, Tianfei, Nipun Gupta, david.marchand

Hi Thomas,

I agree with the "ifcvf" name, as there might be more than one driver in a single driver dir.

Thanks,
Xiao

> -----Original Message-----
> From: Xu, Rosen <rosen.xu@intel.com>
> Sent: Tuesday, April 6, 2021 5:48 PM
> To: Thomas Monjalon <thomas@monjalon.net>; Wang, Xiao W
> <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Ajit Khaparde
> <ajit.khaparde@broadcom.com>; Griffin, John <john.griffin@intel.com>;
> Trahe, Fiona <fiona.trahe@intel.com>; Jain, Deepak K
> <deepak.k.jain@intel.com>; Raveendra Padasalagi
> <raveendra.padasalagi@broadcom.com>; Vikas Gupta
> <vikas.gupta@broadcom.com>; John W. Linville <linville@tuxdriver.com>;
> Chas Williams <chas3@att.com>; Min Hu (Connor)
> <humin29@huawei.com>; Zhang, Tianfei <tianfei.zhang@intel.com>; Nipun
> Gupta <nipun.gupta@nxp.com>; david.marchand@redhat.com
> Subject: RE: [PATCH v2 3/3] drivers: align log names
> 
> HI Thomas,
> 
> I'm ok, if you replace pmd.afu.ipn3ke with pmd.net.ipn3ke. Thanks your
> reminder.
> 
> > -----Original Message-----
> > From: Thomas Monjalon <thomas@monjalon.net>
> > Sent: Tuesday, April 06, 2021 17:31
> > To: Xu, Rosen <rosen.xu@intel.com>; Wang, Xiao W
> > <xiao.w.wang@intel.com>
> > Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>;
> > Hemant Agrawal <hemant.agrawal@nxp.com>; Ajit Khaparde
> > <ajit.khaparde@broadcom.com>; Griffin, John <john.griffin@intel.com>;
> > Trahe, Fiona <fiona.trahe@intel.com>; Jain, Deepak K
> > <deepak.k.jain@intel.com>; Raveendra Padasalagi
> > <raveendra.padasalagi@broadcom.com>; Vikas Gupta
> > <vikas.gupta@broadcom.com>; John W. Linville <linville@tuxdriver.com>;
> > Chas Williams <chas3@att.com>; Min Hu (Connor)
> <humin29@huawei.com>;
> > Zhang, Tianfei <tianfei.zhang@intel.com>; Nipun Gupta
> > <nipun.gupta@nxp.com>; david.marchand@redhat.com
> > Subject: Re: [PATCH v2 3/3] drivers: align log names
> >
> > Hi Rosen,
> >
> > You already gave your ack in previous version, no need to re-ack.
> > Instead, please give your opinion and explanation as requested below.
> > We want to replace pmd.afu.ipn3ke with pmd.net.ipn3ke.
> > The use of AFU in the driver is not clear.
> >
> > Xiao, we need your opinion as well about ifcvf vs ifc name.
> >
> >
> > > > The log levels are configured by using the name of the logs.
> > > > Some drivers are aligned to follow a common log name standard:
> > > > 	pmd.class.driver[.sub]
> > > > Some "common" drivers skip the "class" part:
> > > > 	pmd.driver.sub
> > > >
> > > > Two drivers have exceptions to be clarified:
> > > > 	pmd.vdpa.ifcvf instead of pmd.vdpa.ifc
> > > > 	pmd.afu.ipn3ke instead of pmd.net.ipn3ke
> > > >
> > > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > Acked-by: Rosen Xu <rosen.xu@intel.com>
> > > > Acked-by: Xiao Wang <xiao.w.wang@intel.com>
> > > > Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> > > > Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> > [...]
> > > Acked-by: Rosen Xu <rosen.xu@intel.com>
> >
> >


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

* Re: [dpdk-dev] [PATCH v3 1/3] log: choose EAL log type on registration failure
  2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 1/3] log: choose EAL log type on registration failure Thomas Monjalon
@ 2021-04-07  8:17     ` Andrew Rybchenko
  0 siblings, 0 replies; 37+ messages in thread
From: Andrew Rybchenko @ 2021-04-07  8:17 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: david.marchand

On 4/6/21 4:22 PM, Thomas Monjalon wrote:
> In the unlikely case where something goes wrong
> while registering a log type,
> the fallback is to use the EAL log type.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

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

* Re: [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration
  2021-04-06 13:22 ` [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration Thomas Monjalon
                     ` (2 preceding siblings ...)
  2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 3/3] drivers: align log names Thomas Monjalon
@ 2021-04-08 16:43   ` David Marchand
  3 siblings, 0 replies; 37+ messages in thread
From: David Marchand @ 2021-04-08 16:43 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Tue, Apr 6, 2021 at 3:22 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> After working on the option "--log-level help",
> it became clear that few adjustments were required
> for the log registration of some drivers.
>
> v3:
>    - rename pmd.afu.ipn3ke log type to pmd.net.ipn3ke
> v2:
>    - align bonding and af_packet
>    - make explicit the RTE_LOGTYPE_EAL default

Series applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2021-04-08 16:43 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 14:01 [dpdk-dev] [PATCH 0/3] cleanup drivers log registration Thomas Monjalon
2021-03-10 14:01 ` [dpdk-dev] [PATCH 1/3] log: choose EAL log type on registration failure Thomas Monjalon
2021-03-23 18:22   ` David Marchand
2021-03-23 18:43     ` Thomas Monjalon
2021-03-10 14:01 ` [dpdk-dev] [PATCH 2/3] drivers: fix log level after loading Thomas Monjalon
2021-03-23 18:25   ` [dpdk-dev] [dpdk-stable] " David Marchand
2021-03-23 18:50   ` [dpdk-dev] " Ajit Khaparde
2021-03-10 14:01 ` [dpdk-dev] [PATCH 3/3] drivers: align log names Thomas Monjalon
2021-03-10 14:36   ` Bruce Richardson
2021-03-11  2:54   ` Xu, Rosen
2021-03-11  3:02   ` Wang, Xiao W
2021-03-12  7:39   ` Hemant Agrawal
2021-03-19 16:29   ` David Marchand
2021-03-19 17:14     ` Thomas Monjalon
2021-03-19 20:38       ` David Marchand
2021-03-19 16:53   ` Ajit Khaparde
2021-03-22 10:33   ` David Marchand
2021-04-05  9:52     ` Thomas Monjalon
2021-04-05 10:02 ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
2021-04-05 10:02   ` [dpdk-dev] [PATCH v2 1/3] log: choose EAL log type on registration failure Thomas Monjalon
2021-04-06  9:17     ` David Marchand
2021-04-06  9:49       ` Thomas Monjalon
2021-04-05 10:03   ` [dpdk-dev] [PATCH v2 2/3] drivers: fix log level after loading Thomas Monjalon
2021-04-05 10:03   ` [dpdk-dev] [PATCH v2 3/3] drivers: align log names Thomas Monjalon
2021-04-06  1:19     ` Wang, Xiao W
2021-04-06  5:27     ` Xu, Rosen
2021-04-06  9:31       ` Thomas Monjalon
2021-04-06  9:48         ` Xu, Rosen
2021-04-07  0:49           ` Wang, Xiao W
2021-04-06  6:02     ` Min Hu (Connor)
2021-04-05 10:05   ` [dpdk-dev] [PATCH v2 0/3] " Thomas Monjalon
2021-04-06 13:22 ` [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration Thomas Monjalon
2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 1/3] log: choose EAL log type on registration failure Thomas Monjalon
2021-04-07  8:17     ` Andrew Rybchenko
2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 2/3] drivers: fix log level after loading Thomas Monjalon
2021-04-06 13:22   ` [dpdk-dev] [PATCH v3 3/3] drivers: align log names Thomas Monjalon
2021-04-08 16:43   ` [dpdk-dev] [PATCH v3 0/3] cleanup drivers log registration David Marchand

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