* [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers
@ 2019-08-19 11:41 David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 01/11] log: fix plugin level restore with patterns David Marchand
` (11 more replies)
0 siblings, 12 replies; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev
All (but the Solarflare net driver) drivers currently do not care about
the log level the user might have passed at init time.
Convert existing drivers from rte_log_register to a new wrapper
RTE_LOG_REGISTER that relies on rte_log_register_type_and_pick_level
that handles this issue.
--
David Marchand
David Marchand (11):
log: fix plugin level restore with patterns
log: define logtype register wrapper for drivers
drivers/baseband: use new logtype wrapper
drivers/bus: use new logtype wrapper
drivers/common: use new logtype wrapper
drivers/compress: use new logtype wrapper
drivers/crypto: use new logtype wrapper
drivers/event: use new logtype wrapper
drivers/mempool: use new logtype wrapper
drivers/net: use new logtype wrapper
drivers/raw: use new logtype wrapper
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 11 ++--
drivers/baseband/null/bbdev_null.c | 8 +--
drivers/baseband/turbo_sw/bbdev_turbo_software.c | 8 +--
drivers/bus/dpaa/dpaa_bus.c | 26 +++------
drivers/bus/fslmc/fslmc_bus.c | 9 +---
drivers/bus/ifpga/ifpga_bus.c | 8 +--
drivers/bus/vdev/vdev.c | 8 +--
drivers/bus/vmbus/vmbus_common.c | 8 +--
drivers/common/dpaax/dpaax_iova_table.c | 8 +--
drivers/common/octeontx/octeontx_mbox.c | 8 +--
drivers/common/octeontx2/otx2_common.c | 62 ++++++++--------------
drivers/common/qat/qat_logs.c | 18 +++----
drivers/compress/isal/isal_compress_pmd.c | 8 +--
drivers/compress/octeontx/otx_zip_pmd.c | 8 +--
drivers/compress/zlib/zlib_pmd.c | 8 +--
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 7 +--
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 6 +--
drivers/crypto/caam_jr/caam_jr.c | 8 +--
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 9 +---
drivers/crypto/dpaa_sec/dpaa_sec.c | 8 +--
drivers/crypto/kasumi/rte_kasumi_pmd.c | 6 +--
drivers/crypto/mvsam/rte_mrvl_pmd.c | 6 +--
drivers/crypto/null/null_crypto_pmd.c | 6 +--
drivers/crypto/octeontx/otx_cryptodev.c | 9 +---
drivers/crypto/openssl/rte_openssl_pmd.c | 6 +--
drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 6 +--
drivers/crypto/snow3g/rte_snow3g_pmd.c | 6 +--
drivers/crypto/virtio/virtio_cryptodev.c | 35 ++++--------
drivers/crypto/zuc/rte_zuc_pmd.c | 6 +--
drivers/event/dpaa2/dpaa2_eventdev.c | 8 +--
drivers/event/octeontx/ssovf_evdev.c | 8 +--
drivers/event/octeontx/timvf_evdev.c | 8 +--
drivers/event/opdl/opdl_evdev.c | 9 +---
drivers/event/sw/sw_evdev.c | 8 +--
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 8 +--
drivers/mempool/octeontx/octeontx_fpavf.c | 8 +--
drivers/net/af_packet/rte_eth_af_packet.c | 8 +--
drivers/net/af_xdp/rte_eth_af_xdp.c | 8 +--
drivers/net/atlantic/atl_ethdev.c | 13 ++---
drivers/net/avp/avp_ethdev.c | 8 +--
drivers/net/axgbe/axgbe_ethdev.c | 13 ++---
drivers/net/bnx2x/bnx2x_ethdev.c | 13 ++---
drivers/net/bnxt/bnxt_ethdev.c | 8 +--
drivers/net/bonding/rte_eth_bond_pmd.c | 8 +--
drivers/net/dpaa2/dpaa2_ethdev.c | 8 +--
drivers/net/e1000/e1000_logs.c | 21 ++------
drivers/net/e1000/e1000_logs.h | 4 --
drivers/net/e1000/em_ethdev.c | 6 ---
drivers/net/e1000/igb_ethdev.c | 6 ---
drivers/net/ena/ena_ethdev.c | 13 ++---
drivers/net/enetc/enetc_ethdev.c | 8 +--
drivers/net/enic/enic_ethdev.c | 8 +--
drivers/net/failsafe/failsafe.c | 8 +--
drivers/net/fm10k/fm10k_ethdev.c | 13 ++---
drivers/net/hinic/hinic_pmd_ethdev.c | 8 +--
drivers/net/i40e/i40e_ethdev.c | 13 ++---
drivers/net/iavf/iavf_ethdev.c | 13 ++---
drivers/net/ice/ice_ethdev.c | 13 ++---
drivers/net/ifc/ifcvf_vdpa.c | 8 +--
drivers/net/ipn3ke/ipn3ke_ethdev.c | 8 +--
drivers/net/ixgbe/ixgbe_ethdev.c | 13 ++---
drivers/net/kni/rte_eth_kni.c | 8 +--
drivers/net/liquidio/lio_ethdev.c | 13 ++---
drivers/net/memif/rte_eth_memif.c | 8 +--
drivers/net/mlx4/mlx4.c | 8 ++-
drivers/net/mlx5/mlx5.c | 8 ++-
drivers/net/mvneta/mvneta_ethdev.c | 8 +--
drivers/net/mvpp2/mrvl_ethdev.c | 8 +--
drivers/net/netvsc/hn_ethdev.c | 13 ++---
drivers/net/nfp/nfp_net.c | 13 ++---
drivers/net/null/rte_eth_null.c | 8 +--
drivers/net/octeontx/octeontx_ethdev.c | 20 +++----
drivers/net/pcap/rte_eth_pcap.c | 8 +--
drivers/net/qede/qede_ethdev.c | 13 ++---
drivers/net/ring/rte_eth_ring.c | 8 +--
drivers/net/softnic/rte_eth_softnic.c | 9 +---
drivers/net/szedata2/rte_eth_szedata2.c | 13 ++---
drivers/net/tap/rte_eth_tap.c | 8 +--
drivers/net/thunderx/nicvf_ethdev.c | 20 +++----
drivers/net/vdev_netvsc/vdev_netvsc.c | 9 +---
drivers/net/vhost/rte_eth_vhost.c | 8 +--
drivers/net/virtio/virtio_ethdev.c | 13 ++---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 13 ++---
drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 8 +--
drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 8 +--
drivers/raw/ifpga/ifpga_rawdev.c | 8 +--
drivers/raw/ioat/ioat_rawdev.c | 8 +--
drivers/raw/ntb/ntb.c | 8 +--
drivers/raw/skeleton/skeleton_rawdev.c | 8 +--
lib/librte_eal/common/eal_common_log.c | 2 +-
lib/librte_eal/common/include/rte_log.h | 12 +++--
lib/librte_eal/rte_eal_version.map | 8 ++-
92 files changed, 273 insertions(+), 671 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 01/11] log: fix plugin level restore with patterns
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-08-19 12:30 ` Andrew Rybchenko
2019-08-19 11:41 ` [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers David Marchand
` (10 subsequent siblings)
11 siblings, 1 reply; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev; +Cc: stable
Same fix as the commit 6ff0f81d0ef7 ("log: fix pattern matching"),
fnmatch returns 0 on success.
Fixes: 7f0bb634a140 ("log: add ability to match log type with globbing")
Fixes: 6ff0f81d0ef7 ("log: fix pattern matching")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
lib/librte_eal/common/eal_common_log.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index 4f6f227..d9e5808 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -284,7 +284,7 @@ rte_log_register_type_and_pick_level(const char *name, uint32_t level_def)
continue;
if (opt_ll->pattern) {
- if (fnmatch(opt_ll->pattern, name, 0))
+ if (fnmatch(opt_ll->pattern, name, 0) == 0)
level = opt_ll->level;
} else {
if (regexec(&opt_ll->re_match, name, 0, NULL, 0) == 0)
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 01/11] log: fix plugin level restore with patterns David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-08-19 12:27 ` Andrew Rybchenko
2019-09-02 14:29 ` Ferruh Yigit
2019-08-19 11:41 ` [dpdk-dev] [PATCH 03/11] drivers/baseband: use new logtype wrapper David Marchand
` (9 subsequent siblings)
11 siblings, 2 replies; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev
The function rte_log_register_type_and_pick_level() fills a gap for
dynamically loaded code (especially drivers) who would not pick up
the log level passed at startup.
Let's promote it to stable and export it for use by drivers via
a wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
lib/librte_eal/common/include/rte_log.h | 12 ++++++++----
lib/librte_eal/rte_eal_version.map | 8 +++++++-
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index cbb4184..c3aff00 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -209,9 +209,6 @@ int rte_log_cur_msg_logtype(void);
int rte_log_register(const char *name);
/**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
* Register a dynamic log type and try to pick its level from EAL options
*
* rte_log_register() is called inside. If successful, the function tries
@@ -227,9 +224,16 @@ int rte_log_register(const char *name);
* - >=0: the newly registered log type
* - <0: rte_log_register() error value
*/
-__rte_experimental
int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
+#define RTE_LOG_REGISTER(token, name, level, fallback) \
+RTE_INIT(token##_init) \
+{ \
+ token = rte_log_register_type_and_pick_level(name, level); \
+ if (token < 0) \
+ token = fallback; \
+}
+
/**
* Dump log information.
*
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 7cbf82d..7326e92 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -312,6 +312,13 @@ DPDK_19.08 {
} DPDK_19.05;
+DPDK_19.11 {
+ global:
+
+ rte_log_register_type_and_pick_level;
+
+} DPDK_19.08;
+
EXPERIMENTAL {
global:
@@ -342,7 +349,6 @@ EXPERIMENTAL {
rte_fbarray_is_used;
rte_fbarray_set_free;
rte_fbarray_set_used;
- rte_log_register_type_and_pick_level;
rte_malloc_dump_heaps;
rte_mem_alloc_validator_register;
rte_mem_alloc_validator_unregister;
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 03/11] drivers/baseband: use new logtype wrapper
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 01/11] log: fix plugin level restore with patterns David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-08-19 15:39 ` Chautru, Nicolas
2019-08-19 11:41 ` [dpdk-dev] [PATCH 04/11] drivers/bus: " David Marchand
` (8 subsequent siblings)
11 siblings, 1 reply; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev; +Cc: Nicolas Chautru
Make use of the newly introduced wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 11 ++++-------
drivers/baseband/null/bbdev_null.c | 8 ++------
drivers/baseband/turbo_sw/bbdev_turbo_software.c | 8 ++------
3 files changed, 8 insertions(+), 19 deletions(-)
diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
index 7e05b94..397ca8f 100644
--- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
+++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
@@ -2663,13 +2663,10 @@ RTE_PMD_REGISTER_PCI(FPGA_LTE_FEC_VF_DRIVER_NAME, fpga_lte_fec_pci_vf_driver);
RTE_PMD_REGISTER_PCI_TABLE(FPGA_LTE_FEC_VF_DRIVER_NAME,
pci_id_fpga_lte_fec_vf_map);
-RTE_INIT(fpga_lte_fec_init_log)
-{
- fpga_lte_fec_logtype = rte_log_register("pmd.bb.fpga_lte_fec");
- if (fpga_lte_fec_logtype >= 0)
+RTE_LOG_REGISTER(fpga_lte_fec_logtype, "pmd.bb.fpga_lte_fec",
#ifdef RTE_LIBRTE_BBDEV_DEBUG
- rte_log_set_level(fpga_lte_fec_logtype, RTE_LOG_DEBUG);
+ RTE_LOG_DEBUG
#else
- rte_log_set_level(fpga_lte_fec_logtype, RTE_LOG_NOTICE);
+ RTE_LOG_NOTICE
#endif
-}
+ , RTE_LOGTYPE_PMD);
diff --git a/drivers/baseband/null/bbdev_null.c b/drivers/baseband/null/bbdev_null.c
index 2f25151..029c308 100644
--- a/drivers/baseband/null/bbdev_null.c
+++ b/drivers/baseband/null/bbdev_null.c
@@ -348,9 +348,5 @@ RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME,
BBDEV_NULL_SOCKET_ID_ARG"=<int>");
RTE_PMD_REGISTER_ALIAS(DRIVER_NAME, bbdev_null);
-RTE_INIT(null_bbdev_init_log)
-{
- bbdev_null_logtype = rte_log_register("pmd.bb.null");
- if (bbdev_null_logtype >= 0)
- rte_log_set_level(bbdev_null_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bbdev_null_logtype, "pmd.bb.null",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
index f2fe7a2..fb0bbbe 100644
--- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c
+++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
@@ -1988,9 +1988,5 @@ RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME,
TURBO_SW_SOCKET_ID_ARG"=<int>");
RTE_PMD_REGISTER_ALIAS(DRIVER_NAME, turbo_sw);
-RTE_INIT(turbo_sw_bbdev_init_log)
-{
- bbdev_turbo_sw_logtype = rte_log_register("pmd.bb.turbo_sw");
- if (bbdev_turbo_sw_logtype >= 0)
- rte_log_set_level(bbdev_turbo_sw_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bbdev_turbo_sw_logtype, "pmd.bb.turbo_sw",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 04/11] drivers/bus: use new logtype wrapper
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
` (2 preceding siblings ...)
2019-08-19 11:41 ` [dpdk-dev] [PATCH 03/11] drivers/baseband: use new logtype wrapper David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 05/11] drivers/common: " David Marchand
` (7 subsequent siblings)
11 siblings, 0 replies; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev; +Cc: Hemant Agrawal, Sachin Saxena, Rosen Xu, Stephen Hemminger
Make use of the newly introduced wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/bus/dpaa/dpaa_bus.c | 26 ++++++++------------------
drivers/bus/fslmc/fslmc_bus.c | 9 ++-------
drivers/bus/ifpga/ifpga_bus.c | 8 ++------
drivers/bus/vdev/vdev.c | 8 ++------
drivers/bus/vmbus/vmbus_common.c | 8 ++------
5 files changed, 16 insertions(+), 43 deletions(-)
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 07cc5c6..2eab45b 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -744,21 +744,11 @@ static struct rte_dpaa_bus rte_dpaa_bus = {
RTE_REGISTER_BUS(FSL_DPAA_BUS_NAME, rte_dpaa_bus.bus);
-RTE_INIT(dpaa_init_log)
-{
- dpaa_logtype_bus = rte_log_register("bus.dpaa");
- if (dpaa_logtype_bus >= 0)
- rte_log_set_level(dpaa_logtype_bus, RTE_LOG_NOTICE);
-
- dpaa_logtype_mempool = rte_log_register("mempool.dpaa");
- if (dpaa_logtype_mempool >= 0)
- rte_log_set_level(dpaa_logtype_mempool, RTE_LOG_NOTICE);
-
- dpaa_logtype_pmd = rte_log_register("pmd.net.dpaa");
- if (dpaa_logtype_pmd >= 0)
- rte_log_set_level(dpaa_logtype_pmd, RTE_LOG_NOTICE);
-
- dpaa_logtype_eventdev = rte_log_register("pmd.event.dpaa");
- if (dpaa_logtype_eventdev >= 0)
- rte_log_set_level(dpaa_logtype_eventdev, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa_logtype_bus, "bus.dpaa",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_EAL);
+RTE_LOG_REGISTER(dpaa_logtype_mempool, "mempool.dpaa",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_MEMPOOL);
+RTE_LOG_REGISTER(dpaa_logtype_pmd, "pmd.net.dpaa",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(dpaa_logtype_eventdev, "pmd.event.dpaa",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index a2f4825..21488b1 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -646,10 +646,5 @@ struct rte_fslmc_bus rte_fslmc_bus = {
RTE_REGISTER_BUS(FSLMC_BUS_NAME, rte_fslmc_bus.bus);
-RTE_INIT(fslmc_init_log)
-{
- /* Bus level logs */
- dpaa2_logtype_bus = rte_log_register("bus.fslmc");
- if (dpaa2_logtype_bus >= 0)
- rte_log_set_level(dpaa2_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_bus, "bus.fslmc",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_EAL);
diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index dfd6b1f..3458aac 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -474,9 +474,5 @@ static struct rte_bus rte_ifpga_bus = {
RTE_REGISTER_BUS(IFPGA_BUS_NAME, rte_ifpga_bus);
-RTE_INIT(ifpga_init_log)
-{
- ifpga_bus_logtype = rte_log_register("bus.ifpga");
- if (ifpga_bus_logtype >= 0)
- rte_log_set_level(ifpga_bus_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ifpga_bus_logtype, "bus.ifpga",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_EAL);
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index a89ea23..b16e5a1 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -558,9 +558,5 @@ static struct rte_bus rte_vdev_bus = {
RTE_REGISTER_BUS(vdev, rte_vdev_bus);
-RTE_INIT(vdev_init_log)
-{
- vdev_logtype_bus = rte_log_register("bus.vdev");
- if (vdev_logtype_bus >= 0)
- rte_log_set_level(vdev_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vdev_logtype_bus, "bus.vdev",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_EAL);
diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
index 48a219f..ff05e54 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -299,9 +299,5 @@ struct rte_vmbus_bus rte_vmbus_bus = {
RTE_REGISTER_BUS(vmbus, rte_vmbus_bus.bus);
-RTE_INIT(vmbus_init_log)
-{
- vmbus_logtype_bus = rte_log_register("bus.vmbus");
- if (vmbus_logtype_bus >= 0)
- rte_log_set_level(vmbus_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vmbus_logtype_bus, "bus.vmbus",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_EAL);
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 05/11] drivers/common: use new logtype wrapper
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
` (3 preceding siblings ...)
2019-08-19 11:41 ` [dpdk-dev] [PATCH 04/11] drivers/bus: " David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 06/11] drivers/compress: " David Marchand
` (6 subsequent siblings)
11 siblings, 0 replies; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev
Cc: Hemant Agrawal, Sachin Saxena, Jerin Jacob, Nithin Dabilpuram,
Vamsi Attunuru, John Griffin, Fiona Trahe, Deepak Kumar Jain
Make use of the newly introduced wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/common/dpaax/dpaax_iova_table.c | 8 ++---
drivers/common/octeontx/octeontx_mbox.c | 8 ++---
drivers/common/octeontx2/otx2_common.c | 62 ++++++++++++---------------------
drivers/common/qat/qat_logs.c | 18 ++++------
4 files changed, 32 insertions(+), 64 deletions(-)
diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c
index ae0af09..9bc2a4b 100644
--- a/drivers/common/dpaax/dpaax_iova_table.c
+++ b/drivers/common/dpaax/dpaax_iova_table.c
@@ -457,9 +457,5 @@ dpaax_handle_memevents(void)
dpaax_memevent_cb, NULL);
}
-RTE_INIT(dpaax_log)
-{
- dpaax_logger = rte_log_register("pmd.common.dpaax");
- if (dpaax_logger >= 0)
- rte_log_set_level(dpaax_logger, RTE_LOG_ERR);
-}
+RTE_LOG_REGISTER(dpaax_logger, "pmd.common.dpaax",
+ RTE_LOG_ERR, RTE_LOGTYPE_PMD);
diff --git a/drivers/common/octeontx/octeontx_mbox.c b/drivers/common/octeontx/octeontx_mbox.c
index 880f8a4..825a5ac 100644
--- a/drivers/common/octeontx/octeontx_mbox.c
+++ b/drivers/common/octeontx/octeontx_mbox.c
@@ -61,12 +61,8 @@ struct mbox_ram_hdr {
int octeontx_logtype_mbox;
-RTE_INIT(otx_init_log)
-{
- octeontx_logtype_mbox = rte_log_register("pmd.octeontx.mbox");
- if (octeontx_logtype_mbox >= 0)
- rte_log_set_level(octeontx_logtype_mbox, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(octeontx_logtype_mbox, "pmd.octeontx.mbox",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
static inline void
mbox_msgcpy(volatile uint8_t *d, volatile const uint8_t *s, uint16_t size)
diff --git a/drivers/common/octeontx2/otx2_common.c b/drivers/common/octeontx2/otx2_common.c
index 7e45366..a7d5387 100644
--- a/drivers/common/octeontx2/otx2_common.c
+++ b/drivers/common/octeontx2/otx2_common.c
@@ -206,43 +206,25 @@ int otx2_logtype_tim;
*/
int otx2_logtype_dpi;
-RTE_INIT(otx2_log_init);
-static void
-otx2_log_init(void)
-{
- otx2_logtype_base = rte_log_register("pmd.octeontx2.base");
- if (otx2_logtype_base >= 0)
- rte_log_set_level(otx2_logtype_base, RTE_LOG_NOTICE);
-
- otx2_logtype_mbox = rte_log_register("pmd.octeontx2.mbox");
- if (otx2_logtype_mbox >= 0)
- rte_log_set_level(otx2_logtype_mbox, RTE_LOG_NOTICE);
-
- otx2_logtype_npa = rte_log_register("pmd.mempool.octeontx2");
- if (otx2_logtype_npa >= 0)
- rte_log_set_level(otx2_logtype_npa, RTE_LOG_NOTICE);
-
- otx2_logtype_nix = rte_log_register("pmd.net.octeontx2");
- if (otx2_logtype_nix >= 0)
- rte_log_set_level(otx2_logtype_nix, RTE_LOG_NOTICE);
-
- otx2_logtype_npc = rte_log_register("pmd.net.octeontx2.flow");
- if (otx2_logtype_npc >= 0)
- rte_log_set_level(otx2_logtype_npc, RTE_LOG_NOTICE);
-
- otx2_logtype_tm = rte_log_register("pmd.net.octeontx2.tm");
- if (otx2_logtype_tm >= 0)
- rte_log_set_level(otx2_logtype_tm, RTE_LOG_NOTICE);
-
- otx2_logtype_sso = rte_log_register("pmd.event.octeontx2");
- if (otx2_logtype_sso >= 0)
- rte_log_set_level(otx2_logtype_sso, RTE_LOG_NOTICE);
-
- otx2_logtype_tim = rte_log_register("pmd.event.octeontx2.timer");
- if (otx2_logtype_tim >= 0)
- rte_log_set_level(otx2_logtype_tim, RTE_LOG_NOTICE);
-
- otx2_logtype_dpi = rte_log_register("pmd.raw.octeontx2.dpi");
- if (otx2_logtype_dpi >= 0)
- rte_log_set_level(otx2_logtype_dpi, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx2_logtype_base, "pmd.octeontx2.base",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx2_logtype_mbox, "pmd.octeontx2.mbox",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+
+RTE_LOG_REGISTER(otx2_logtype_npa, "pmd.mempool.octeontx2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_MEMPOOL);
+
+RTE_LOG_REGISTER(otx2_logtype_nix, "pmd.net.octeontx2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx2_logtype_npc, "pmd.net.octeontx2.flow",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx2_logtype_tm, "pmd.net.octeontx2.tm",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+
+RTE_LOG_REGISTER(otx2_logtype_sso, "pmd.event.octeontx2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx2_logtype_tim, "pmd.event.octeontx2.timer",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+
+RTE_LOG_REGISTER(otx2_logtype_dpi, "pmd.raw.octeontx2.dpi",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
index 7a86170..a8d1e84 100644
--- a/drivers/common/qat/qat_logs.c
+++ b/drivers/common/qat/qat_logs.c
@@ -24,15 +24,9 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
return 0;
}
-RTE_INIT(qat_pci_init_log)
-{
- /* Non-data-path logging for pci device and all services */
- qat_gen_logtype = rte_log_register("pmd.qat_general");
- if (qat_gen_logtype >= 0)
- rte_log_set_level(qat_gen_logtype, RTE_LOG_NOTICE);
-
- /* data-path logging for all services */
- qat_dp_logtype = rte_log_register("pmd.qat_dp");
- if (qat_dp_logtype >= 0)
- rte_log_set_level(qat_dp_logtype, RTE_LOG_NOTICE);
-}
+/* Non-data-path logging for pci device and all services */
+RTE_LOG_REGISTER(qat_gen_logtype, "pmd.qat_general",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+/* data-path logging for all services */
+RTE_LOG_REGISTER(qat_dp_logtype, "pmd.qat_dp",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 06/11] drivers/compress: use new logtype wrapper
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
` (4 preceding siblings ...)
2019-08-19 11:41 ` [dpdk-dev] [PATCH 05/11] drivers/common: " David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 07/11] drivers/crypto: " David Marchand
` (5 subsequent siblings)
11 siblings, 0 replies; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev; +Cc: Lee Daly, Fiona Trahe, Pablo de Lara, Ashish Gupta, Sunila Sahu
Make use of the newly introduced wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/compress/isal/isal_compress_pmd.c | 8 ++------
drivers/compress/octeontx/otx_zip_pmd.c | 8 ++------
drivers/compress/zlib/zlib_pmd.c | 8 ++------
3 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress/isal/isal_compress_pmd.c
index 7d2b05c..a273229 100644
--- a/drivers/compress/isal/isal_compress_pmd.c
+++ b/drivers/compress/isal/isal_compress_pmd.c
@@ -753,9 +753,5 @@ RTE_PMD_REGISTER_VDEV(COMPDEV_NAME_ISAL_PMD, compdev_isal_pmd_drv);
RTE_PMD_REGISTER_PARAM_STRING(COMPDEV_NAME_ISAL_PMD,
"socket_id=<int>");
-RTE_INIT(isal_init_log)
-{
- isal_logtype_driver = rte_log_register("pmd.compress.isal");
- if (isal_logtype_driver >= 0)
- rte_log_set_level(isal_logtype_driver, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(isal_logtype_driver, "pmd.compress.isal",
+ RTE_LOG_INFO, RTE_LOGTYPE_PMD);
diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c
index a1651b2..a0a2f05 100644
--- a/drivers/compress/octeontx/otx_zip_pmd.c
+++ b/drivers/compress/octeontx/otx_zip_pmd.c
@@ -647,9 +647,5 @@ static struct rte_pci_driver octtx_zip_pmd = {
RTE_PMD_REGISTER_PCI(COMPRESSDEV_NAME_ZIP_PMD, octtx_zip_pmd);
RTE_PMD_REGISTER_PCI_TABLE(COMPRESSDEV_NAME_ZIP_PMD, pci_id_octtx_zipvf_table);
-RTE_INIT(octtx_zip_init_log)
-{
- octtx_zip_logtype_driver = rte_log_register("pmd.compress.octeontx");
- if (octtx_zip_logtype_driver >= 0)
- rte_log_set_level(octtx_zip_logtype_driver, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(octtx_zip_logtype_driver, "pmd.compress.octeontx",
+ RTE_LOG_INFO, RTE_LOGTYPE_PMD);
diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zlib_pmd.c
index 19f9200..e2b2c16 100644
--- a/drivers/compress/zlib/zlib_pmd.c
+++ b/drivers/compress/zlib/zlib_pmd.c
@@ -427,9 +427,5 @@ static struct rte_vdev_driver zlib_pmd_drv = {
RTE_PMD_REGISTER_VDEV(COMPRESSDEV_NAME_ZLIB_PMD, zlib_pmd_drv);
-RTE_INIT(zlib_init_log)
-{
- zlib_logtype_driver = rte_log_register("pmd.compress.zlib");
- if (zlib_logtype_driver >= 0)
- rte_log_set_level(zlib_logtype_driver, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(zlib_logtype_driver, "pmd.compress.zlib",
+ RTE_LOG_INFO, RTE_LOGTYPE_PMD);
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 07/11] drivers/crypto: use new logtype wrapper
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
` (5 preceding siblings ...)
2019-08-19 11:41 ` [dpdk-dev] [PATCH 06/11] drivers/compress: " David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 08/11] drivers/event: " David Marchand
` (4 subsequent siblings)
11 siblings, 0 replies; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev
Cc: Declan Doherty, Gagandeep Singh, Hemant Agrawal, Akhil Goyal,
Pablo de Lara, Tomasz Duszynski, Michael Shamis, Liron Himi,
Anoob Joseph, Fan Zhang, Jay Zhou
Make use of the newly introduced wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 7 ++---
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 6 ++--
drivers/crypto/caam_jr/caam_jr.c | 8 ++---
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 9 ++----
drivers/crypto/dpaa_sec/dpaa_sec.c | 8 ++---
drivers/crypto/kasumi/rte_kasumi_pmd.c | 6 ++--
drivers/crypto/mvsam/rte_mrvl_pmd.c | 6 ++--
drivers/crypto/null/null_crypto_pmd.c | 6 ++--
drivers/crypto/octeontx/otx_cryptodev.c | 9 ++----
drivers/crypto/openssl/rte_openssl_pmd.c | 6 ++--
drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 6 ++--
drivers/crypto/snow3g/rte_snow3g_pmd.c | 6 ++--
drivers/crypto/virtio/virtio_cryptodev.c | 35 +++++++---------------
drivers/crypto/zuc/rte_zuc_pmd.c | 6 ++--
14 files changed, 36 insertions(+), 88 deletions(-)
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 1006a5c..0d855d2 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -663,8 +663,5 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_GCM_PMD,
RTE_PMD_REGISTER_CRYPTO_DRIVER(aesni_gcm_crypto_drv, aesni_gcm_pmd_drv.driver,
cryptodev_driver_id);
-
-RTE_INIT(aesni_gcm_init_log)
-{
- aesni_gcm_logtype_driver = rte_log_register("pmd.crypto.aesni_gcm");
-}
+RTE_LOG_REGISTER(aesni_gcm_logtype_driver, "pmd.crypto.aesni_gcm",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index b495a96..1cf9d5d 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -1380,7 +1380,5 @@ RTE_PMD_REGISTER_CRYPTO_DRIVER(aesni_mb_crypto_drv,
cryptodev_aesni_mb_pmd_drv.driver,
cryptodev_driver_id);
-RTE_INIT(aesni_mb_init_log)
-{
- aesni_mb_logtype_driver = rte_log_register("pmd.crypto.aesni_mb");
-}
+RTE_LOG_REGISTER(aesni_mb_logtype_driver, "pmd.crypto.aesni_mb",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index 77c0303..4824e13 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -2500,9 +2500,5 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_CAAM_JR_PMD,
RTE_PMD_REGISTER_CRYPTO_DRIVER(caam_jr_crypto_drv, cryptodev_caam_jr_drv.driver,
cryptodev_driver_id);
-RTE_INIT(caam_jr_init_log)
-{
- caam_jr_logtype = rte_log_register("pmd.crypto.caam");
- if (caam_jr_logtype >= 0)
- rte_log_set_level(caam_jr_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(caam_jr_logtype, "pmd.crypto.caam",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 26458e5..3cb7b08 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3454,10 +3454,5 @@ RTE_PMD_REGISTER_DPAA2(CRYPTODEV_NAME_DPAA2_SEC_PMD, rte_dpaa2_sec_driver);
RTE_PMD_REGISTER_CRYPTO_DRIVER(dpaa2_sec_crypto_drv,
rte_dpaa2_sec_driver.driver, cryptodev_driver_id);
-RTE_INIT(dpaa2_sec_init_log)
-{
- /* Bus level logs */
- dpaa2_logtype_sec = rte_log_register("pmd.crypto.dpaa2");
- if (dpaa2_logtype_sec >= 0)
- rte_log_set_level(dpaa2_logtype_sec, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_sec, "pmd.crypto.dpaa2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 122c80a..3071258 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -2765,9 +2765,5 @@ RTE_PMD_REGISTER_DPAA(CRYPTODEV_NAME_DPAA_SEC_PMD, rte_dpaa_sec_driver);
RTE_PMD_REGISTER_CRYPTO_DRIVER(dpaa_sec_crypto_drv, rte_dpaa_sec_driver.driver,
cryptodev_driver_id);
-RTE_INIT(dpaa_sec_init_log)
-{
- dpaa_logtype_sec = rte_log_register("pmd.crypto.dpaa");
- if (dpaa_logtype_sec >= 0)
- rte_log_set_level(dpaa_logtype_sec, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa_logtype_sec, "pmd.crypto.dpaa",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c
index 3abdb01..1f30561 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
@@ -625,7 +625,5 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_KASUMI_PMD,
RTE_PMD_REGISTER_CRYPTO_DRIVER(kasumi_crypto_drv,
cryptodev_kasumi_pmd_drv.driver, cryptodev_driver_id);
-RTE_INIT(kasumi_init_log)
-{
- kasumi_logtype_driver = rte_log_register("pmd.crypto.kasumi");
-}
+RTE_LOG_REGISTER(kasumi_logtype_driver, "pmd.crypto.kasumi",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c
index ef2e5ed..4349efd 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c
@@ -1021,7 +1021,5 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_MRVL_PMD,
RTE_PMD_REGISTER_CRYPTO_DRIVER(mrvl_crypto_drv, cryptodev_mrvl_pmd_drv.driver,
cryptodev_driver_id);
-RTE_INIT(crypto_mrvl_init_log)
-{
- mrvl_logtype_driver = rte_log_register("pmd.crypto.mvsam");
-}
+RTE_LOG_REGISTER(mrvl_logtype_driver, "pmd.crypto.mvsam",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c
index d5e3064..d70cd02 100644
--- a/drivers/crypto/null/null_crypto_pmd.c
+++ b/drivers/crypto/null/null_crypto_pmd.c
@@ -248,7 +248,5 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_NULL_PMD,
RTE_PMD_REGISTER_CRYPTO_DRIVER(null_crypto_drv, cryptodev_null_pmd_drv.driver,
cryptodev_driver_id);
-RTE_INIT(null_init_log)
-{
- null_logtype_driver = rte_log_register("pmd.crypto.null");
-}
+RTE_LOG_REGISTER(null_logtype_driver, "pmd.crypto.null",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c
index fc64a5f..fd44763 100644
--- a/drivers/crypto/octeontx/otx_cryptodev.c
+++ b/drivers/crypto/octeontx/otx_cryptodev.c
@@ -121,10 +121,5 @@ RTE_PMD_REGISTER_PCI_TABLE(CRYPTODEV_NAME_OCTEONTX_PMD, pci_id_cpt_table);
RTE_PMD_REGISTER_CRYPTO_DRIVER(otx_cryptodev_drv, otx_cryptodev_pmd.driver,
otx_cryptodev_driver_id);
-RTE_INIT(otx_cpt_init_log)
-{
- /* Bus level logs */
- otx_cryptodev_logtype = rte_log_register("pmd.crypto.octeontx");
- if (otx_cryptodev_logtype >= 0)
- rte_log_set_level(otx_cryptodev_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx_cryptodev_logtype, "pmd.crypto.octeontx",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 2f55528..372dfb5 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -2198,7 +2198,5 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_OPENSSL_PMD,
RTE_PMD_REGISTER_CRYPTO_DRIVER(openssl_crypto_drv,
cryptodev_openssl_pmd_drv.driver, cryptodev_driver_id);
-RTE_INIT(openssl_init_log)
-{
- openssl_logtype_driver = rte_log_register("pmd.crypto.openssl");
-}
+RTE_LOG_REGISTER(openssl_logtype_driver, "pmd.crypto.openssl",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
index 1fef88f..57e7401 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
@@ -578,7 +578,5 @@ rte_cryptodev_scheduler_option_get(uint8_t scheduler_id,
return (*sched_ctx->ops.option_get)(dev, option_type, option);
}
-RTE_INIT(scheduler_init_log)
-{
- scheduler_logtype_driver = rte_log_register("pmd.crypto.scheduler");
-}
+RTE_LOG_REGISTER(scheduler_logtype_driver, "pmd.crypto.scheduler",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_CRYPTODEV);
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c
index 68d7176..fea2dfe 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
@@ -636,7 +636,5 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SNOW3G_PMD,
RTE_PMD_REGISTER_CRYPTO_DRIVER(snow3g_crypto_drv,
cryptodev_snow3g_pmd_drv.driver, cryptodev_driver_id);
-RTE_INIT(snow3g_init_log)
-{
- snow3g_logtype_driver = rte_log_register("pmd.crypto.snow3g");
-}
+RTE_LOG_REGISTER(snow3g_logtype_drivern "pmd.crypto.snow3g",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index f16bdfe..6e2a5ac 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -1490,28 +1490,13 @@ RTE_PMD_REGISTER_CRYPTO_DRIVER(virtio_crypto_drv,
rte_virtio_crypto_driver.driver,
cryptodev_virtio_driver_id);
-RTE_INIT(virtio_crypto_init_log)
-{
- virtio_crypto_logtype_init = rte_log_register("pmd.crypto.virtio.init");
- if (virtio_crypto_logtype_init >= 0)
- rte_log_set_level(virtio_crypto_logtype_init, RTE_LOG_NOTICE);
-
- virtio_crypto_logtype_session =
- rte_log_register("pmd.crypto.virtio.session");
- if (virtio_crypto_logtype_session >= 0)
- rte_log_set_level(virtio_crypto_logtype_session,
- RTE_LOG_NOTICE);
-
- virtio_crypto_logtype_rx = rte_log_register("pmd.crypto.virtio.rx");
- if (virtio_crypto_logtype_rx >= 0)
- rte_log_set_level(virtio_crypto_logtype_rx, RTE_LOG_NOTICE);
-
- virtio_crypto_logtype_tx = rte_log_register("pmd.crypto.virtio.tx");
- if (virtio_crypto_logtype_tx >= 0)
- rte_log_set_level(virtio_crypto_logtype_tx, RTE_LOG_NOTICE);
-
- virtio_crypto_logtype_driver =
- rte_log_register("pmd.crypto.virtio.driver");
- if (virtio_crypto_logtype_driver >= 0)
- rte_log_set_level(virtio_crypto_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(virtio_crypto_logtype_init, "pmd.crypto.virtio.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(virtio_crypto_logtype_session, "pmd.crypto.virtio.session",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(virtio_crypto_logtype_rx, "pmd.crypto.virtio.rx",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(virtio_crypto_logtype_tx, "pmd.crypto.virtio.tx",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(virtio_crypto_logtype_driver, "pmd.crypto.virtio.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index 637994d..e6a9cb7 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -544,7 +544,5 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_ZUC_PMD,
RTE_PMD_REGISTER_CRYPTO_DRIVER(zuc_crypto_drv, cryptodev_zuc_pmd_drv.driver,
cryptodev_driver_id);
-RTE_INIT(zuc_init_log)
-{
- zuc_logtype_driver = rte_log_register("pmd.crypto.zuc");
-}
+RTE_LOG_REGISTER(zuc_logtype_driver, "pmd.crypto.zuc",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 08/11] drivers/event: use new logtype wrapper
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
` (6 preceding siblings ...)
2019-08-19 11:41 ` [dpdk-dev] [PATCH 07/11] drivers/crypto: " David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 09/11] drivers/mempool: " David Marchand
` (3 subsequent siblings)
11 siblings, 0 replies; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev
Cc: Hemant Agrawal, Nipun Gupta, Jerin Jacob, Pavan Nikhilesh,
Liang Ma, Peter Mccarthy, Harry van Haaren
Make use of the newly introduced wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/event/dpaa2/dpaa2_eventdev.c | 8 ++------
drivers/event/octeontx/ssovf_evdev.c | 8 ++------
drivers/event/octeontx/timvf_evdev.c | 8 ++------
drivers/event/opdl/opdl_evdev.c | 9 ++-------
drivers/event/sw/sw_evdev.c | 8 ++------
5 files changed, 10 insertions(+), 31 deletions(-)
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 926b7ed..00701e3 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -1096,9 +1096,5 @@ static struct rte_vdev_driver vdev_eventdev_dpaa2_pmd = {
RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_DPAA2_PMD, vdev_eventdev_dpaa2_pmd);
-RTE_INIT(dpaa2_eventdev_init_log)
-{
- dpaa2_logtype_event = rte_log_register("pmd.event.dpaa2");
- if (dpaa2_logtype_event >= 0)
- rte_log_set_level(dpaa2_logtype_event, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_event, "pmd.event.dpaa2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index a273d4c..d1d2645 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -23,12 +23,8 @@
int otx_logtype_ssovf;
static uint8_t timvf_enable_stats;
-RTE_INIT(otx_ssovf_init_log)
-{
- otx_logtype_ssovf = rte_log_register("pmd.event.octeontx");
- if (otx_logtype_ssovf >= 0)
- rte_log_set_level(otx_logtype_ssovf, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx_logtype_ssovf, "pmd.event.octeontx",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
/* SSOPF Mailbox messages */
diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c
index abbc9a7..f087ce2 100644
--- a/drivers/event/octeontx/timvf_evdev.c
+++ b/drivers/event/octeontx/timvf_evdev.c
@@ -6,12 +6,8 @@
int otx_logtype_timvf;
-RTE_INIT(otx_timvf_init_log)
-{
- otx_logtype_timvf = rte_log_register("pmd.event.octeontx.timer");
- if (otx_logtype_timvf >= 0)
- rte_log_set_level(otx_logtype_timvf, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx_logtype_timvf, "pmd.event.octeontx.timer",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
struct __rte_packed timvf_mbox_dev_info {
uint64_t ring_active[4];
diff --git a/drivers/event/opdl/opdl_evdev.c b/drivers/event/opdl/opdl_evdev.c
index 3beca89..c0c1ec5 100644
--- a/drivers/event/opdl/opdl_evdev.c
+++ b/drivers/event/opdl/opdl_evdev.c
@@ -754,13 +754,8 @@ static struct rte_vdev_driver evdev_opdl_pmd_drv = {
.remove = opdl_remove
};
-RTE_INIT(opdl_init_log)
-{
- opdl_logtype_driver = rte_log_register("pmd.event.opdl.driver");
- if (opdl_logtype_driver >= 0)
- rte_log_set_level(opdl_logtype_driver, RTE_LOG_INFO);
-}
-
+RTE_LOG_REGISTER(opdl_logtype_driver, "pmd.event.opdl.driver",
+ RTE_LOG_INFO, RTE_LOGTYPE_PMD);
RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_OPDL_PMD, evdev_opdl_pmd_drv);
RTE_PMD_REGISTER_PARAM_STRING(event_opdl, NUMA_NODE_ARG "=<int>"
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index fb8e8be..0077fa8 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -1087,9 +1087,5 @@ RTE_PMD_REGISTER_PARAM_STRING(event_sw, NUMA_NODE_ARG "=<int> "
/* declared extern in header, for access from other .c files */
int eventdev_sw_log_level;
-RTE_INIT(evdev_sw_init_log)
-{
- eventdev_sw_log_level = rte_log_register("pmd.event.sw");
- if (eventdev_sw_log_level >= 0)
- rte_log_set_level(eventdev_sw_log_level, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eventdev_sw_log_level, "pmd.event.sw",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 09/11] drivers/mempool: use new logtype wrapper
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
` (7 preceding siblings ...)
2019-08-19 11:41 ` [dpdk-dev] [PATCH 08/11] drivers/event: " David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 10/11] drivers/net: " David Marchand
` (2 subsequent siblings)
11 siblings, 0 replies; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev; +Cc: Hemant Agrawal, Sachin Saxena, Jerin Jacob
Make use of the newly introduced wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 8 ++------
drivers/mempool/octeontx/octeontx_fpavf.c | 8 ++------
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index f26c30b..6398920 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -437,9 +437,5 @@ static const struct rte_mempool_ops dpaa2_mpool_ops = {
MEMPOOL_REGISTER_OPS(dpaa2_mpool_ops);
-RTE_INIT(dpaa2_mempool_init_log)
-{
- dpaa2_logtype_mempool = rte_log_register("mempool.dpaa2");
- if (dpaa2_logtype_mempool >= 0)
- rte_log_set_level(dpaa2_logtype_mempool, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_mempool, "mempool.dpaa2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_MEMPOOL);
diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c
index baabc01..11c5894 100644
--- a/drivers/mempool/octeontx/octeontx_fpavf.c
+++ b/drivers/mempool/octeontx/octeontx_fpavf.c
@@ -108,12 +108,8 @@ static struct octeontx_fpadev fpadev;
int octeontx_logtype_fpavf;
int octeontx_logtype_fpavf_mbox;
-RTE_INIT(otx_pool_init_log)
-{
- octeontx_logtype_fpavf = rte_log_register("pmd.mempool.octeontx");
- if (octeontx_logtype_fpavf >= 0)
- rte_log_set_level(octeontx_logtype_fpavf, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(octeontx_logtype_fpavf, "pmd.mempool.octeontx",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
/* lock is taken by caller */
static int
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 10/11] drivers/net: use new logtype wrapper
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
` (8 preceding siblings ...)
2019-08-19 11:41 ` [dpdk-dev] [PATCH 09/11] drivers/mempool: " David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-08-19 14:55 ` Legacy, Allain
2019-09-02 16:11 ` Ferruh Yigit
2019-08-19 11:41 ` [dpdk-dev] [PATCH 11/11] drivers/raw: " David Marchand
2019-09-02 14:17 ` [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers Ferruh Yigit
11 siblings, 2 replies; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev
Cc: John W. Linville, Xiaolong Ye, Qi Zhang, Igor Russkikh,
Pavel Belous, Allain Legacy, Matt Peters, Ravi Kumar,
Rasesh Mody, Shahed Shaikh, Ajit Khaparde, Somnath Kotur,
Chas Williams, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
Marcin Wojtas, Michal Krawczyk, Guy Tzalik, Evgeny Schemeilin,
Gagandeep Singh, John Daley, Hyong Youb Kim, Gaetan Rivet,
Xiao Wang, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
Jingjing Wu, Qiming Yang, Rosen Xu, Konstantin Ananyev,
Ferruh Yigit, Shijith Thotton, Srisivasubramanian Srinivasan,
Jakub Grajciar, Matan Azrad, Shahaf Shuler, Yongseok Koh,
Viacheslav Ovsiienko, Zyta Szpak, Liron Himi, Tomasz Duszynski,
Stephen Hemminger, K. Y. Srinivasan, Haiyang Zhang,
Alejandro Lucero, Tetsuya Mukawa, Jerin Jacob, Bruce Richardson,
Jasvinder Singh, Cristian Dumitrescu, Jan Remes,
Rastislav Cernay, Keith Wiles, Maciej Czekaj, Maxime Coquelin,
Tiwei Bie, Zhihong Wang, Yong Wang
Make use of the newly introduced wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/net/af_packet/rte_eth_af_packet.c | 8 ++------
drivers/net/af_xdp/rte_eth_af_xdp.c | 8 ++------
drivers/net/atlantic/atl_ethdev.c | 13 ++++---------
drivers/net/avp/avp_ethdev.c | 8 ++------
drivers/net/axgbe/axgbe_ethdev.c | 13 ++++---------
drivers/net/bnx2x/bnx2x_ethdev.c | 13 ++++---------
drivers/net/bnxt/bnxt_ethdev.c | 8 ++------
drivers/net/bonding/rte_eth_bond_pmd.c | 8 ++------
drivers/net/dpaa2/dpaa2_ethdev.c | 8 ++------
drivers/net/e1000/e1000_logs.c | 21 +++++----------------
drivers/net/e1000/e1000_logs.h | 4 ----
drivers/net/e1000/em_ethdev.c | 6 ------
drivers/net/e1000/igb_ethdev.c | 6 ------
drivers/net/ena/ena_ethdev.c | 13 ++++---------
drivers/net/enetc/enetc_ethdev.c | 8 ++------
drivers/net/enic/enic_ethdev.c | 8 ++------
drivers/net/failsafe/failsafe.c | 8 ++------
drivers/net/fm10k/fm10k_ethdev.c | 13 ++++---------
drivers/net/hinic/hinic_pmd_ethdev.c | 8 ++------
drivers/net/i40e/i40e_ethdev.c | 13 ++++---------
drivers/net/iavf/iavf_ethdev.c | 13 ++++---------
drivers/net/ice/ice_ethdev.c | 13 ++++---------
drivers/net/ifc/ifcvf_vdpa.c | 8 ++------
drivers/net/ipn3ke/ipn3ke_ethdev.c | 8 ++------
drivers/net/ixgbe/ixgbe_ethdev.c | 13 ++++---------
drivers/net/kni/rte_eth_kni.c | 8 ++------
drivers/net/liquidio/lio_ethdev.c | 13 ++++---------
drivers/net/memif/rte_eth_memif.c | 8 ++------
drivers/net/mlx4/mlx4.c | 8 +++-----
drivers/net/mlx5/mlx5.c | 8 +++-----
drivers/net/mvneta/mvneta_ethdev.c | 8 ++------
drivers/net/mvpp2/mrvl_ethdev.c | 8 ++------
drivers/net/netvsc/hn_ethdev.c | 13 ++++---------
drivers/net/nfp/nfp_net.c | 13 ++++---------
drivers/net/null/rte_eth_null.c | 8 ++------
drivers/net/octeontx/octeontx_ethdev.c | 20 ++++++--------------
drivers/net/pcap/rte_eth_pcap.c | 8 ++------
drivers/net/qede/qede_ethdev.c | 13 ++++---------
drivers/net/ring/rte_eth_ring.c | 8 ++------
drivers/net/softnic/rte_eth_softnic.c | 9 ++-------
drivers/net/szedata2/rte_eth_szedata2.c | 13 ++++---------
drivers/net/tap/rte_eth_tap.c | 8 ++------
drivers/net/thunderx/nicvf_ethdev.c | 20 ++++++--------------
drivers/net/vdev_netvsc/vdev_netvsc.c | 9 ++-------
drivers/net/vhost/rte_eth_vhost.c | 8 ++------
drivers/net/virtio/virtio_ethdev.c | 13 ++++---------
drivers/net/vmxnet3/vmxnet3_ethdev.c | 13 ++++---------
47 files changed, 133 insertions(+), 354 deletions(-)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 82bf2cd..d6b8938 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -1018,9 +1018,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_af_packet,
"framecnt=<int> "
"qdisc_bypass=<0|1>");
-RTE_INIT(af_packet_init_log)
-{
- af_packet_logtype = rte_log_register("pmd.net.packet");
- if (af_packet_logtype >= 0)
- rte_log_set_level(af_packet_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(af_packet_logtype, "pmd.net.packet",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 41ed5b2..6707c61 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -1119,9 +1119,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_af_xdp,
"queue_count=<int> "
"pmd_zero_copy=<0|1>");
-RTE_INIT(af_xdp_init_log)
-{
- af_xdp_logtype = rte_log_register("pmd.net.af_xdp");
- if (af_xdp_logtype >= 0)
- rte_log_set_level(af_xdp_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(af_xdp_logtype, "pmd.net.af_xdp",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c
index 3c1b349..129c36a 100644
--- a/drivers/net/atlantic/atl_ethdev.c
+++ b/drivers/net/atlantic/atl_ethdev.c
@@ -1890,12 +1890,7 @@ RTE_PMD_REGISTER_PCI(net_atlantic, rte_atl_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_atlantic, pci_id_atl_map);
RTE_PMD_REGISTER_KMOD_DEP(net_atlantic, "* igb_uio | uio_pci_generic");
-RTE_INIT(atl_init_log)
-{
- atl_logtype_init = rte_log_register("pmd.net.atlantic.init");
- if (atl_logtype_init >= 0)
- rte_log_set_level(atl_logtype_init, RTE_LOG_NOTICE);
- atl_logtype_driver = rte_log_register("pmd.net.atlantic.driver");
- if (atl_logtype_driver >= 0)
- rte_log_set_level(atl_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(atl_logtype_init, "pmd.net.atlantic.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(atl_logtype_driver, "pmd.net.atlantic.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 504435e..66fb5da 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -2299,9 +2299,5 @@ avp_dev_stats_reset(struct rte_eth_dev *eth_dev)
RTE_PMD_REGISTER_PCI(net_avp, rte_avp_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_avp, pci_id_avp_map);
-RTE_INIT(avp_init_log)
-{
- avp_logtype_driver = rte_log_register("pmd.net.avp.driver");
- if (avp_logtype_driver >= 0)
- rte_log_set_level(avp_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(avp_logtype_driver, "pmd.net.avp.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index 4fcede8..e85aea9 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -762,12 +762,7 @@ RTE_PMD_REGISTER_PCI(net_axgbe, rte_axgbe_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_axgbe, pci_id_axgbe_map);
RTE_PMD_REGISTER_KMOD_DEP(net_axgbe, "* igb_uio | uio_pci_generic | vfio-pci");
-RTE_INIT(axgbe_init_log)
-{
- axgbe_logtype_init = rte_log_register("pmd.net.axgbe.init");
- if (axgbe_logtype_init >= 0)
- rte_log_set_level(axgbe_logtype_init, RTE_LOG_NOTICE);
- axgbe_logtype_driver = rte_log_register("pmd.net.axgbe.driver");
- if (axgbe_logtype_driver >= 0)
- rte_log_set_level(axgbe_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(axgbe_logtype_init, "pmd.net.axgbe.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(axgbe_logtype_driver, "pmd.net.axgbe.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index cda29e6..b1d5acb 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -757,12 +757,7 @@ RTE_PMD_REGISTER_PCI(net_bnx2xvf, rte_bnx2xvf_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_bnx2xvf, pci_id_bnx2xvf_map);
RTE_PMD_REGISTER_KMOD_DEP(net_bnx2xvf, "* igb_uio | vfio-pci");
-RTE_INIT(bnx2x_init_log)
-{
- bnx2x_logtype_init = rte_log_register("pmd.net.bnx2x.init");
- if (bnx2x_logtype_init >= 0)
- rte_log_set_level(bnx2x_logtype_init, RTE_LOG_NOTICE);
- bnx2x_logtype_driver = rte_log_register("pmd.net.bnx2x.driver");
- if (bnx2x_logtype_driver >= 0)
- rte_log_set_level(bnx2x_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bnx2x_logtype_init, "pmd.net.bnx2x.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(bnx2x_logtype_driver, "pmd.net.bnx2x.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7..fd19b9d 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4067,12 +4067,8 @@ bool is_bnxt_supported(struct rte_eth_dev *dev)
return is_device_supported(dev, &bnxt_rte_pmd);
}
-RTE_INIT(bnxt_init_log)
-{
- bnxt_logtype_driver = rte_log_register("pmd.net.bnxt.driver");
- if (bnxt_logtype_driver >= 0)
- rte_log_set_level(bnxt_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bnxt_logtype_driver, "pmd.net.bnxt.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
RTE_PMD_REGISTER_PCI(net_bnxt, bnxt_rte_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_bnxt, bnxt_pci_id_map);
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 6a6ed89..26d826d 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3640,9 +3640,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_bonding,
int bond_logtype;
-RTE_INIT(bond_init_log)
-{
- bond_logtype = rte_log_register("pmd.net.bond");
- if (bond_logtype >= 0)
- rte_log_set_level(bond_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bond_logtype, "pmd.net.bond",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index dd6a78f..01b7c33 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2391,9 +2391,5 @@ static struct rte_dpaa2_driver rte_dpaa2_pmd = {
RTE_PMD_REGISTER_DPAA2(net_dpaa2, rte_dpaa2_pmd);
RTE_PMD_REGISTER_PARAM_STRING(net_dpaa2,
DRIVER_LOOPBACK_MODE "=<int>");
-RTE_INIT(dpaa2_pmd_init_log)
-{
- dpaa2_logtype_pmd = rte_log_register("pmd.net.dpaa2");
- if (dpaa2_logtype_pmd >= 0)
- rte_log_set_level(dpaa2_logtype_pmd, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_pmd, "pmd.net.dpaa2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 2217393..a6765f4 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -8,19 +8,8 @@
int e1000_logtype_init;
int e1000_logtype_driver;
-/* avoids double registering of logs if EM and IGB drivers are in use */
-static int e1000_log_initialized;
-
-void
-e1000_igb_init_log(void)
-{
- if (!e1000_log_initialized) {
- e1000_logtype_init = rte_log_register("pmd.net.e1000.init");
- if (e1000_logtype_init >= 0)
- rte_log_set_level(e1000_logtype_init, RTE_LOG_NOTICE);
- e1000_logtype_driver = rte_log_register("pmd.net.e1000.driver");
- if (e1000_logtype_driver >= 0)
- rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
- e1000_log_initialized = 1;
- }
-}
+/* register only once if EM and IGB drivers are in use */
+RTE_LOG_REGISTER(e1000_logtype_init, "pmd.net.e1000.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(e1000_logtype_driver, "pmd.net.e1000.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 69d3d31..03d75c8 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -43,8 +43,4 @@ extern int e1000_logtype_driver;
#define PMD_DRV_LOG(level, fmt, args...) \
PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
-
-/* log init function shared by e1000 and igb drivers */
-void e1000_igb_init_log(void);
-
#endif /* _E1000_LOGS_H_ */
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 20b5406..a7ce4bd 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1826,9 +1826,3 @@ eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
RTE_PMD_REGISTER_PCI(net_e1000_em, rte_em_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_e1000_em, pci_id_em_map);
RTE_PMD_REGISTER_KMOD_DEP(net_e1000_em, "* igb_uio | uio_pci_generic | vfio-pci");
-
-/* see e1000_logs.c */
-RTE_INIT(igb_init_log)
-{
- e1000_igb_init_log();
-}
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index fec2b42..003b338 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -5739,9 +5739,3 @@ RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb, "* igb_uio | uio_pci_generic | vfio-pci
RTE_PMD_REGISTER_PCI(net_e1000_igb_vf, rte_igbvf_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_e1000_igb_vf, pci_id_igbvf_map);
RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb_vf, "* igb_uio | vfio-pci");
-
-/* see e1000_logs.c */
-RTE_INIT(e1000_init_log)
-{
- e1000_igb_init_log();
-}
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 7d4a3b2..c352a34 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2594,15 +2594,10 @@ RTE_PMD_REGISTER_PCI(net_ena, rte_ena_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_ena, pci_id_ena_map);
RTE_PMD_REGISTER_KMOD_DEP(net_ena, "* igb_uio | uio_pci_generic | vfio-pci");
-RTE_INIT(ena_init_log)
-{
- ena_logtype_init = rte_log_register("pmd.net.ena.init");
- if (ena_logtype_init >= 0)
- rte_log_set_level(ena_logtype_init, RTE_LOG_NOTICE);
- ena_logtype_driver = rte_log_register("pmd.net.ena.driver");
- if (ena_logtype_driver >= 0)
- rte_log_set_level(ena_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ena_logtype_init, "pmd.net.ena.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(ena_logtype_driver, "pmd.net.ena.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
/******************************************************************************
******************************** AENQ Handlers *******************************
diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c
index 6c5501a..c49b382 100644
--- a/drivers/net/enetc/enetc_ethdev.c
+++ b/drivers/net/enetc/enetc_ethdev.c
@@ -890,9 +890,5 @@ RTE_PMD_REGISTER_PCI(net_enetc, rte_enetc_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_enetc, pci_id_enetc_map);
RTE_PMD_REGISTER_KMOD_DEP(net_enetc, "* vfio-pci");
-RTE_INIT(enetc_pmd_init_log)
-{
- enetc_logtype_pmd = rte_log_register("pmd.net.enetc");
- if (enetc_logtype_pmd >= 0)
- rte_log_set_level(enetc_logtype_pmd, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(enetc_logtype_pmd, "pmd.net.enetc",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 06dc671..b1e24e7 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -69,12 +69,8 @@ static const struct vic_speed_capa {
#define ENIC_DEVARG_ENABLE_AVX2_RX "enable-avx2-rx"
#define ENIC_DEVARG_IG_VLAN_REWRITE "ig-vlan-rewrite"
-RTE_INIT(enicpmd_init_log)
-{
- enic_pmd_logtype = rte_log_register("pmd.net.enic");
- if (enic_pmd_logtype >= 0)
- rte_log_set_level(enic_pmd_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(enic_pmd_logtype, "pmd.net.enic",
+ RTE_LOG_INFO, RTE_LOGTYPE_PMD);
static int
enicpmd_fdir_ctrl_func(struct rte_eth_dev *eth_dev,
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 8af31d7..40390f7 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -410,9 +410,5 @@ static struct rte_vdev_driver failsafe_drv = {
RTE_PMD_REGISTER_VDEV(net_failsafe, failsafe_drv);
RTE_PMD_REGISTER_PARAM_STRING(net_failsafe, PMD_FAILSAFE_PARAM_STRING);
-RTE_INIT(failsafe_init_log)
-{
- failsafe_logtype = rte_log_register("pmd.net.failsafe");
- if (failsafe_logtype >= 0)
- rte_log_set_level(failsafe_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(failsafe_logtype, "pmd.net.failsafe",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD)
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d721..d104c5d 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3277,12 +3277,7 @@ RTE_PMD_REGISTER_PCI(net_fm10k, rte_pmd_fm10k);
RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map);
RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio-pci");
-RTE_INIT(fm10k_init_log)
-{
- fm10k_logtype_init = rte_log_register("pmd.net.fm10k.init");
- if (fm10k_logtype_init >= 0)
- rte_log_set_level(fm10k_logtype_init, RTE_LOG_NOTICE);
- fm10k_logtype_driver = rte_log_register("pmd.net.fm10k.driver");
- if (fm10k_logtype_driver >= 0)
- rte_log_set_level(fm10k_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(fm10k_logtype_init, "pmd.net.fm10k.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(fm10k_logtype_driver, "pmd.net.fm10k.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af90..bdaec90 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -2336,9 +2336,5 @@ static struct rte_pci_driver rte_hinic_pmd = {
RTE_PMD_REGISTER_PCI(net_hinic, rte_hinic_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_hinic, pci_id_hinic_map);
-RTE_INIT(hinic_init_log)
-{
- hinic_logtype = rte_log_register("pmd.net.hinic");
- if (hinic_logtype >= 0)
- rte_log_set_level(hinic_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(hinic_logtype, "pmd.net.hinic",
+ RTE_LOG_INFO, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7a..0bfcf25 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12761,15 +12761,10 @@ i40e_config_rss_filter(struct i40e_pf *pf,
return 0;
}
-RTE_INIT(i40e_init_log)
-{
- i40e_logtype_init = rte_log_register("pmd.net.i40e.init");
- if (i40e_logtype_init >= 0)
- rte_log_set_level(i40e_logtype_init, RTE_LOG_NOTICE);
- i40e_logtype_driver = rte_log_register("pmd.net.i40e.driver");
- if (i40e_logtype_driver >= 0)
- rte_log_set_level(i40e_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(i40e_logtype_init, "pmd.net.i40e.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(i40e_logtype_driver, "pmd.net.i40e.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
RTE_PMD_REGISTER_PARAM_STRING(net_i40e,
ETH_I40E_FLOATING_VEB_ARG "=1"
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 8f39073..a176410 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1411,15 +1411,10 @@ static struct rte_pci_driver rte_iavf_pmd = {
RTE_PMD_REGISTER_PCI(net_iavf, rte_iavf_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_iavf, pci_id_iavf_map);
RTE_PMD_REGISTER_KMOD_DEP(net_iavf, "* igb_uio | vfio-pci");
-RTE_INIT(iavf_init_log)
-{
- iavf_logtype_init = rte_log_register("pmd.net.iavf.init");
- if (iavf_logtype_init >= 0)
- rte_log_set_level(iavf_logtype_init, RTE_LOG_NOTICE);
- iavf_logtype_driver = rte_log_register("pmd.net.iavf.driver");
- if (iavf_logtype_driver >= 0)
- rte_log_set_level(iavf_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(iavf_logtype_init, "pmd.net.iavf.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(iavf_logtype_driver, "pmd.net.iavf.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
/* memory func for base code */
enum iavf_status_code
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 44a14cb..a5dd053 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3797,12 +3797,7 @@ RTE_PMD_REGISTER_KMOD_DEP(net_ice, "* igb_uio | uio_pci_generic | vfio-pci");
RTE_PMD_REGISTER_PARAM_STRING(net_ice,
ICE_SAFE_MODE_SUPPORT_ARG "=<0|1>");
-RTE_INIT(ice_init_log)
-{
- ice_logtype_init = rte_log_register("pmd.net.ice.init");
- if (ice_logtype_init >= 0)
- rte_log_set_level(ice_logtype_init, RTE_LOG_NOTICE);
- ice_logtype_driver = rte_log_register("pmd.net.ice.driver");
- if (ice_logtype_driver >= 0)
- rte_log_set_level(ice_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ice_logtype_init, "pmd.net.ice.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(ice_logtype_driver, "pmd.net.ice.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c
index 8de9ef1..95dc25d 100644
--- a/drivers/net/ifc/ifcvf_vdpa.c
+++ b/drivers/net/ifc/ifcvf_vdpa.c
@@ -1262,9 +1262,5 @@ RTE_PMD_REGISTER_PCI(net_ifcvf, rte_ifcvf_vdpa);
RTE_PMD_REGISTER_PCI_TABLE(net_ifcvf, pci_id_ifcvf_map);
RTE_PMD_REGISTER_KMOD_DEP(net_ifcvf, "* vfio-pci");
-RTE_INIT(ifcvf_vdpa_init_log)
-{
- ifcvf_vdpa_logtype = rte_log_register("pmd.net.ifcvf_vdpa");
- if (ifcvf_vdpa_logtype >= 0)
- rte_log_set_level(ifcvf_vdpa_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ifcvf_vdpa_logtype, "pmd.net.ifcvf_vdpa",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c b/drivers/net/ipn3ke/ipn3ke_ethdev.c
index c226d63..59fc690 100644
--- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
+++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
@@ -715,9 +715,5 @@ RTE_PMD_REGISTER_PARAM_STRING(ipn3ke_cfg,
"fpga_acc=<string>"
"i40e_pf=<string>");
-RTE_INIT(ipn3ke_afu_init_log)
-{
- ipn3ke_afu_logtype = rte_log_register("pmd.afu.ipn3ke");
- if (ipn3ke_afu_logtype >= 0)
- rte_log_set_level(ipn3ke_afu_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ipn3ke_afu_logtype, "pmd.afu.ipn3ke",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 03fc1f7..e90de0b 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -8728,12 +8728,7 @@ RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe_vf, "* igb_uio | vfio-pci");
RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf,
IXGBEVF_DEVARG_PFLINK_FULLCHK "=<0|1>");
-RTE_INIT(ixgbe_init_log)
-{
- ixgbe_logtype_init = rte_log_register("pmd.net.ixgbe.init");
- if (ixgbe_logtype_init >= 0)
- rte_log_set_level(ixgbe_logtype_init, RTE_LOG_NOTICE);
- ixgbe_logtype_driver = rte_log_register("pmd.net.ixgbe.driver");
- if (ixgbe_logtype_driver >= 0)
- rte_log_set_level(ixgbe_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ixgbe_logtype_init, "pmd.net.ixgbe.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(ixgbe_logtype_driver, "pmd.net.ixgbe.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index 515c0aa..1f54cb8 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -491,9 +491,5 @@ static struct rte_vdev_driver eth_kni_drv = {
RTE_PMD_REGISTER_VDEV(net_kni, eth_kni_drv);
RTE_PMD_REGISTER_PARAM_STRING(net_kni, ETH_KNI_NO_REQUEST_THREAD_ARG "=<int>");
-RTE_INIT(eth_kni_init_log)
-{
- eth_kni_logtype = rte_log_register("pmd.net.kni");
- if (eth_kni_logtype >= 0)
- rte_log_set_level(eth_kni_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eth_kni_logtype, "pmd.net.kni",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab0..8dcc310 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -2142,12 +2142,7 @@ RTE_PMD_REGISTER_PCI(net_liovf, rte_liovf_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_liovf, pci_id_liovf_map);
RTE_PMD_REGISTER_KMOD_DEP(net_liovf, "* igb_uio | vfio-pci");
-RTE_INIT(lio_init_log)
-{
- lio_logtype_init = rte_log_register("pmd.net.liquidio.init");
- if (lio_logtype_init >= 0)
- rte_log_set_level(lio_logtype_init, RTE_LOG_NOTICE);
- lio_logtype_driver = rte_log_register("pmd.net.liquidio.driver");
- if (lio_logtype_driver >= 0)
- rte_log_set_level(lio_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(lio_logtype_init, "pmd.net.liquidio.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(lio_logtype_driver, "pmd.net.liquidio.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index a59f809..5f4daf8 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1378,9 +1378,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_memif,
int memif_logtype;
-RTE_INIT(memif_init_log)
-{
- memif_logtype = rte_log_register("pmd.net.memif");
- if (memif_logtype >= 0)
- rte_log_set_level(memif_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(memif_logtype, "pmd.net.memif",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 931e4f4..c71b68e 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -1274,16 +1274,14 @@ glue_error:
#endif
+RTE_LOG_REGISTER(mlx4_logtype, "pmd.net.mlx4",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+
/**
* Driver initialization routine.
*/
RTE_INIT(rte_mlx4_pmd_init)
{
- /* Initialize driver log type. */
- mlx4_logtype = rte_log_register("pmd.net.mlx4");
- if (mlx4_logtype >= 0)
- rte_log_set_level(mlx4_logtype, RTE_LOG_NOTICE);
-
/*
* MLX4_DEVICE_FATAL_CLEANUP tells ibv_destroy functions we
* want to get success errno value in case of calling them
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 962c0d5..0ed3e52 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2664,16 +2664,14 @@ glue_error:
#endif
+RTE_LOG_REGISTER(mlx5_logtype, "pmd.net.mlx5",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+
/**
* Driver initialization routine.
*/
RTE_INIT(rte_mlx5_pmd_init)
{
- /* Initialize driver log type. */
- mlx5_logtype = rte_log_register("pmd.net.mlx5");
- if (mlx5_logtype >= 0)
- rte_log_set_level(mlx5_logtype, RTE_LOG_NOTICE);
-
/* Build the static tables for Verbs conversion. */
mlx5_set_ptype_table();
mlx5_set_cksum_table();
diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index a8def8f..9192cc9 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -966,9 +966,5 @@ static struct rte_vdev_driver pmd_mvneta_drv = {
RTE_PMD_REGISTER_VDEV(net_mvneta, pmd_mvneta_drv);
RTE_PMD_REGISTER_PARAM_STRING(net_mvneta, "iface=<ifc>");
-RTE_INIT(mvneta_init_log)
-{
- mvneta_logtype = rte_log_register("pmd.net.mvneta");
- if (mvneta_logtype >= 0)
- rte_log_set_level(mvneta_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(mvneta_logtype, "pmd.net.mvneta",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 810a703..925f577 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -3005,9 +3005,5 @@ static struct rte_vdev_driver pmd_mrvl_drv = {
RTE_PMD_REGISTER_VDEV(net_mvpp2, pmd_mrvl_drv);
RTE_PMD_REGISTER_ALIAS(net_mvpp2, eth_mvpp2);
-RTE_INIT(mrvl_init_log)
-{
- mrvl_logtype = rte_log_register("pmd.net.mvpp2");
- if (mrvl_logtype >= 0)
- rte_log_set_level(mrvl_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(mrvl_logtype, "pmd.net.mvpp2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index 2a90d67..e5214ea 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -1067,12 +1067,7 @@ static struct rte_vmbus_driver rte_netvsc_pmd = {
RTE_PMD_REGISTER_VMBUS(net_netvsc, rte_netvsc_pmd);
RTE_PMD_REGISTER_KMOD_DEP(net_netvsc, "* uio_hv_generic");
-RTE_INIT(hn_init_log)
-{
- hn_logtype_init = rte_log_register("pmd.net.netvsc.init");
- if (hn_logtype_init >= 0)
- rte_log_set_level(hn_logtype_init, RTE_LOG_NOTICE);
- hn_logtype_driver = rte_log_register("pmd.net.netvsc.driver");
- if (hn_logtype_driver >= 0)
- rte_log_set_level(hn_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(hn_logtype_init, "pmd.net.netvsc.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(hn_logtype_driver, "pmd.net.netvsc.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index f1a3ef2..dbb8638 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -3779,15 +3779,10 @@ RTE_PMD_REGISTER_PCI_TABLE(net_nfp_vf, pci_id_nfp_vf_net_map);
RTE_PMD_REGISTER_KMOD_DEP(net_nfp_pf, "* igb_uio | uio_pci_generic | vfio");
RTE_PMD_REGISTER_KMOD_DEP(net_nfp_vf, "* igb_uio | uio_pci_generic | vfio");
-RTE_INIT(nfp_init_log)
-{
- nfp_logtype_init = rte_log_register("pmd.net.nfp.init");
- if (nfp_logtype_init >= 0)
- rte_log_set_level(nfp_logtype_init, RTE_LOG_NOTICE);
- nfp_logtype_driver = rte_log_register("pmd.net.nfp.driver");
- if (nfp_logtype_driver >= 0)
- rte_log_set_level(nfp_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(nfp_logtype_init, "pmd.net.nfp.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(nfp_logtype_driver, "pmd.net.nfp.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
/*
* Local variables:
* c-file-style: "Linux"
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index b2c92ab..6fbf78e 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -690,9 +690,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_null,
"size=<int> "
"copy=<int>");
-RTE_INIT(eth_null_init_log)
-{
- eth_null_logtype = rte_log_register("pmd.net.null");
- if (eth_null_logtype >= 0)
- rte_log_set_level(eth_null_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eth_null_logtype, "pmd.net.null",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index 27eed47..ea0f6af 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -46,20 +46,12 @@ int otx_net_logtype_mbox;
int otx_net_logtype_init;
int otx_net_logtype_driver;
-RTE_INIT(otx_net_init_log)
-{
- otx_net_logtype_mbox = rte_log_register("pmd.net.octeontx.mbox");
- if (otx_net_logtype_mbox >= 0)
- rte_log_set_level(otx_net_logtype_mbox, RTE_LOG_NOTICE);
-
- otx_net_logtype_init = rte_log_register("pmd.net.octeontx.init");
- if (otx_net_logtype_init >= 0)
- rte_log_set_level(otx_net_logtype_init, RTE_LOG_NOTICE);
-
- otx_net_logtype_driver = rte_log_register("pmd.net.octeontx.driver");
- if (otx_net_logtype_driver >= 0)
- rte_log_set_level(otx_net_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx_net_logtype_mbox, "pmd.net.octeontx.mbox",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx_net_logtype_init, "pmd.net.octeontx.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx_net_logtype_driver, "pmd.net.octeontx.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
/* Parse integer from integer argument */
static int
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 95d4b5b..fdf06ae 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -1581,9 +1581,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_pcap,
ETH_PCAP_PHY_MAC_ARG "=<int>"
ETH_PCAP_INFINITE_RX_ARG "=<0|1>");
-RTE_INIT(eth_pcap_init_log)
-{
- eth_pcap_logtype = rte_log_register("pmd.net.pcap");
- if (eth_pcap_logtype >= 0)
- rte_log_set_level(eth_pcap_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eth_pcap_logtype, "pmd.net.pcap",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 528b33e..b795890 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -2768,12 +2768,7 @@ RTE_PMD_REGISTER_PCI(net_qede_vf, rte_qedevf_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_qede_vf, pci_id_qedevf_map);
RTE_PMD_REGISTER_KMOD_DEP(net_qede_vf, "* igb_uio | vfio-pci");
-RTE_INIT(qede_init_log)
-{
- qede_logtype_init = rte_log_register("pmd.net.qede.init");
- if (qede_logtype_init >= 0)
- rte_log_set_level(qede_logtype_init, RTE_LOG_NOTICE);
- qede_logtype_driver = rte_log_register("pmd.net.qede.driver");
- if (qede_logtype_driver >= 0)
- rte_log_set_level(qede_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(qede_logtype_init, "pmd.net.qede.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(qede_logtype_driver, "pmd.net.qede.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 634da63..38596b0 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -696,9 +696,5 @@ RTE_PMD_REGISTER_ALIAS(net_ring, eth_ring);
RTE_PMD_REGISTER_PARAM_STRING(net_ring,
ETH_RING_NUMA_NODE_ACTION_ARG "=name:node:action(ATTACH|CREATE)");
-RTE_INIT(eth_ring_init_log)
-{
- eth_ring_logtype = rte_log_register("pmd.net.ring");
- if (eth_ring_logtype >= 0)
- rte_log_set_level(eth_ring_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eth_ring_logtype, "pmd.net.ring",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index e3ad241..5657345 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -688,13 +688,8 @@ RTE_PMD_REGISTER_PARAM_STRING(net_softnic,
PMD_PARAM_TM_QSIZE12 "=<uint32>"
);
-
-RTE_INIT(pmd_softnic_init_log)
-{
- pmd_softnic_logtype = rte_log_register("pmd.net.softnic");
- if (pmd_softnic_logtype >= 0)
- rte_log_set_level(pmd_softnic_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(pmd_softnic_logtype, "pmd.net.softnic",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
int
rte_pmd_softnic_manage(uint16_t port_id)
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index d5dec1b..80daad1 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -1928,12 +1928,7 @@ RTE_PMD_REGISTER_PCI_TABLE(RTE_SZEDATA2_DRIVER_NAME, rte_szedata2_pci_id_table);
RTE_PMD_REGISTER_KMOD_DEP(RTE_SZEDATA2_DRIVER_NAME,
"* combo6core & combov3 & szedata2 & ( szedata2_cv3 | szedata2_cv3_fdt )");
-RTE_INIT(szedata2_init_log)
-{
- szedata2_logtype_init = rte_log_register("pmd.net.szedata2.init");
- if (szedata2_logtype_init >= 0)
- rte_log_set_level(szedata2_logtype_init, RTE_LOG_NOTICE);
- szedata2_logtype_driver = rte_log_register("pmd.net.szedata2.driver");
- if (szedata2_logtype_driver >= 0)
- rte_log_set_level(szedata2_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(szedata2_logtype_init, "pmd.net.szedata2.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(szedata2_logtype_driver, "pmd.net.szedata2.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 64bd049..a837129 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -2388,9 +2388,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_tap,
ETH_TAP_REMOTE_ARG "=<string>");
int tap_logtype;
-RTE_INIT(tap_init_log)
-{
- tap_logtype = rte_log_register("pmd.net.tap");
- if (tap_logtype >= 0)
- rte_log_set_level(tap_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(tap_logtype, "pmd.net.tap",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 56769ef..c1363ed 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -55,20 +55,12 @@ static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic,
static int nicvf_vlan_offload_config(struct rte_eth_dev *dev, int mask);
static int nicvf_vlan_offload_set(struct rte_eth_dev *dev, int mask);
-RTE_INIT(nicvf_init_log)
-{
- nicvf_logtype_mbox = rte_log_register("pmd.net.thunderx.mbox");
- if (nicvf_logtype_mbox >= 0)
- rte_log_set_level(nicvf_logtype_mbox, RTE_LOG_NOTICE);
-
- nicvf_logtype_init = rte_log_register("pmd.net.thunderx.init");
- if (nicvf_logtype_init >= 0)
- rte_log_set_level(nicvf_logtype_init, RTE_LOG_NOTICE);
-
- nicvf_logtype_driver = rte_log_register("pmd.net.thunderx.driver");
- if (nicvf_logtype_driver >= 0)
- rte_log_set_level(nicvf_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(nicvf_logtype_mbox, "pmd.net.thunderx.mbox",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(nicvf_logtype_init, "pmd.net.thunderx.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(nicvf_logtype_driver, "pmd.net.thunderx.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
static void
nicvf_link_status_update(struct nicvf *nic,
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index be8f19c..612086c 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -775,13 +775,8 @@ RTE_PMD_REGISTER_PARAM_STRING(net_vdev_netvsc,
VDEV_NETVSC_ARG_FORCE "=<int> "
VDEV_NETVSC_ARG_IGNORE "=<int>");
-/** Initialize driver log type. */
-RTE_INIT(vdev_netvsc_init_log)
-{
- vdev_netvsc_logtype = rte_log_register("pmd.net.vdev_netvsc");
- if (vdev_netvsc_logtype >= 0)
- rte_log_set_level(vdev_netvsc_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vdev_netvsc_logtype, "pmd.net.vdev_netvsc",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
/** Compare function for vdev find device operation. */
static int
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index a4892d7..77f8997 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -1468,9 +1468,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_vhost,
"iommu-support=<0|1> "
"postcopy-support=<0|1>");
-RTE_INIT(vhost_init_log)
-{
- vhost_logtype = rte_log_register("pmd.net.vhost");
- if (vhost_logtype >= 0)
- rte_log_set_level(vhost_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vhost_logtype, "pmd.net.vhost",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index f96588b..eb4d6f1 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2453,12 +2453,7 @@ RTE_PMD_EXPORT_NAME(net_virtio, __COUNTER__);
RTE_PMD_REGISTER_PCI_TABLE(net_virtio, pci_id_virtio_map);
RTE_PMD_REGISTER_KMOD_DEP(net_virtio, "* igb_uio | uio_pci_generic | vfio-pci");
-RTE_INIT(virtio_init_log)
-{
- virtio_logtype_init = rte_log_register("pmd.net.virtio.init");
- if (virtio_logtype_init >= 0)
- rte_log_set_level(virtio_logtype_init, RTE_LOG_NOTICE);
- virtio_logtype_driver = rte_log_register("pmd.net.virtio.driver");
- if (virtio_logtype_driver >= 0)
- rte_log_set_level(virtio_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(virtio_logtype_init, "pmd.net.virtio.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(virtio_logtype_driver, "pmd.net.virtio.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 57feb37..8dc39fd 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1434,12 +1434,7 @@ RTE_PMD_REGISTER_PCI(net_vmxnet3, rte_vmxnet3_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_vmxnet3, pci_id_vmxnet3_map);
RTE_PMD_REGISTER_KMOD_DEP(net_vmxnet3, "* igb_uio | uio_pci_generic | vfio-pci");
-RTE_INIT(vmxnet3_init_log)
-{
- vmxnet3_logtype_init = rte_log_register("pmd.net.vmxnet3.init");
- if (vmxnet3_logtype_init >= 0)
- rte_log_set_level(vmxnet3_logtype_init, RTE_LOG_NOTICE);
- vmxnet3_logtype_driver = rte_log_register("pmd.net.vmxnet3.driver");
- if (vmxnet3_logtype_driver >= 0)
- rte_log_set_level(vmxnet3_logtype_driver, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vmxnet3_logtype_init, "pmd.net.vmxnet3.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(vmxnet3_logtype_driver, "pmd.net.vmxnet3.driver",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 11/11] drivers/raw: use new logtype wrapper
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
` (9 preceding siblings ...)
2019-08-19 11:41 ` [dpdk-dev] [PATCH 10/11] drivers/net: " David Marchand
@ 2019-08-19 11:41 ` David Marchand
2019-09-02 14:17 ` [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers Ferruh Yigit
11 siblings, 0 replies; 32+ messages in thread
From: David Marchand @ 2019-08-19 11:41 UTC (permalink / raw)
To: dev
Cc: Nipun Gupta, Rosen Xu, Tianfei zhang, Bruce Richardson,
Xiaoyun Li, Jingjing Wu, Shreyansh Jain, Hemant Agrawal
Make use of the newly introduced wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 8 ++------
drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 8 ++------
drivers/raw/ifpga/ifpga_rawdev.c | 8 ++------
drivers/raw/ioat/ioat_rawdev.c | 8 ++------
drivers/raw/ntb/ntb.c | 8 ++------
drivers/raw/skeleton/skeleton_rawdev.c | 8 ++------
6 files changed, 12 insertions(+), 36 deletions(-)
diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
index 3f42da1..ff02855 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
@@ -283,9 +283,5 @@ static struct rte_vdev_driver dpaa2_cmdif_drv = {
RTE_PMD_REGISTER_VDEV(DPAA2_CMDIF_PMD_NAME, dpaa2_cmdif_drv);
-RTE_INIT(dpaa2_cmdif_init_log)
-{
- dpaa2_cmdif_logtype = rte_log_register("pmd.raw.dpaa2.cmdif");
- if (dpaa2_cmdif_logtype >= 0)
- rte_log_set_level(dpaa2_cmdif_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(dpaa2_cmdif_logtype, "pmd.raw.dpaa2.cmdif",
+ RTE_LOG_INFO, RTE_LOGTYPE_PMD);
diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
index a391913..6af7c14 100644
--- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
+++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
@@ -1345,9 +1345,5 @@ RTE_PMD_REGISTER_DPAA2(dpaa2_qdma, rte_dpaa2_qdma_pmd);
RTE_PMD_REGISTER_PARAM_STRING(dpaa2_qdma,
"no_prefetch=<int> ");
-RTE_INIT(dpaa2_qdma_init_log)
-{
- dpaa2_qdma_logtype = rte_log_register("pmd.raw.dpaa2.qdma");
- if (dpaa2_qdma_logtype >= 0)
- rte_log_set_level(dpaa2_qdma_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(dpaa2_qdma_logtype, "pmd.raw.dpaa2.qdma",
+ RTE_LOG_INFO, RTE_LOGTYPE_PMD);
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index fef89e6..dc2f3c1 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -757,12 +757,8 @@ RTE_PMD_REGISTER_PCI(ifpga_rawdev_pci_driver, rte_ifpga_rawdev_pmd);
RTE_PMD_REGISTER_PCI_TABLE(ifpga_rawdev_pci_driver, rte_ifpga_rawdev_pmd);
RTE_PMD_REGISTER_KMOD_DEP(ifpga_rawdev_pci_driver, "* igb_uio | uio_pci_generic | vfio-pci");
-RTE_INIT(ifpga_rawdev_init_log)
-{
- ifpga_rawdev_logtype = rte_log_register("driver.raw.init");
- if (ifpga_rawdev_logtype >= 0)
- rte_log_set_level(ifpga_rawdev_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ifpga_rawdev_logtype, "pmd.rawdev.ifpga.init",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
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 7270ad7..023eb0e 100644
--- a/drivers/raw/ioat/ioat_rawdev.c
+++ b/drivers/raw/ioat/ioat_rawdev.c
@@ -347,9 +347,5 @@ RTE_PMD_REGISTER_PCI(IOAT_PMD_RAWDEV_NAME, ioat_pmd_drv);
RTE_PMD_REGISTER_PCI_TABLE(IOAT_PMD_RAWDEV_NAME, pci_id_ioat_map);
RTE_PMD_REGISTER_KMOD_DEP(IOAT_PMD_RAWDEV_NAME, "* igb_uio | uio_pci_generic");
-RTE_INIT(ioat_pmd_init_log)
-{
- ioat_pmd_logtype = rte_log_register(IOAT_PMD_LOG_NAME);
- if (ioat_pmd_logtype >= 0)
- rte_log_set_level(ioat_pmd_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(ioat_pmd_logtype, IOAT_PMD_LOG_NAME,
+ RTE_LOG_INFO, RTE_LOGTYPE_PMD);
diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c
index bfecce1..e5e07a7 100644
--- a/drivers/raw/ntb/ntb.c
+++ b/drivers/raw/ntb/ntb.c
@@ -835,9 +835,5 @@ RTE_PMD_REGISTER_PCI(raw_ntb, rte_ntb_pmd);
RTE_PMD_REGISTER_PCI_TABLE(raw_ntb, pci_id_ntb_map);
RTE_PMD_REGISTER_KMOD_DEP(raw_ntb, "* igb_uio | uio_pci_generic | vfio-pci");
-RTE_INIT(ntb_init_log)
-{
- ntb_logtype = rte_log_register("pmd.raw.ntb");
- if (ntb_logtype >= 0)
- rte_log_set_level(ntb_logtype, RTE_LOG_DEBUG);
-}
+RTE_LOG_REGISTER(ntb_logtype, "pmd.raw.ntb",
+ RTE_LOG_DEBUG, RTE_LOGTYPE_PMD);
diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index 586183a..69c2bba 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -760,9 +760,5 @@ static struct rte_vdev_driver skeleton_pmd_drv = {
RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME, skeleton_pmd_drv);
-RTE_INIT(skeleton_pmd_init_log)
-{
- skeleton_pmd_logtype = rte_log_register("rawdev.skeleton");
- if (skeleton_pmd_logtype >= 0)
- rte_log_set_level(skeleton_pmd_logtype, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER(skeleton_pmd_logtype, "pmd.rawdev.skeleton",
+ RTE_LOG_INFO, RTE_LOGTYPE_PMD);
--
1.8.3.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-08-19 11:41 ` [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers David Marchand
@ 2019-08-19 12:27 ` Andrew Rybchenko
2019-09-02 14:29 ` Ferruh Yigit
1 sibling, 0 replies; 32+ messages in thread
From: Andrew Rybchenko @ 2019-08-19 12:27 UTC (permalink / raw)
To: David Marchand, dev
On 8/19/19 2:41 PM, David Marchand wrote:
> The function rte_log_register_type_and_pick_level() fills a gap for
> dynamically loaded code (especially drivers) who would not pick up
> the log level passed at startup.
>
> Let's promote it to stable and export it for use by drivers via
> a wrapper.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 01/11] log: fix plugin level restore with patterns
2019-08-19 11:41 ` [dpdk-dev] [PATCH 01/11] log: fix plugin level restore with patterns David Marchand
@ 2019-08-19 12:30 ` Andrew Rybchenko
0 siblings, 0 replies; 32+ messages in thread
From: Andrew Rybchenko @ 2019-08-19 12:30 UTC (permalink / raw)
To: David Marchand, dev; +Cc: stable
On 8/19/19 2:41 PM, David Marchand wrote:
> Same fix as the commit 6ff0f81d0ef7 ("log: fix pattern matching"),
> fnmatch returns 0 on success.
>
> Fixes: 7f0bb634a140 ("log: add ability to match log type with globbing")
> Fixes: 6ff0f81d0ef7 ("log: fix pattern matching")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 10/11] drivers/net: use new logtype wrapper
2019-08-19 11:41 ` [dpdk-dev] [PATCH 10/11] drivers/net: " David Marchand
@ 2019-08-19 14:55 ` Legacy, Allain
2019-09-02 16:11 ` Ferruh Yigit
1 sibling, 0 replies; 32+ messages in thread
From: Legacy, Allain @ 2019-08-19 14:55 UTC (permalink / raw)
To: David Marchand, dev
> -----Original Message-----
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Monday, August 19, 2019 7:42 AM
> To: dev@dpdk.org
> Cc: John W. Linville; Xiaolong Ye; Qi Zhang; Igor Russkikh; Pavel Belous;
> Legacy, Allain; Peters, Matt; Ravi Kumar; Rasesh Mody; Shahed Shaikh; Ajit
> Khaparde; Somnath Kotur; Chas Williams; Hemant Agrawal; Sachin Saxena;
> Wenzhuo Lu; Marcin Wojtas; Michal Krawczyk; Guy Tzalik; Evgeny Schemeilin;
> Gagandeep Singh; John Daley; Hyong Youb Kim; Gaetan Rivet; Xiao Wang;
> Ziyang Xuan; Xiaoyun Wang; Guoyang Zhou; Beilei Xing; Jingjing Wu; Qiming
> Yang; Rosen Xu; Konstantin Ananyev; Ferruh Yigit; Shijith Thotton;
> Srisivasubramanian Srinivasan; Jakub Grajciar; Matan Azrad; Shahaf Shuler;
> Yongseok Koh; Viacheslav Ovsiienko; Zyta Szpak; Liron Himi; Tomasz
> Duszynski; Stephen Hemminger; K. Y. Srinivasan; Haiyang Zhang; Alejandro
> Lucero; Tetsuya Mukawa; Jerin Jacob; Bruce Richardson; Jasvinder Singh;
> Cristian Dumitrescu; Jan Remes; Rastislav Cernay; Keith Wiles; Maciej Czekaj;
> Maxime Coquelin; Tiwei Bie; Zhihong Wang; Yong Wang
> Subject: [PATCH 10/11] drivers/net: use new logtype wrapper
>
> Make use of the newly introduced wrapper.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
<...>
> drivers/net/avp/avp_ethdev.c | 8 ++------
<...>
> 47 files changed, 133 insertions(+), 354 deletions(-)
Acked-by: Allain Legacy <allain.legacy@windriver.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 03/11] drivers/baseband: use new logtype wrapper
2019-08-19 11:41 ` [dpdk-dev] [PATCH 03/11] drivers/baseband: use new logtype wrapper David Marchand
@ 2019-08-19 15:39 ` Chautru, Nicolas
0 siblings, 0 replies; 32+ messages in thread
From: Chautru, Nicolas @ 2019-08-19 15:39 UTC (permalink / raw)
To: David Marchand, dev
On 8/19/19, David Marchand wrote:
> Make use of the newly introduced wrapper.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
` (10 preceding siblings ...)
2019-08-19 11:41 ` [dpdk-dev] [PATCH 11/11] drivers/raw: " David Marchand
@ 2019-09-02 14:17 ` Ferruh Yigit
2019-09-03 8:06 ` David Marchand
11 siblings, 1 reply; 32+ messages in thread
From: Ferruh Yigit @ 2019-09-02 14:17 UTC (permalink / raw)
To: David Marchand, dev
On 8/19/2019 12:41 PM, David Marchand wrote:
> All (but the Solarflare net driver) drivers currently do not care about
> the log level the user might have passed at init time.
Is this comment for the shared libraries?
Because otherwise drivers set loglevel during initialization and init time
setting should be reflected to the logtypes before devices probed.
>
> Convert existing drivers from rte_log_register to a new wrapper
> RTE_LOG_REGISTER that relies on rte_log_register_type_and_pick_level
> that handles this issue.
>
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-08-19 11:41 ` [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers David Marchand
2019-08-19 12:27 ` Andrew Rybchenko
@ 2019-09-02 14:29 ` Ferruh Yigit
2019-09-03 8:06 ` David Marchand
1 sibling, 1 reply; 32+ messages in thread
From: Ferruh Yigit @ 2019-09-02 14:29 UTC (permalink / raw)
To: David Marchand, dev
On 8/19/2019 12:41 PM, David Marchand wrote:
> The function rte_log_register_type_and_pick_level() fills a gap for
> dynamically loaded code (especially drivers) who would not pick up
> the log level passed at startup.
>
> Let's promote it to stable and export it for use by drivers via
> a wrapper.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> lib/librte_eal/common/include/rte_log.h | 12 ++++++++----
> lib/librte_eal/rte_eal_version.map | 8 +++++++-
> 2 files changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
> index cbb4184..c3aff00 100644
> --- a/lib/librte_eal/common/include/rte_log.h
> +++ b/lib/librte_eal/common/include/rte_log.h
> @@ -209,9 +209,6 @@ int rte_log_cur_msg_logtype(void);
> int rte_log_register(const char *name);
>
> /**
> - * @warning
> - * @b EXPERIMENTAL: this API may change without prior notice
> - *
> * Register a dynamic log type and try to pick its level from EAL options
> *
> * rte_log_register() is called inside. If successful, the function tries
> @@ -227,9 +224,16 @@ int rte_log_register(const char *name);
> * - >=0: the newly registered log type
> * - <0: rte_log_register() error value
> */
> -__rte_experimental
> int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
+1 to remove experimental from the API.
>
> +#define RTE_LOG_REGISTER(token, name, level, fallback) \
> +RTE_INIT(token##_init) \
Does it still need to be an init time call?
Since it is dynamic now it can be during probe, even log name can be a paramter
to the "struct rte_driver" and log can be registered automatically during probe,
not sure how complex it becomes.
> +{ \
> + token = rte_log_register_type_and_pick_level(name, level); \
> + if (token < 0) \
The failure can be because component can try to register existing log name, or
there is no enough memory, do you think does it worth to do log, or some
additional work if component is trying to register existing log name?
> + token = fallback; \
Does the 'fallback' needs to be provided by user, it looks like everyone will
just copy/paste 'RTE_LOGTYPE_PMD' for drivers, and does it really needs to be
configurable since it is fallback.
Why not provide a hardcoded type for the failure case? And for that case perhaps
create a more generic logtype, something like "RTE_LOGTYPE_FALLBACK" so that it
can be as it is from all components?
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 10/11] drivers/net: use new logtype wrapper
2019-08-19 11:41 ` [dpdk-dev] [PATCH 10/11] drivers/net: " David Marchand
2019-08-19 14:55 ` Legacy, Allain
@ 2019-09-02 16:11 ` Ferruh Yigit
2019-09-03 8:06 ` David Marchand
1 sibling, 1 reply; 32+ messages in thread
From: Ferruh Yigit @ 2019-09-02 16:11 UTC (permalink / raw)
To: David Marchand, dev
Cc: John W. Linville, Xiaolong Ye, Qi Zhang, Igor Russkikh,
Pavel Belous, Allain Legacy, Matt Peters, Ravi Kumar,
Rasesh Mody, Shahed Shaikh, Ajit Khaparde, Somnath Kotur,
Chas Williams, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
Marcin Wojtas, Michal Krawczyk, Guy Tzalik, Evgeny Schemeilin,
Gagandeep Singh, John Daley, Hyong Youb Kim, Gaetan Rivet,
Xiao Wang, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
Jingjing Wu, Qiming Yang, Rosen Xu, Konstantin Ananyev,
Shijith Thotton, Srisivasubramanian Srinivasan, Jakub Grajciar,
Matan Azrad, Shahaf Shuler, Yongseok Koh, Viacheslav Ovsiienko,
Zyta Szpak, Liron Himi, Tomasz Duszynski, Stephen Hemminger,
K. Y. Srinivasan, Haiyang Zhang, Alejandro Lucero,
Tetsuya Mukawa, Jerin Jacob, Bruce Richardson, Jasvinder Singh,
Cristian Dumitrescu, Jan Remes, Rastislav Cernay, Keith Wiles,
Maciej Czekaj, Maxime Coquelin, Tiwei Bie, Zhihong Wang,
Yong Wang
On 8/19/2019 12:41 PM, David Marchand wrote:
> Make use of the newly introduced wrapper.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
<...>
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> index 931e4f4..c71b68e 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -1274,16 +1274,14 @@ glue_error:
>
> #endif
>
> +RTE_LOG_REGISTER(mlx4_logtype, "pmd.net.mlx4",
> + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
> +
btw, compiler is complaining about the ';' for mlx4/5 because of the pedantic
parameter:
error: ISO C does not allow extra ‘;’ outside of a function [-Werror=pedantic]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers
2019-09-02 14:17 ` [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers Ferruh Yigit
@ 2019-09-03 8:06 ` David Marchand
0 siblings, 0 replies; 32+ messages in thread
From: David Marchand @ 2019-09-03 8:06 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
On Mon, Sep 2, 2019 at 4:17 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 8/19/2019 12:41 PM, David Marchand wrote:
> > All (but the Solarflare net driver) drivers currently do not care about
> > the log level the user might have passed at init time.
>
> Is this comment for the shared libraries?
> Because otherwise drivers set loglevel during initialization and init time
> setting should be reflected to the logtypes before devices probed.
Indeed, the issue is seen when building drivers as shared libraries.
--
David Marchand
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-09-02 14:29 ` Ferruh Yigit
@ 2019-09-03 8:06 ` David Marchand
2019-09-03 8:47 ` Ferruh Yigit
0 siblings, 1 reply; 32+ messages in thread
From: David Marchand @ 2019-09-03 8:06 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
On Mon, Sep 2, 2019 at 4:29 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 8/19/2019 12:41 PM, David Marchand wrote:
> > The function rte_log_register_type_and_pick_level() fills a gap for
> > dynamically loaded code (especially drivers) who would not pick up
> > the log level passed at startup.
> >
> > Let's promote it to stable and export it for use by drivers via
> > a wrapper.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> > lib/librte_eal/common/include/rte_log.h | 12 ++++++++----
> > lib/librte_eal/rte_eal_version.map | 8 +++++++-
> > 2 files changed, 15 insertions(+), 5 deletions(-)
> >
> > diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
> > index cbb4184..c3aff00 100644
> > --- a/lib/librte_eal/common/include/rte_log.h
> > +++ b/lib/librte_eal/common/include/rte_log.h
> > @@ -209,9 +209,6 @@ int rte_log_cur_msg_logtype(void);
> > int rte_log_register(const char *name);
> >
> > /**
> > - * @warning
> > - * @b EXPERIMENTAL: this API may change without prior notice
> > - *
> > * Register a dynamic log type and try to pick its level from EAL options
> > *
> > * rte_log_register() is called inside. If successful, the function tries
> > @@ -227,9 +224,16 @@ int rte_log_register(const char *name);
> > * - >=0: the newly registered log type
> > * - <0: rte_log_register() error value
> > */
> > -__rte_experimental
> > int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
>
> +1 to remove experimental from the API.
>
> >
> > +#define RTE_LOG_REGISTER(token, name, level, fallback) \
> > +RTE_INIT(token##_init) \
>
> Does it still need to be an init time call?
> Since it is dynamic now it can be during probe, even log name can be a paramter
> to the "struct rte_driver" and log can be registered automatically during probe,
> not sure how complex it becomes.
This would not work with non driver components built as shared
libraries (unless they have an explicit init symbol in the dpdk init
flow).
The drivers can register multiple log types so this would have to be handled.
We would touch the struct rte_driver which is embedded in other
objects like rte_pci_driver, breaking the abi.
>
> > +{ \
> > + token = rte_log_register_type_and_pick_level(name, level); \
> > + if (token < 0) \
>
> The failure can be because component can try to register existing log name, or
> there is no enough memory, do you think does it worth to do log, or some
> additional work if component is trying to register existing log name?
Yes, I can raise a warning log (using RTE_LOGTYPE_EAL type), since
duplicates are not supposed to happen.
>
> > + token = fallback; \
>
> Does the 'fallback' needs to be provided by user, it looks like everyone will
> just copy/paste 'RTE_LOGTYPE_PMD' for drivers, and does it really needs to be
> configurable since it is fallback.
This series only touches drivers, but I expected other components
would use this macro later.
I can add a RTE_PMD_REGISTER_LOG macro that hides the RTE_LOGTYPE_PMD
fallback value.
>
> Why not provide a hardcoded type for the failure case? And for that case perhaps
> create a more generic logtype, something like "RTE_LOGTYPE_FALLBACK" so that it
> can be as it is from all components?
>
I prefer to map all drivers to a logtype that means something, like
RTE_LOGTYPE_PMD.
Having a "fallback" could be used for all components, but this would
have to be a static logtype and adding one is not possible without
breaking the abi (static entries are < 32 and all values are used).
--
David Marchand
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 10/11] drivers/net: use new logtype wrapper
2019-09-02 16:11 ` Ferruh Yigit
@ 2019-09-03 8:06 ` David Marchand
2019-09-03 15:03 ` Stephen Hemminger
0 siblings, 1 reply; 32+ messages in thread
From: David Marchand @ 2019-09-03 8:06 UTC (permalink / raw)
To: Ferruh Yigit
Cc: dev, John W. Linville, Xiaolong Ye, Qi Zhang, Igor Russkikh,
Pavel Belous, Allain Legacy, Matt Peters, Ravi Kumar,
Rasesh Mody, Shahed Shaikh, Ajit Khaparde, Somnath Kotur,
Chas Williams, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
Marcin Wojtas, Michal Krawczyk, Guy Tzalik, Evgeny Schemeilin,
Gagandeep Singh, John Daley, Hyong Youb Kim, Gaetan Rivet,
Xiao Wang, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
Jingjing Wu, Qiming Yang, Rosen Xu, Konstantin Ananyev,
Shijith Thotton, Srisivasubramanian Srinivasan, Jakub Grajciar,
Matan Azrad, Shahaf Shuler, Yongseok Koh, Viacheslav Ovsiienko,
Zyta Szpak, Liron Himi, Tomasz Duszynski, Stephen Hemminger,
K. Y. Srinivasan, Haiyang Zhang, Alejandro Lucero,
Tetsuya Mukawa, Jerin Jacob, Bruce Richardson, Jasvinder Singh,
Cristian Dumitrescu, Jan Remes, Rastislav Cernay, Keith Wiles,
Maciej Czekaj, Maxime Coquelin, Tiwei Bie, Zhihong Wang,
Yong Wang
On Mon, Sep 2, 2019 at 6:11 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 8/19/2019 12:41 PM, David Marchand wrote:
> > Make use of the newly introduced wrapper.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
>
> <...>
>
> > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> > index 931e4f4..c71b68e 100644
> > --- a/drivers/net/mlx4/mlx4.c
> > +++ b/drivers/net/mlx4/mlx4.c
> > @@ -1274,16 +1274,14 @@ glue_error:
> >
> > #endif
> >
> > +RTE_LOG_REGISTER(mlx4_logtype, "pmd.net.mlx4",
> > + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
> > +
>
> btw, compiler is complaining about the ';' for mlx4/5 because of the pedantic
> parameter:
>
> error: ISO C does not allow extra ‘;’ outside of a function [-Werror=pedantic]
>
Oops, I thought I had fixed it before sending the series.. thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-09-03 8:06 ` David Marchand
@ 2019-09-03 8:47 ` Ferruh Yigit
2019-09-04 17:45 ` Thomas Monjalon
0 siblings, 1 reply; 32+ messages in thread
From: Ferruh Yigit @ 2019-09-03 8:47 UTC (permalink / raw)
To: David Marchand; +Cc: dev
On 9/3/2019 9:06 AM, David Marchand wrote:
> On Mon, Sep 2, 2019 at 4:29 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>> On 8/19/2019 12:41 PM, David Marchand wrote:
>>> The function rte_log_register_type_and_pick_level() fills a gap for
>>> dynamically loaded code (especially drivers) who would not pick up
>>> the log level passed at startup.
>>>
>>> Let's promote it to stable and export it for use by drivers via
>>> a wrapper.
>>>
>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>>> ---
>>> lib/librte_eal/common/include/rte_log.h | 12 ++++++++----
>>> lib/librte_eal/rte_eal_version.map | 8 +++++++-
>>> 2 files changed, 15 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
>>> index cbb4184..c3aff00 100644
>>> --- a/lib/librte_eal/common/include/rte_log.h
>>> +++ b/lib/librte_eal/common/include/rte_log.h
>>> @@ -209,9 +209,6 @@ int rte_log_cur_msg_logtype(void);
>>> int rte_log_register(const char *name);
>>>
>>> /**
>>> - * @warning
>>> - * @b EXPERIMENTAL: this API may change without prior notice
>>> - *
>>> * Register a dynamic log type and try to pick its level from EAL options
>>> *
>>> * rte_log_register() is called inside. If successful, the function tries
>>> @@ -227,9 +224,16 @@ int rte_log_register(const char *name);
>>> * - >=0: the newly registered log type
>>> * - <0: rte_log_register() error value
>>> */
>>> -__rte_experimental
>>> int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
>>
>> +1 to remove experimental from the API.
>>
>>>
>>> +#define RTE_LOG_REGISTER(token, name, level, fallback) \
>>> +RTE_INIT(token##_init) \
>>
>> Does it still need to be an init time call?
>> Since it is dynamic now it can be during probe, even log name can be a paramter
>> to the "struct rte_driver" and log can be registered automatically during probe,
>> not sure how complex it becomes.
>
> This would not work with non driver components built as shared
> libraries (unless they have an explicit init symbol in the dpdk init
> flow).
Right.
>
> The drivers can register multiple log types so this would have to be handled.
> We would touch the struct rte_driver which is embedded in other
> objects like rte_pci_driver, breaking the abi.
Yes they may require multiple logs, +abi break, so forget about it.
>
>
>>
>>> +{ \
>>> + token = rte_log_register_type_and_pick_level(name, level); \
>>> + if (token < 0) \
>>
>> The failure can be because component can try to register existing log name, or
>> there is no enough memory, do you think does it worth to do log, or some
>> additional work if component is trying to register existing log name?
>
> Yes, I can raise a warning log (using RTE_LOGTYPE_EAL type), since
> duplicates are not supposed to happen.
I was checking if we can detect the error from duplication, there can be a
defect it that logic:
Call trace is:
rte_log_register_type_and_pick_level
type = rte_log_register(name);
id = rte_log_lookup(name);
if (id >= 0)
return id
if (type < 0)
return type
"type > 0" for the duplication case but error check only checks if "type < 0"
>
>
>>
>>> + token = fallback; \
>>
>> Does the 'fallback' needs to be provided by user, it looks like everyone will
>> just copy/paste 'RTE_LOGTYPE_PMD' for drivers, and does it really needs to be
>> configurable since it is fallback.
>
> This series only touches drivers, but I expected other components
> would use this macro later.
> I can add a RTE_PMD_REGISTER_LOG macro that hides the RTE_LOGTYPE_PMD
> fallback value.
>
>
>>
>> Why not provide a hardcoded type for the failure case? And for that case perhaps
>> create a more generic logtype, something like "RTE_LOGTYPE_FALLBACK" so that it
>> can be as it is from all components?
>>
>
> I prefer to map all drivers to a logtype that means something, like
> RTE_LOGTYPE_PMD.
In that manner it make sense agreed, but previously drivers were using
'RTE_LOGTYPE_PMD' instead of having their own log types, Stephen did some work
to replace the 'RTE_LOGTYPE_PMD' so that it can be deprecated,
starting to use it again as fallback may lead drivers using it again as log type
in their drivers, may they wouldn't but this is what I concern. Something with
name 'RTE_LOGTYPE_FALLBACK' clear to not use as default logtype in drivers.
>
> Having a "fallback" could be used for all components, but this would
> have to be a static logtype and adding one is not possible without
> breaking the abi (static entries are < 32 and all values are used).
There is a gap between 'RTE_LOGTYPE_GSO' & 'RTE_LOGTYPE_USER1' ...
>
>
> --
> David Marchand
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 10/11] drivers/net: use new logtype wrapper
2019-09-03 8:06 ` David Marchand
@ 2019-09-03 15:03 ` Stephen Hemminger
0 siblings, 0 replies; 32+ messages in thread
From: Stephen Hemminger @ 2019-09-03 15:03 UTC (permalink / raw)
To: David Marchand
Cc: Ferruh Yigit, dev, John W. Linville, Xiaolong Ye, Qi Zhang,
Igor Russkikh, Pavel Belous, Allain Legacy, Matt Peters,
Ravi Kumar, Rasesh Mody, Shahed Shaikh, Ajit Khaparde,
Somnath Kotur, Chas Williams, Hemant Agrawal, Sachin Saxena,
Wenzhuo Lu, Marcin Wojtas, Michal Krawczyk, Guy Tzalik,
Evgeny Schemeilin, Gagandeep Singh, John Daley, Hyong Youb Kim,
Gaetan Rivet, Xiao Wang, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou,
Beilei Xing, Jingjing Wu, Qiming Yang, Rosen Xu,
Konstantin Ananyev, Shijith Thotton,
Srisivasubramanian Srinivasan, Jakub Grajciar, Matan Azrad,
Shahaf Shuler, Yongseok Koh, Viacheslav Ovsiienko, Zyta Szpak,
Liron Himi, Tomasz Duszynski, Stephen Hemminger,
K. Y. Srinivasan, Haiyang Zhang, Alejandro Lucero,
Tetsuya Mukawa, Jerin Jacob, Bruce Richardson, Jasvinder Singh,
Cristian Dumitrescu, Jan Remes, Rastislav Cernay, Keith Wiles,
Maciej Czekaj, Maxime Coquelin, Tiwei Bie, Zhihong Wang,
Yong Wang
On Tue, 3 Sep 2019 10:06:30 +0200
David Marchand <david.marchand@redhat.com> wrote:
> On Mon, Sep 2, 2019 at 6:11 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> >
> > On 8/19/2019 12:41 PM, David Marchand wrote:
> > > Make use of the newly introduced wrapper.
> > >
> > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> >
> > <...>
> >
> > > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> > > index 931e4f4..c71b68e 100644
> > > --- a/drivers/net/mlx4/mlx4.c
> > > +++ b/drivers/net/mlx4/mlx4.c
> > > @@ -1274,16 +1274,14 @@ glue_error:
> > >
> > > #endif
> > >
> > > +RTE_LOG_REGISTER(mlx4_logtype, "pmd.net.mlx4",
> > > + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
> > > +
> >
> > btw, compiler is complaining about the ';' for mlx4/5 because of the pedantic
> > parameter:
> >
> > error: ISO C does not allow extra ‘;’ outside of a function [-Werror=pedantic]
> >
>
> Oops, I thought I had fixed it before sending the series.. thanks.
Yeas, please remove ; after all RTE_LOG_REGISTER macro usage.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-09-03 8:47 ` Ferruh Yigit
@ 2019-09-04 17:45 ` Thomas Monjalon
2019-09-04 19:21 ` Andrew Rybchenko
0 siblings, 1 reply; 32+ messages in thread
From: Thomas Monjalon @ 2019-09-04 17:45 UTC (permalink / raw)
To: Ferruh Yigit, David Marchand; +Cc: dev
03/09/2019 10:47, Ferruh Yigit:
> On 9/3/2019 9:06 AM, David Marchand wrote:
> > On Mon, Sep 2, 2019 at 4:29 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> >> On 8/19/2019 12:41 PM, David Marchand wrote:
> >>> The function rte_log_register_type_and_pick_level() fills a gap for
> >>> dynamically loaded code (especially drivers) who would not pick up
> >>> the log level passed at startup.
> >>>
> >>> Let's promote it to stable and export it for use by drivers via
> >>> a wrapper.
> >>>
> >>> Signed-off-by: David Marchand <david.marchand@redhat.com>
> >>> ---
[...]
> >>> /**
> >>> - * @warning
> >>> - * @b EXPERIMENTAL: this API may change without prior notice
> >>> - *
> >>> * Register a dynamic log type and try to pick its level from EAL options
[...]
> >>> -__rte_experimental
> >>> int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
> >>
> >> +1 to remove experimental from the API.
I am not sure about this function API.
Why we combined register and level setting in one function?
> >>> +#define RTE_LOG_REGISTER(token, name, level, fallback) \
You really need to document this macro with doxygen.
> >>> +{ \
> >>> + token = rte_log_register_type_and_pick_level(name, level); \
> >>> + if (token < 0) \
> >>
> >> The failure can be because component can try to register existing log name, or
> >> there is no enough memory, do you think does it worth to do log, or some
> >> additional work if component is trying to register existing log name?
[...]
> >>> + token = fallback; \
> >>
> >> Does the 'fallback' needs to be provided by user, it looks like everyone will
> >> just copy/paste 'RTE_LOGTYPE_PMD' for drivers, and does it really needs to be
> >> configurable since it is fallback.
> >
> > This series only touches drivers, but I expected other components
> > would use this macro later.
> > I can add a RTE_PMD_REGISTER_LOG macro that hides the RTE_LOGTYPE_PMD
> > fallback value.
I agree we don't need to configure the fallback log.
If there is an error during log setup,
we can log everything next (at debug level).
Let's make fallback hardcoded.
> >> Why not provide a hardcoded type for the failure case? And for that case perhaps
> >> create a more generic logtype, something like "RTE_LOGTYPE_FALLBACK" so that it
> >> can be as it is from all components?
> >
> > I prefer to map all drivers to a logtype that means something, like
> > RTE_LOGTYPE_PMD.
>
> In that manner it make sense agreed, but previously drivers were using
> 'RTE_LOGTYPE_PMD' instead of having their own log types, Stephen did some work
> to replace the 'RTE_LOGTYPE_PMD' so that it can be deprecated,
>
> starting to use it again as fallback may lead drivers using it again as log type
> in their drivers, may they wouldn't but this is what I concern. Something with
> name 'RTE_LOGTYPE_FALLBACK' clear to not use as default logtype in drivers.
>
> > Having a "fallback" could be used for all components, but this would
> > have to be a static logtype and adding one is not possible without
> > breaking the abi (static entries are < 32 and all values are used).
RTE_LOGTYPE_PMD can be renamed to RTE_LOGTYPE_FALLBACK.
> There is a gap between 'RTE_LOGTYPE_GSO' & 'RTE_LOGTYPE_USER1' ...
Yes, there is room here. But I prefer to rename and re-use
RTE_LOGTYPE_PMD which is not used anymore.
It is part of the EAL API but it is not supposed to be used externally.
For out-of-tree PMDs, we are not supposed to provide such compat.
So I would say don't care with deprecation here.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-09-04 17:45 ` Thomas Monjalon
@ 2019-09-04 19:21 ` Andrew Rybchenko
2019-09-04 19:41 ` Thomas Monjalon
0 siblings, 1 reply; 32+ messages in thread
From: Andrew Rybchenko @ 2019-09-04 19:21 UTC (permalink / raw)
To: Thomas Monjalon, Ferruh Yigit, David Marchand; +Cc: dev
On 9/4/19 8:45 PM, Thomas Monjalon wrote:
> 03/09/2019 10:47, Ferruh Yigit:
>> On 9/3/2019 9:06 AM, David Marchand wrote:
>>> On Mon, Sep 2, 2019 at 4:29 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>>> On 8/19/2019 12:41 PM, David Marchand wrote:
>>>>> The function rte_log_register_type_and_pick_level() fills a gap for
>>>>> dynamically loaded code (especially drivers) who would not pick up
>>>>> the log level passed at startup.
>>>>>
>>>>> Let's promote it to stable and export it for use by drivers via
>>>>> a wrapper.
>>>>>
>>>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>>>>> ---
> [...]
>>>>> /**
>>>>> - * @warning
>>>>> - * @b EXPERIMENTAL: this API may change without prior notice
>>>>> - *
>>>>> * Register a dynamic log type and try to pick its level from EAL options
> [...]
>>>>> -__rte_experimental
>>>>> int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
>>>> +1 to remove experimental from the API.
> I am not sure about this function API.
> Why we combined register and level setting in one function?
See [1]
[1] http://git.dpdk.org/dpdk/commit/?id=b22e77c026
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-09-04 19:21 ` Andrew Rybchenko
@ 2019-09-04 19:41 ` Thomas Monjalon
2019-09-04 19:58 ` Andrew Rybchenko
0 siblings, 1 reply; 32+ messages in thread
From: Thomas Monjalon @ 2019-09-04 19:41 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: Ferruh Yigit, David Marchand, dev
04/09/2019 21:21, Andrew Rybchenko:
> On 9/4/19 8:45 PM, Thomas Monjalon wrote:
> > 03/09/2019 10:47, Ferruh Yigit:
> >> On 9/3/2019 9:06 AM, David Marchand wrote:
> >>> On Mon, Sep 2, 2019 at 4:29 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> >>>> On 8/19/2019 12:41 PM, David Marchand wrote:
> >>>>> The function rte_log_register_type_and_pick_level() fills a gap for
> >>>>> dynamically loaded code (especially drivers) who would not pick up
> >>>>> the log level passed at startup.
> >>>>>
> >>>>> Let's promote it to stable and export it for use by drivers via
> >>>>> a wrapper.
> >>>>>
> >>>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
> >>>>> ---
> > [...]
> >>>>> /**
> >>>>> - * @warning
> >>>>> - * @b EXPERIMENTAL: this API may change without prior notice
> >>>>> - *
> >>>>> * Register a dynamic log type and try to pick its level from EAL options
> > [...]
> >>>>> -__rte_experimental
> >>>>> int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
> >>>> +1 to remove experimental from the API.
> > I am not sure about this function API.
> > Why we combined register and level setting in one function?
>
> See [1]
>
> [1] http://git.dpdk.org/dpdk/commit/?id=b22e77c026
Sorry, it does not explain why we mix both operations in one function.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-09-04 19:41 ` Thomas Monjalon
@ 2019-09-04 19:58 ` Andrew Rybchenko
2019-09-04 20:44 ` Thomas Monjalon
0 siblings, 1 reply; 32+ messages in thread
From: Andrew Rybchenko @ 2019-09-04 19:58 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Ferruh Yigit, David Marchand, dev
On September 4, 2019 22:42:12 Thomas Monjalon <thomas@monjalon.net> wrote:
> 04/09/2019 21:21, Andrew Rybchenko:
>> On 9/4/19 8:45 PM, Thomas Monjalon wrote:
>>> 03/09/2019 10:47, Ferruh Yigit:
>>>> On 9/3/2019 9:06 AM, David Marchand wrote:
>>>>> On Mon, Sep 2, 2019 at 4:29 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>>>>> On 8/19/2019 12:41 PM, David Marchand wrote:
>>>>>>> The function rte_log_register_type_and_pick_level() fills a gap for
>>>>>>> dynamically loaded code (especially drivers) who would not pick up
>>>>>>> the log level passed at startup.
>>>>>>>
>>>>>>>
>>>>>>> Let's promote it to stable and export it for use by drivers via
>>>>>>> a wrapper.
>>>>>>>
>>>>>>>
>>>>>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>>>>>>> ---
>>> [...]
>>>>>>> /**
>>>>>>> - * @warning
>>>>>>> - * @b EXPERIMENTAL: this API may change without prior notice
>>>>>>> - *
>>>>>>> * Register a dynamic log type and try to pick its level from EAL options
>>> [...]
>>>>>>> -__rte_experimental
>>>>>>> int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
>>>>>> +1 to remove experimental from the API.
>>> I am not sure about this function API.
>>> Why we combined register and level setting in one function?
>>
>> See [1]
>>
>> [1] http://git.dpdk.org/dpdk/commit/?id=b22e77c026
>
> Sorry, it does not explain why we mix both operations in one function.
Exactly to have one function instead of repeating two function calls
everywhere. Log level should be set when log type is registered. Yes, it is
possible to factor out a function just to pick log level, but I'm not sure
it makes sense separately.
In fact may be it makes sense to substitute just register with this one
(I.e. remove simple register from piblic API and do not highlight that
level is picked up in function name).
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-09-04 19:58 ` Andrew Rybchenko
@ 2019-09-04 20:44 ` Thomas Monjalon
2019-09-05 6:29 ` Andrew Rybchenko
0 siblings, 1 reply; 32+ messages in thread
From: Thomas Monjalon @ 2019-09-04 20:44 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: Ferruh Yigit, David Marchand, dev
04/09/2019 21:58, Andrew Rybchenko:
> On September 4, 2019 22:42:12 Thomas Monjalon <thomas@monjalon.net> wrote:
>
> > 04/09/2019 21:21, Andrew Rybchenko:
> >> On 9/4/19 8:45 PM, Thomas Monjalon wrote:
> >>> 03/09/2019 10:47, Ferruh Yigit:
> >>>> On 9/3/2019 9:06 AM, David Marchand wrote:
> >>>>> On Mon, Sep 2, 2019 at 4:29 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> >>>>>> On 8/19/2019 12:41 PM, David Marchand wrote:
> >>>>>>> The function rte_log_register_type_and_pick_level() fills a gap for
> >>>>>>> dynamically loaded code (especially drivers) who would not pick up
> >>>>>>> the log level passed at startup.
> >>>>>>>
> >>>>>>>
> >>>>>>> Let's promote it to stable and export it for use by drivers via
> >>>>>>> a wrapper.
> >>>>>>>
> >>>>>>>
> >>>>>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
> >>>>>>> ---
> >>> [...]
> >>>>>>> /**
> >>>>>>> - * @warning
> >>>>>>> - * @b EXPERIMENTAL: this API may change without prior notice
> >>>>>>> - *
> >>>>>>> * Register a dynamic log type and try to pick its level from EAL options
> >>> [...]
> >>>>>>> -__rte_experimental
> >>>>>>> int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
> >>>>>> +1 to remove experimental from the API.
> >>> I am not sure about this function API.
> >>> Why we combined register and level setting in one function?
> >>
> >> See [1]
> >>
> >> [1] http://git.dpdk.org/dpdk/commit/?id=b22e77c026
> >
> > Sorry, it does not explain why we mix both operations in one function.
>
> Exactly to have one function instead of repeating two function calls
> everywhere. Log level should be set when log type is registered. Yes, it is
> possible to factor out a function just to pick log level, but I'm not sure
> it makes sense separately.
>
> In fact may be it makes sense to substitute just register with this one
> (I.e. remove simple register from piblic API and do not highlight that
> level is picked up in function name).
Given that we use it in a macro, we could keep two separate functions
for logtype register and minimum log level (note that "minimum" is
currently a missing word in these functions).
Anyway, we will always use the single macro in our libraries.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-09-04 20:44 ` Thomas Monjalon
@ 2019-09-05 6:29 ` Andrew Rybchenko
2019-09-05 7:13 ` David Marchand
2019-09-05 7:45 ` Thomas Monjalon
0 siblings, 2 replies; 32+ messages in thread
From: Andrew Rybchenko @ 2019-09-05 6:29 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Ferruh Yigit, David Marchand, dev, Olivier Matz
On 9/4/19 11:44 PM, Thomas Monjalon wrote:
> 04/09/2019 21:58, Andrew Rybchenko:
>> On September 4, 2019 22:42:12 Thomas Monjalon <thomas@monjalon.net> wrote:
>>
>>> 04/09/2019 21:21, Andrew Rybchenko:
>>>> On 9/4/19 8:45 PM, Thomas Monjalon wrote:
>>>>> 03/09/2019 10:47, Ferruh Yigit:
>>>>>> On 9/3/2019 9:06 AM, David Marchand wrote:
>>>>>>> On Mon, Sep 2, 2019 at 4:29 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>>>>>>> On 8/19/2019 12:41 PM, David Marchand wrote:
>>>>>>>>> The function rte_log_register_type_and_pick_level() fills a gap for
>>>>>>>>> dynamically loaded code (especially drivers) who would not pick up
>>>>>>>>> the log level passed at startup.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Let's promote it to stable and export it for use by drivers via
>>>>>>>>> a wrapper.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>>>>>>>>> ---
>>>>> [...]
>>>>>>>>> /**
>>>>>>>>> - * @warning
>>>>>>>>> - * @b EXPERIMENTAL: this API may change without prior notice
>>>>>>>>> - *
>>>>>>>>> * Register a dynamic log type and try to pick its level from EAL options
>>>>> [...]
>>>>>>>>> -__rte_experimental
>>>>>>>>> int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
>>>>>>>> +1 to remove experimental from the API.
>>>>> I am not sure about this function API.
>>>>> Why we combined register and level setting in one function?
>>>> See [1]
>>>>
>>>> [1] http://git.dpdk.org/dpdk/commit/?id=b22e77c026
>>> Sorry, it does not explain why we mix both operations in one function.
>> Exactly to have one function instead of repeating two function calls
>> everywhere. Log level should be set when log type is registered. Yes, it is
>> possible to factor out a function just to pick log level, but I'm not sure
>> it makes sense separately.
>>
>> In fact may be it makes sense to substitute just register with this one
>> (I.e. remove simple register from piblic API and do not highlight that
>> level is picked up in function name).
> Given that we use it in a macro, we could keep two separate functions
> for logtype register and minimum log level (note that "minimum" is
> currently a missing word in these functions).
> Anyway, we will always use the single macro in our libraries.
I don't understand why "minimum" is missing. It assigns level specified
for the pattern if it matches, or use level_def if no match. No level
comparison, last match wins. If "minimum" refers to minimum logged
level, it matches rte_log_set_level() which has no "minimum" as well
in neither name nor description. Moreover, EMERG is smaller than
DEBUG and if we treat log levels as numbers, it sets maximum level
which is logged.
There are two usages right now without a macro, but it is not that
important. What I'm trying to say is that rte_log_register() plus setting
default after register is too error prone. It is the source of the bug
which we tried to workaround introducing the function.
If user sets log level (using eal command-line options), no special
efforts should be required to assign it on register. So, I think register
should always do it. The function name is not ideal since it is highlights
details which are not really interesting. It is logging support details that
log levels may be set before log types registration.
if we accept DPDK-wide default, it makes level_def parameter
unnecessary and the functionality to pick level may be simply
moved to rte_log_register() (using helper internal function) and
I see no good reasons why we really need type-specific defaults.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-09-05 6:29 ` Andrew Rybchenko
@ 2019-09-05 7:13 ` David Marchand
2019-09-05 7:45 ` Thomas Monjalon
1 sibling, 0 replies; 32+ messages in thread
From: David Marchand @ 2019-09-05 7:13 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: Thomas Monjalon, Ferruh Yigit, dev, Olivier Matz
On Thu, Sep 5, 2019 at 8:29 AM Andrew Rybchenko
<arybchenko@solarflare.com> wrote:
>
> On 9/4/19 11:44 PM, Thomas Monjalon wrote:
>
> 04/09/2019 21:58, Andrew Rybchenko:
>
> On September 4, 2019 22:42:12 Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 04/09/2019 21:21, Andrew Rybchenko:
>
> On 9/4/19 8:45 PM, Thomas Monjalon wrote:
>
> 03/09/2019 10:47, Ferruh Yigit:
>
> On 9/3/2019 9:06 AM, David Marchand wrote:
>
> On Mon, Sep 2, 2019 at 4:29 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 8/19/2019 12:41 PM, David Marchand wrote:
>
> The function rte_log_register_type_and_pick_level() fills a gap for
> dynamically loaded code (especially drivers) who would not pick up
> the log level passed at startup.
>
>
> Let's promote it to stable and export it for use by drivers via
> a wrapper.
>
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>
> [...]
>
> /**
> - * @warning
> - * @b EXPERIMENTAL: this API may change without prior notice
> - *
> * Register a dynamic log type and try to pick its level from EAL options
>
> [...]
>
> -__rte_experimental
> int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
>
> +1 to remove experimental from the API.
>
> I am not sure about this function API.
> Why we combined register and level setting in one function?
>
> See [1]
>
> [1] http://git.dpdk.org/dpdk/commit/?id=b22e77c026
>
> Sorry, it does not explain why we mix both operations in one function.
>
> Exactly to have one function instead of repeating two function calls
> everywhere. Log level should be set when log type is registered. Yes, it is
> possible to factor out a function just to pick log level, but I'm not sure
> it makes sense separately.
>
> In fact may be it makes sense to substitute just register with this one
> (I.e. remove simple register from piblic API and do not highlight that
> level is picked up in function name).
>
> Given that we use it in a macro, we could keep two separate functions
> for logtype register and minimum log level (note that "minimum" is
> currently a missing word in these functions).
> Anyway, we will always use the single macro in our libraries.
>
>
> I don't understand why "minimum" is missing. It assigns level specified
> for the pattern if it matches, or use level_def if no match. No level
> comparison, last match wins. If "minimum" refers to minimum logged
> level, it matches rte_log_set_level() which has no "minimum" as well
> in neither name nor description. Moreover, EMERG is smaller than
> DEBUG and if we treat log levels as numbers, it sets maximum level
> which is logged.
>
> There are two usages right now without a macro, but it is not that
> important. What I'm trying to say is that rte_log_register() plus setting
> default after register is too error prone. It is the source of the bug
> which we tried to workaround introducing the function.
>
> If user sets log level (using eal command-line options), no special
> efforts should be required to assign it on register. So, I think register
> should always do it. The function name is not ideal since it is highlights
> details which are not really interesting. It is logging support details that
> log levels may be set before log types registration.
>
> if we accept DPDK-wide default, it makes level_def parameter
> unnecessary and the functionality to pick level may be simply
> moved to rte_log_register() (using helper internal function) and
> I see no good reasons why we really need type-specific defaults.
Well this would require to touch quite some components that are not
aligned, but I can't disagree with you :-).
I'll prepare a v2 and identify which drivers are not ready for this.
I also have some additional changes in mind.
This should prevent the log register from failing (and no need for the
"fallback" stuff then).
--
David Marchand
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
2019-09-05 6:29 ` Andrew Rybchenko
2019-09-05 7:13 ` David Marchand
@ 2019-09-05 7:45 ` Thomas Monjalon
1 sibling, 0 replies; 32+ messages in thread
From: Thomas Monjalon @ 2019-09-05 7:45 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: Ferruh Yigit, David Marchand, dev, Olivier Matz
05/09/2019 08:29, Andrew Rybchenko:
> On 9/4/19 11:44 PM, Thomas Monjalon wrote:
> > 04/09/2019 21:58, Andrew Rybchenko:
> >> On September 4, 2019 22:42:12 Thomas Monjalon <thomas@monjalon.net> wrote:
> >>
> >>> 04/09/2019 21:21, Andrew Rybchenko:
> >>>> On 9/4/19 8:45 PM, Thomas Monjalon wrote:
> >>>>> 03/09/2019 10:47, Ferruh Yigit:
> >>>>>> On 9/3/2019 9:06 AM, David Marchand wrote:
> >>>>>>> On Mon, Sep 2, 2019 at 4:29 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> >>>>>>>> On 8/19/2019 12:41 PM, David Marchand wrote:
> >>>>>>>>> The function rte_log_register_type_and_pick_level() fills a gap for
> >>>>>>>>> dynamically loaded code (especially drivers) who would not pick up
> >>>>>>>>> the log level passed at startup.
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Let's promote it to stable and export it for use by drivers via
> >>>>>>>>> a wrapper.
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
> >>>>>>>>> ---
> >>>>> [...]
> >>>>>>>>> /**
> >>>>>>>>> - * @warning
> >>>>>>>>> - * @b EXPERIMENTAL: this API may change without prior notice
> >>>>>>>>> - *
> >>>>>>>>> * Register a dynamic log type and try to pick its level from EAL options
> >>>>> [...]
> >>>>>>>>> -__rte_experimental
> >>>>>>>>> int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
> >>>>>>>> +1 to remove experimental from the API.
> >>>>> I am not sure about this function API.
> >>>>> Why we combined register and level setting in one function?
> >>>> See [1]
> >>>>
> >>>> [1] http://git.dpdk.org/dpdk/commit/?id=b22e77c026
> >>> Sorry, it does not explain why we mix both operations in one function.
> >> Exactly to have one function instead of repeating two function calls
> >> everywhere. Log level should be set when log type is registered. Yes, it is
> >> possible to factor out a function just to pick log level, but I'm not sure
> >> it makes sense separately.
> >>
> >> In fact may be it makes sense to substitute just register with this one
> >> (I.e. remove simple register from piblic API and do not highlight that
> >> level is picked up in function name).
> > Given that we use it in a macro, we could keep two separate functions
> > for logtype register and minimum log level (note that "minimum" is
> > currently a missing word in these functions).
> > Anyway, we will always use the single macro in our libraries.
>
> I don't understand why "minimum" is missing. It assigns level specified
> for the pattern if it matches, or use level_def if no match. No level
> comparison, last match wins. If "minimum" refers to minimum logged
> level, it matches rte_log_set_level() which has no "minimum" as well
> in neither name nor description. Moreover, EMERG is smaller than
> DEBUG and if we treat log levels as numbers, it sets maximum level
> which is logged.
Yes it is maximum.
I mean even in rte_log_set_level() we don't have such word.
It is a detail.
> There are two usages right now without a macro, but it is not that
> important. What I'm trying to say is that rte_log_register() plus setting
> default after register is too error prone. It is the source of the bug
> which we tried to workaround introducing the function.
>
> If user sets log level (using eal command-line options), no special
> efforts should be required to assign it on register. So, I think register
> should always do it. The function name is not ideal since it is highlights
> details which are not really interesting. It is logging support details that
> log levels may be set before log types registration.
>
> if we accept DPDK-wide default, it makes level_def parameter
> unnecessary and the functionality to pick level may be simply
> moved to rte_log_register() (using helper internal function) and
> I see no good reasons why we really need type-specific defaults.
I agree it can be merged in rte_log_register().
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2019-09-05 7:45 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 01/11] log: fix plugin level restore with patterns David Marchand
2019-08-19 12:30 ` Andrew Rybchenko
2019-08-19 11:41 ` [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers David Marchand
2019-08-19 12:27 ` Andrew Rybchenko
2019-09-02 14:29 ` Ferruh Yigit
2019-09-03 8:06 ` David Marchand
2019-09-03 8:47 ` Ferruh Yigit
2019-09-04 17:45 ` Thomas Monjalon
2019-09-04 19:21 ` Andrew Rybchenko
2019-09-04 19:41 ` Thomas Monjalon
2019-09-04 19:58 ` Andrew Rybchenko
2019-09-04 20:44 ` Thomas Monjalon
2019-09-05 6:29 ` Andrew Rybchenko
2019-09-05 7:13 ` David Marchand
2019-09-05 7:45 ` Thomas Monjalon
2019-08-19 11:41 ` [dpdk-dev] [PATCH 03/11] drivers/baseband: use new logtype wrapper David Marchand
2019-08-19 15:39 ` Chautru, Nicolas
2019-08-19 11:41 ` [dpdk-dev] [PATCH 04/11] drivers/bus: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 05/11] drivers/common: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 06/11] drivers/compress: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 07/11] drivers/crypto: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 08/11] drivers/event: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 09/11] drivers/mempool: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 10/11] drivers/net: " David Marchand
2019-08-19 14:55 ` Legacy, Allain
2019-09-02 16:11 ` Ferruh Yigit
2019-09-03 8:06 ` David Marchand
2019-09-03 15:03 ` Stephen Hemminger
2019-08-19 11:41 ` [dpdk-dev] [PATCH 11/11] drivers/raw: " David Marchand
2019-09-02 14:17 ` [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers Ferruh Yigit
2019-09-03 8:06 ` David Marchand
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).