DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD
@ 2023-12-13  1:42 Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 01/26] log: fix doc comment for RTE_LOG_DP() Stephen Hemminger
                   ` (32 more replies)
  0 siblings, 33 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a leftover and should be removed.
As a first step, fix many drivers to not use it, and add a
helper for the RTE_LOG_DP(). 

Most of this patchset is boiler plate but there were some
places where use of PMD type snuck in with changes to
original driver and get fixed here.

Stephen Hemminger (26):
  log: fix doc comment for RTE_LOG_DP()
  log: add rte_log_dp()
  net/atlantic: replace RTE_LOG_DP with rte_log_dp
  net/avp: replace RTE_LOG_DP with rte_log_dp
  net/bnxt: replace RTE_LOG_DP with rte_log_dp
  net/dpaa: replace RTE_LOG_DP with rte_log_dp
  net/dpaa2: replace RTE_LOG_DP with rte_log_dp
  net/enetc: replace RTE_LOG_DP with rte_log_dp
  net/enetfec: replace RTE_LOG_DP with rte_log_dp
  net/igc: replace RTE_LOG_DP with rte_log_dp
  net/mana: replace RTE_LOG_DP with rte_log_dp
  net/mvpp2: do not use PMD logtype
  net/octeon_ep: replace RTE_LOG_DP with rte_log_dp
  net/pfe: replace RTE_LOG_DP with rte_log_dp
  net/qede: replace RTE_LOG_DP with rte_log_dp
  net/virtio: replace RTE_LOG_DP with rte_log_dp
  net/vmxnet3: do not use PMD logtype
  common/cnxk: replace RTE_LOG_DP with rte_log_dp
  common/cpt: replace RTE_LOG_DP with rte_log_dp
  common/sfc_efx: remove use of PMD logtype
  common/dpaax: do not use PMD logtype
  basband/la12xx: replace RTE_LOG_DP with rte_log_dp
  bus/cdx: replace RTE_LOG_DP with rte_log_dp
  bus/fslmc: replace RTE_LOG_DP with rte_log_dp
  dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
  mempool/dpaa, mempool/dpaa2: do not use logtype PMD

 .../baseband/la12xx/bbdev_la12xx_pmd_logs.h   |  2 +-
 drivers/bus/cdx/cdx_logs.h                    |  2 +-
 drivers/bus/fslmc/fslmc_logs.h                |  2 +-
 drivers/common/cnxk/roc_platform.h            | 28 ++++++++++---------
 drivers/common/cpt/cpt_pmd_logs.h             |  2 +-
 drivers/common/dpaax/caamflib/compat.h        |  5 +++-
 drivers/common/dpaax/version.map              |  1 +
 drivers/common/sfc_efx/sfc_efx.c              | 11 ++------
 drivers/common/sfc_efx/sfc_efx_log.h          |  2 +-
 drivers/dma/dpaa/dpaa_qdma_logs.h             |  5 ++--
 drivers/dma/dpaa2/dpaa2_qdma_logs.h           |  3 +-
 drivers/mempool/dpaa/dpaa_mempool.h           |  2 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c      |  4 +--
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h |  2 +-
 drivers/net/atlantic/atl_logs.h               | 15 +++++-----
 drivers/net/avp/avp_logs.h                    | 20 +++++++------
 drivers/net/bnxt/bnxt.h                       |  5 ++++
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c         |  3 +-
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c          |  3 +-
 drivers/net/bnxt/bnxt_txr.c                   |  4 +--
 drivers/net/dpaa/dpaa_ethdev.c                |  4 +--
 drivers/net/dpaa/dpaa_ethdev.h                |  2 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |  2 +-
 drivers/net/dpaa2/dpaa2_pmd_logs.h            |  2 +-
 drivers/net/dpaa2/dpaa2_sparser.c             |  4 +--
 drivers/net/enetc/enetc_logs.h                |  2 +-
 drivers/net/enetfec/enet_pmd_logs.h           |  2 +-
 drivers/net/igc/igc_logs.h                    | 10 ++++---
 drivers/net/mana/mana.h                       |  2 +-
 drivers/net/mvpp2/mrvl_ethdev.c               |  4 +--
 drivers/net/octeon_ep/otx_ep_common.h         |  7 +++++
 drivers/net/octeon_ep/otx_ep_rxtx.c           |  5 ++--
 drivers/net/octeontx/octeontx_logs.h          |  3 +-
 drivers/net/pfe/pfe_logs.h                    |  2 +-
 drivers/net/qede/qede_logs.h                  | 10 ++++---
 drivers/net/virtio/virtio_logs.h              | 16 ++++++-----
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |  2 +-
 drivers/net/vmxnet3/vmxnet3_logs.h            | 12 +++++---
 lib/log/rte_log.h                             | 26 +++++++++++++++--
 39 files changed, 139 insertions(+), 99 deletions(-)

-- 
2.42.0


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

* [PATCH 01/26] log: fix doc comment for RTE_LOG_DP()
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 02/26] log: add rte_log_dp() Stephen Hemminger
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Olivier Matz

The macro does not return a numeric status, only void.

Fixes: 5d8f0baf69ea ("log: do not drop debug logs at compile time")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/log/rte_log.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 4d207b8da2cd..bbbb051c20e2 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -348,9 +348,6 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
  * @param ...
  *   The fmt string, as in printf(3), followed by the variable arguments
  *   required by the format.
- * @return
- *   - 0: Success.
- *   - Negative on error.
  */
 #define RTE_LOG_DP(l, t, ...)					\
 	(void)((RTE_LOG_ ## l <= RTE_LOG_DP_LEVEL) ?		\
-- 
2.42.0


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

* [PATCH 02/26] log: add rte_log_dp()
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 01/26] log: fix doc comment for RTE_LOG_DP() Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 03/26] net/atlantic: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Add a new macro for logging in datapath using a logtype.
The existing macro RTE_LOG_DP() takes log type suffix (i.e. PMD)
like RTE_LOG(). This macro allows using a dynamic type.

Ideally, rte_log_dp() could be an always_inline function
but GCC and Clang will not inline a function with variable number
of arguments. Therefore it has to be a macro.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/log/rte_log.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index bbbb051c20e2..8eb2b38b1a9f 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -355,6 +355,29 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
 		 RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) :	\
 	 0)
 
+/**
+ * Generates a log message for data path.
+ *
+ * Similar to rte_log(), except that it gets optimized away
+ * if the RTE_LOG_DP_LEVEL configuration option is lower than the log
+ * level argument.
+ *
+ * @param level
+ *   Log level. A value between RTE_LOG_EMERG (1) and RTE_LOG_DEBUG (8).
+ * @param logtype
+ *   The log type, for example, RTE_LOGTYPE_EAL.
+ * @param format
+ *   The format string, as in printf(3), followed by the variable arguments
+ *   required by the format.
+ * @param ap
+ *   The va_list of the variable arguments required by the format.
+ */
+#define rte_log_dp(lev, t, ...)				\
+	do {						\
+		if (lev <= RTE_LOG_DP_LEVEL)		\
+			rte_log(lev, t, __VA_ARGS__);	\
+	} while(0)
+
 #define RTE_LOG_REGISTER_IMPL(type, name, level)			    \
 int type;								    \
 RTE_INIT(__##type)							    \
-- 
2.42.0


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

* [PATCH 03/26] net/atlantic: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 01/26] log: fix doc comment for RTE_LOG_DP() Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 02/26] log: add rte_log_dp() Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 04/26] net/avp: " Stephen Hemminger
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Igor Russkikh

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/atlantic/atl_logs.h | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/atlantic/atl_logs.h b/drivers/net/atlantic/atl_logs.h
index e3dba334fe92..c2a3a6320c58 100644
--- a/drivers/net/atlantic/atl_logs.h
+++ b/drivers/net/atlantic/atl_logs.h
@@ -14,18 +14,19 @@ extern int atl_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-
 extern int atl_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, atl_logtype_driver, fmt "\n", \
+		   ## args)
+
+#define PMD_RX_LOG(level, fmt, args...) \
+	PMD_DRV_LOG(level, fmt, ## args)
+
+#define PMD_TX_LOG(level, fmt, args...) \
+	PMD_DRV_LOG(level, fmt, ## args)
 
 #endif
-- 
2.42.0


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

* [PATCH 04/26] net/avp: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (2 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 03/26] net/atlantic: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 05/26] net/bnxt: " Stephen Hemminger
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Steven Webster, Matt Peters

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/avp/avp_logs.h | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/avp/avp_logs.h b/drivers/net/avp/avp_logs.h
index 6e297c7a4a81..0ae95a7685c5 100644
--- a/drivers/net/avp/avp_logs.h
+++ b/drivers/net/avp/avp_logs.h
@@ -7,24 +7,26 @@
 
 #include <rte_log.h>
 
+
+extern int avp_logtype_driver;
+
+#define PMD_DRV_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
+		"%s(): " fmt, __func__, ## args)
+
 #ifdef RTE_LIBRTE_AVP_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() rx: " fmt, __func__, ## args)
+	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
+		"%s() rx: " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_AVP_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() tx: " fmt, __func__, ## args)
+	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
+		"%s() tx: " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
-
-extern int avp_logtype_driver;
-
-#define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
-		"%s(): " fmt, __func__, ## args)
-
 #endif /* _AVP_LOGS_H_ */
-- 
2.42.0


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

* [PATCH 05/26] net/bnxt: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (3 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 04/26] net/avp: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  3:07   ` Somnath Kotur
  2023-12-13  1:42 ` [PATCH 06/26] net/dpaa: " Stephen Hemminger
                   ` (27 subsequent siblings)
  32 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Ajit Khaparde, Somnath Kotur, Ruifeng Wang,
	Bruce Richardson, Konstantin Ananyev

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bnxt/bnxt.h               | 5 +++++
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +--
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c  | 3 +--
 drivers/net/bnxt/bnxt_txr.c           | 4 +---
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 0e01b1d4baea..3aa9213a12f9 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -1058,6 +1058,11 @@ extern int bnxt_logtype_driver;
 #define PMD_DRV_LOG(level, fmt, args...) \
 	  PMD_DRV_LOG_RAW(level, fmt, ## args)
 
+#define PMD_DRV_LOG_DP(level, fmt, args...)			\
+	rte_log_dp(RTE_LOG_ ## level, bnxt_logtype_driver,	\
+		   fmt, ## args)
+
+
 extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;
 int32_t bnxt_ulp_port_init(struct bnxt *bp);
 void bnxt_ulp_port_deinit(struct bnxt *bp);
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
index aa1b1ab8bb7e..64c1dfac47d9 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
@@ -357,8 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
-				   "Unhandled CMP type %02x\n",
+			PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index e99a547f5857..572b21a00837 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -326,8 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
-				   "Unhandled CMP type %02x\n",
+			PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 899986764f93..bd0a75653ab3 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -542,9 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
 		if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
 			nb_tx_pkts += opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
-					"Unhandled CMP type %02x\n",
-					CMP_TYPE(txcmp));
+			PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n", CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
 
-- 
2.42.0


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

* [PATCH 06/26] net/dpaa: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (4 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 05/26] net/bnxt: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 07/26] net/dpaa2: " Stephen Hemminger
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa/dpaa_ethdev.c | 4 ++--
 drivers/net/dpaa/dpaa_ethdev.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index ef4c06db6a4d..0d0d493f3a6d 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -2096,7 +2096,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 	/* copy the primary mac address */
 	rte_ether_addr_copy(&fman_intf->mac_addr, &eth_dev->data->mac_addrs[0]);
 
-	RTE_LOG(INFO, PMD, "net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n",
+	DPAA_PMD_INFO("dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT,
 		dpaa_device->name, RTE_ETHER_ADDR_BYTES(&fman_intf->mac_addr));
 
 	if (!fman_intf->is_shared_mac) {
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 
 		ret = dpaa_dev_init_secondary(eth_dev);
 		if (ret != 0) {
-			RTE_LOG(ERR, PMD, "secondary dev init failed\n");
+			DPAA_PMD_ERR("secondary dev init failed");
 			return ret;
 		}
 
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 5b6802ece8f0..ced3e5f8ff98 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -232,6 +232,6 @@ extern int dpaa_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa_logtype_pmd, fmt, ## args)
 
 #endif
-- 
2.42.0


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

* [PATCH 07/26] net/dpaa2: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (5 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 06/26] net/dpaa: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 08/26] net/enetc: " Stephen Hemminger
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa2/dpaa2_ethdev.c   | 2 +-
 drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +-
 drivers/net/dpaa2/dpaa2_sparser.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 8e610b6bba30..71d57ab26062 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 			return ret;
 		}
 	}
-	RTE_LOG(INFO, PMD, "%s: netdev created, connected to %s\n",
+	DPAA2_PMD_INFO("%s: netdev created, connected to %s\n",
 		eth_dev->data->name, dpaa2_dev->ep_name);
 
 	return 0;
diff --git a/drivers/net/dpaa2/dpaa2_pmd_logs.h b/drivers/net/dpaa2/dpaa2_pmd_logs.h
index c47ba8e10bfc..89bffc684e50 100644
--- a/drivers/net/dpaa2/dpaa2_pmd_logs.h
+++ b/drivers/net/dpaa2/dpaa2_pmd_logs.h
@@ -28,7 +28,7 @@ extern int dpaa2_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_pmd, fmt, ## args)
 
 #define DPAA2_PMD_DP_DEBUG(fmt, args...) \
 	DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/dpaa2/dpaa2_sparser.c b/drivers/net/dpaa2/dpaa2_sparser.c
index 63463c4fbfd6..202996c5d05d 100644
--- a/drivers/net/dpaa2/dpaa2_sparser.c
+++ b/drivers/net/dpaa2/dpaa2_sparser.c
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 
 	priv->ss_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(addr));
 	priv->ss_offset += sp_param.size;
-	RTE_LOG(INFO, PMD, "Soft parser loaded for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser loaded for dpni@%d\n", priv->hw_id);
 
 	rte_free(addr);
 	return 0;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 	}
 
 	rte_free(param_addr);
-	RTE_LOG(INFO, PMD, "Soft parser enabled for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser enabled for dpni@%d\n", priv->hw_id);
 	return 0;
 }
-- 
2.42.0


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

* [PATCH 08/26] net/enetc: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (6 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 07/26] net/dpaa2: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 09/26] net/enetfec: " Stephen Hemminger
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/enetc/enetc_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/enetc/enetc_logs.h b/drivers/net/enetc/enetc_logs.h
index 0976d42debd7..05a540f16490 100644
--- a/drivers/net/enetc/enetc_logs.h
+++ b/drivers/net/enetc/enetc_logs.h
@@ -30,7 +30,7 @@ extern int enetc_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETC_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, enetc_logtype_pmd, fmt, ## args)
 
 #define ENETC_PMD_DP_DEBUG(fmt, args...) \
 	ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
-- 
2.42.0


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

* [PATCH 09/26] net/enetfec: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (7 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 08/26] net/enetc: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 10/26] net/igc: " Stephen Hemminger
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Apeksha Gupta, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/enetfec/enet_pmd_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/enetfec/enet_pmd_logs.h b/drivers/net/enetfec/enet_pmd_logs.h
index 72d1cb61c598..c0a226284c53 100644
--- a/drivers/net/enetfec/enet_pmd_logs.h
+++ b/drivers/net/enetfec/enet_pmd_logs.h
@@ -28,6 +28,6 @@ extern int enetfec_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETFEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, enetfec_logtype_pmd, fmt, ## args)
 
 #endif /* _ENETFEC_LOGS_H_ */
-- 
2.42.0


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

* [PATCH 10/26] net/igc: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (8 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 09/26] net/enetfec: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  2:36   ` Guo, Junfeng
  2023-12-13  1:42 ` [PATCH 11/26] net/mana: " Stephen Hemminger
                   ` (22 subsequent siblings)
  32 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Junfeng Guo, Simei Su

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/igc/igc_logs.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 11071a32b542..ffa1981bae32 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -21,15 +21,17 @@ extern int igc_logtype_driver;
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_ETHDEV_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_RX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, igc_logtype_driver,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_TX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, igc_logtype_driver,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
-- 
2.42.0


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

* [PATCH 11/26] net/mana: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (9 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 10/26] net/igc: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 12/26] net/mvpp2: do not use PMD logtype Stephen Hemminger
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Long Li

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mana/mana.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index 6836872dc257..8d60f9172d44 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -467,7 +467,7 @@ extern int mana_logtype_init;
 		__func__, ## args)
 
 #define DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, mana_logtype_driver, fmt "\n", ## args)
 
 #define PMD_INIT_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
-- 
2.42.0


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

* [PATCH 12/26] net/mvpp2: do not use PMD logtype
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (10 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 11/26] net/mana: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 13/26] net/octeon_ep: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Liron Himi, Yelena Krivosheev, Natalie Samsonov

The driver already has a logtype but it was not being used
in one place.

Fixes: 9e79d810911d ("net/mvpp2: support Tx scatter/gather")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index c12364941d62..9a9279a8783a 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)
 
 	/* Use a simple Tx queue (no offloads, no multi segs) if possible */
 	if (priv->multiseg) {
-		RTE_LOG(INFO, PMD, "Using multi-segment tx callback\n");
+		MRVL_LOG(INFO, "Using multi-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst;
 	} else {
-		RTE_LOG(INFO, PMD, "Using single-segment tx callback\n");
+		MRVL_LOG(INFO, "Using single-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_pkt_burst;
 	}
 }
-- 
2.42.0


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

* [PATCH 13/26] net/octeon_ep: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (11 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 12/26] net/mvpp2: do not use PMD logtype Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 14/26] net/pfe: " Stephen Hemminger
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Vamsi Attunuru

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/octeon_ep/otx_ep_common.h | 7 +++++++
 drivers/net/octeon_ep/otx_ep_rxtx.c   | 5 ++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
index 82e57520d38d..5fb63d051ac8 100644
--- a/drivers/net/octeon_ep/otx_ep_common.h
+++ b/drivers/net/octeon_ep/otx_ep_common.h
@@ -81,6 +81,13 @@
 		"%s():%u " fmt "\n",				\
 		__func__, __LINE__, ##args)
 
+#define otx_ep_log_dp(level, fmt, args...)			\
+	rte_log_dp(RTE_LOG_ ## level, otx_net_ep_logtype,	\
+		   "%s():%u " fmt "\n",				\
+		   __func__, __LINE__, ##args)
+
+
+
 /* IO Access */
 #define oct_ep_read64(addr) rte_read64_relaxed((void *)(addr))
 #define oct_ep_write64(val, addr) rte_write64_relaxed((val), (void *)(addr))
diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c
index c421ef0a1c04..fe8885be54ff 100644
--- a/drivers/net/octeon_ep/otx_ep_rxtx.c
+++ b/drivers/net/octeon_ep/otx_ep_rxtx.c
@@ -884,9 +884,8 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		next_fetch = (pkts == new_pkts - 1) ? 0 : 1;
 		oq_pkt = otx_ep_droq_read_packet(otx_ep, droq, next_fetch);
 		if (!oq_pkt) {
-			RTE_LOG_DP(ERR, PMD,
-				   "DROQ read pkt failed pending %" PRIu64
-				    "last_pkt_count %" PRIu64 "new_pkts %d.\n",
+			otx_ep_log_dp(ERR, "DROQ read pkt failed pending %" PRIu64
+				    "last_pkt_count %" PRIu64 "new_pkts %d.",
 				   droq->pkts_pending, droq->last_pkt_count,
 				   new_pkts);
 			droq->stats.rx_err++;
-- 
2.42.0


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

* [PATCH 14/26] net/pfe: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (12 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 13/26] net/octeon_ep: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 15/26] net/qede: " Stephen Hemminger
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Harman Kalra, Gagandeep Singh

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/octeontx/octeontx_logs.h | 3 +--
 drivers/net/pfe/pfe_logs.h           | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/octeontx/octeontx_logs.h b/drivers/net/octeontx/octeontx_logs.h
index dec8042c67ba..cec5346d5a8b 100644
--- a/drivers/net/octeontx/octeontx_logs.h
+++ b/drivers/net/octeontx/octeontx_logs.h
@@ -19,11 +19,10 @@
 	rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \
 			"%s(): " fmt "\n", __func__, ## args)
 
-#define octeontx_log_info(fmt, args...)			\
-	RTE_LOG(INFO, PMD, fmt "\n", ## args)
 
 #define octeontx_log_err(s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)
 #define octeontx_log_dbg(s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__)
+#define octeontx_log_info(s, ...) PMD_DRV_LOG(INFO, s, ##__VA_ARGS__)
 #define octeontx_mbox_log(s, ...) PMD_MBOX_LOG(DEBUG, s, ##__VA_ARGS__)
 
 #define PMD_RX_LOG	PMD_DRV_LOG
diff --git a/drivers/net/pfe/pfe_logs.h b/drivers/net/pfe/pfe_logs.h
index 58d5e8e7cff1..306bfc22ea54 100644
--- a/drivers/net/pfe/pfe_logs.h
+++ b/drivers/net/pfe/pfe_logs.h
@@ -26,6 +26,6 @@ extern int pfe_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define PFE_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ##level, pfe_logtype_pmd, fmt, ## args)
 
 #endif /* _PFE_LOGS_H_ */
-- 
2.42.0


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

* [PATCH 15/26] net/qede: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (13 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 14/26] net/pfe: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 16/26] net/virtio: " Stephen Hemminger
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Devendra Singh Rawat, Alok Prasad

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/qede/qede_logs.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qede/qede_logs.h b/drivers/net/qede/qede_logs.h
index 3187d97bb7b0..097294be9c71 100644
--- a/drivers/net/qede/qede_logs.h
+++ b/drivers/net/qede/qede_logs.h
@@ -58,16 +58,18 @@ extern int qede_logtype_init;
 #define PMD_INIT_FUNC_TRACE(edev) PMD_INIT_LOG(DEBUG, edev, " >>")
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_TX
-#define PMD_TX_LOG(level, q, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \
+#define PMD_TX_LOG(level, q, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, qded_logtype_driver,		\
+		"%s(): port=%u queue=%u " fmt "\n",		\
 		__func__, q->port_id, q->queue_id, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_RX
-#define PMD_RX_LOG(level, q, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n",	\
+#define PMD_RX_LOG(level, q, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, qded_logtype_driver,		\
+		"%s(): port=%u queue=%u " fmt "\n",		\
 		__func__, q->port_id, q->queue_id, ## args)
 #else
 #define PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
-- 
2.42.0


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

* [PATCH 16/26] net/virtio: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (14 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 15/26] net/qede: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 17/26] net/vmxnet3: do not use PMD logtype Stephen Hemminger
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Maxime Coquelin, Chenbo Xia

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/virtio/virtio_logs.h | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/virtio/virtio_logs.h b/drivers/net/virtio/virtio_logs.h
index 9b1b1defc5a6..0447ee961fb6 100644
--- a/drivers/net/virtio/virtio_logs.h
+++ b/drivers/net/virtio/virtio_logs.h
@@ -14,23 +14,25 @@ extern int virtio_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
+extern int virtio_logtype_driver;
+#define PMD_DRV_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
+		"%s(): " fmt "\n", __func__, ## args)
+
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
+		"%s() rx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
+		"%s() tx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
-extern int virtio_logtype_driver;
-#define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
-		"%s(): " fmt "\n", __func__, ## args)
-
 #endif /* _VIRTIO_LOGS_H_ */
-- 
2.42.0


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

* [PATCH 17/26] net/vmxnet3: do not use PMD logtype
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (15 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 16/26] net/virtio: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 18/26] common/cnxk: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Jochen Behrens

The driver used a slightly different (and older) format
for datapath logs. Remove PMD logtype here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  2 +-
 drivers/net/vmxnet3/vmxnet3_logs.h   | 12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index e49191718aea..4fd704045fc4 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)
 	if (events == 0)
 		goto done;
 
-	RTE_LOG(DEBUG, PMD, "Reading events: 0x%X", events);
+	PMD_DRV_LOG(DEBUG, "Reading events: 0x%X", events);
 	vmxnet3_process_events(dev);
 done:
 	vmxnet3_enable_intr(hw, *eventIntrIdx);
diff --git a/drivers/net/vmxnet3/vmxnet3_logs.h b/drivers/net/vmxnet3/vmxnet3_logs.h
index 74154e3a1a6d..058d704f82c9 100644
--- a/drivers/net/vmxnet3/vmxnet3_logs.h
+++ b/drivers/net/vmxnet3/vmxnet3_logs.h
@@ -11,28 +11,32 @@ extern int vmxnet3_logtype_init;
 		"%s(): " fmt "\n", __func__, ## args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
+extern int vmxnet3_logtype_driver;
+
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
+		 "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
+		 "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE
 #define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
+		 "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
 #endif
 
-extern int vmxnet3_logtype_driver;
 #define PMD_DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
 		"%s(): " fmt "\n", __func__, ## args)
-- 
2.42.0


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

* [PATCH 18/26] common/cnxk: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (16 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 17/26] net/vmxnet3: do not use PMD logtype Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 19/26] common/cpt: " Stephen Hemminger
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/cnxk/roc_platform.h | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index ba23b2e0d79e..9461f6e93304 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;
 extern int cnxk_logtype_ree;
 extern int cnxk_logtype_dpi;
 
-#define plt_err(fmt, args...)                                                  \
-	RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
-#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args)
-#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
+#define plt_log(level, fmt, args...)					\
+	rte_log(RTE_LOG_ ## level, cnxk_logtype_base,			\
+		"%s():%u " fmt "\n", __func__, __LINE__, ##args)
+#define plt_err(fmt, ...) plt_log(ERR, fmt, ##__VA_ARGS__)
+#define plt_info(fmt, ...) plt_log(INFO, fmt, ##__VA_ARGS__)
+#define plt_warn(fmt, ...) plt_log(WARNING, fmt, ##__VA_ARGS__)
+#define plt_print(fmt, ...) plt_log(INFO, fmt,  ##__VA_ARGS__)
 #define plt_dump(fmt, ...)      fprintf(stderr, fmt "\n", ##__VA_ARGS__)
 #define plt_dump_no_nl(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
 
@@ -278,8 +280,7 @@ extern int cnxk_logtype_dpi;
  */
 #define plt_dbg(subsystem, fmt, args...)                                       \
 	rte_log(RTE_LOG_DEBUG, cnxk_logtype_##subsystem,                       \
-		"[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__,      \
-##args)
+		"[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__, ##args)
 
 #define plt_base_dbg(fmt, ...)	plt_dbg(base, fmt, ##__VA_ARGS__)
 #define plt_cpt_dbg(fmt, ...)	plt_dbg(cpt, fmt, ##__VA_ARGS__)
@@ -295,12 +296,13 @@ extern int cnxk_logtype_dpi;
 #define plt_dpi_dbg(fmt, ...)	plt_dbg(dpi, fmt, ##__VA_ARGS__)
 
 /* Datapath logs */
-#define plt_dp_err(fmt, args...)                                               \
-	RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_dp_info(fmt, args...)                                              \
-	RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_dp_dbg(fmt, args...)                                              \
-	RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+#define plt_dp_log(level, fmt, args...)					\
+	rte_log_dp(RTE_LOG_ ## level, cnxk_logtype_base,		\
+		"%s():%u " fmt "\n", __func__, __LINE__, ## args)
+
+#define plt_dp_err(fmt, ...)  plt_dp_log(ERR, fmt, ##__VA_ARGS__)
+#define plt_dp_info(fmt, ...) plt_dp_log(INFO, fmt, ##__VA_ARGS__)
+#define plt_dp_dbg(fmt, ...)  plt_dp_log(DEBUG, fmt, ##__VA_ARGS__)
 
 #ifdef __cplusplus
 #define CNXK_PCI_ID(subsystem_dev, dev)                                        \
-- 
2.42.0


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

* [PATCH 19/26] common/cpt: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (17 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 18/26] common/cnxk: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 20/26] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Anoob Joseph

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/cpt/cpt_pmd_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/cpt/cpt_pmd_logs.h b/drivers/common/cpt/cpt_pmd_logs.h
index 174326c6ce38..6b78fcb6b6fc 100644
--- a/drivers/common/cpt/cpt_pmd_logs.h
+++ b/drivers/common/cpt/cpt_pmd_logs.h
@@ -34,7 +34,7 @@
  * level of 'pmd' has to be used.
  */
 #define CPT_LOG_DP(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, CPT_LOGTYPE, fmt "\n", ## args)
 
 #define CPT_LOG_DP_DEBUG(fmt, args...) \
 	CPT_LOG_DP(DEBUG, fmt, ## args)
-- 
2.42.0


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

* [PATCH 20/26] common/sfc_efx: remove use of PMD logtype
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (18 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 19/26] common/cpt: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 21/26] common/dpaax: do not use " Stephen Hemminger
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Andrew Rybchenko

This code was implemented in a slightly different manner
than all the other logging code (for no good reason).
Make it the same and handle errors in same way as
other drivers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/sfc_efx/sfc_efx.c     | 11 ++---------
 drivers/common/sfc_efx/sfc_efx_log.h |  2 +-
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/common/sfc_efx/sfc_efx.c b/drivers/common/sfc_efx/sfc_efx.c
index 2dc5545760b8..5eeffb065b0d 100644
--- a/drivers/common/sfc_efx/sfc_efx.c
+++ b/drivers/common/sfc_efx/sfc_efx.c
@@ -15,7 +15,7 @@
 #include "sfc_efx_log.h"
 #include "sfc_efx.h"
 
-uint32_t sfc_efx_logtype;
+int sfc_efx_logtype;
 
 static int
 sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,
 	return rc;
 }
 
-RTE_INIT(sfc_efx_register_logtype)
-{
-	int ret;
-
-	ret = rte_log_register_type_and_pick_level("pmd.common.sfc_efx",
-						   RTE_LOG_NOTICE);
-	sfc_efx_logtype = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
-}
+RTE_LOG_REGISTER_DEFAULT(sfc_efx_logtype, NOTICE);
diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h
index 694455c1b14e..1519ebdc175f 100644
--- a/drivers/common/sfc_efx/sfc_efx_log.h
+++ b/drivers/common/sfc_efx/sfc_efx_log.h
@@ -11,7 +11,7 @@
 #define _SFC_EFX_LOG_H_
 
 /** Generic driver log type */
-extern uint32_t sfc_efx_logtype;
+extern int sfc_efx_logtype;
 
 /** Log message, add a prefix and a line break */
 #define SFC_EFX_LOG(level, ...) \
-- 
2.42.0


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

* [PATCH 21/26] common/dpaax: do not use PMD logtype
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (19 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 20/26] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 22/26] basband/la12xx: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Use existing dpaax_logger log type instead of PMD.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/dpaax/caamflib/compat.h | 5 ++++-
 drivers/common/dpaax/version.map       | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/common/dpaax/caamflib/compat.h b/drivers/common/dpaax/caamflib/compat.h
index 9776eed437ad..64ccdca95058 100644
--- a/drivers/common/dpaax/caamflib/compat.h
+++ b/drivers/common/dpaax/caamflib/compat.h
@@ -40,11 +40,14 @@
 #define __maybe_unused __rte_unused
 #endif
 
+extern int dpaax_logger;
+
 #if defined(SUPPRESS_PRINTS)
 #define pr_msg(l, fmt, ...) do { } while (0)
 #else
 #define pr_msg(l, fmt, ...) \
-	RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
+	rte_log(RTE_LOG_ ## l, dpaax_logger, "%s(): " fmt "\n", \
+		__func__, ##__VA_ARGS__)
 #endif
 
 #if !defined(pr_debug)
diff --git a/drivers/common/dpaax/version.map b/drivers/common/dpaax/version.map
index ee1ca6801c81..d48a6b6f37ee 100644
--- a/drivers/common/dpaax/version.map
+++ b/drivers/common/dpaax/version.map
@@ -6,6 +6,7 @@ INTERNAL {
 	dpaax_iova_table_p;
 	dpaax_iova_table_populate;
 	dpaax_iova_table_update;
+	dpaax_logger;
 	of_device_is_available;
 	of_device_is_compatible;
 	of_find_compatible_node;
-- 
2.42.0


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

* [PATCH 22/26] basband/la12xx: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (20 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 21/26] common/dpaax: do not use " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 23/26] bus/cdx: " Stephen Hemminger
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
index 452435ccb942..922eb601c61c 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
+++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
@@ -23,6 +23,6 @@ extern int bbdev_la12xx_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define rte_bbdev_dp_log(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt, ## args)
 
 #endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
-- 
2.42.0


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

* [PATCH 23/26] bus/cdx: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (21 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 22/26] basband/la12xx: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 24/26] bus/fslmc: " Stephen Hemminger
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Nipun Gupta, Nikhil Agarwal

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/cdx/cdx_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/cdx/cdx_logs.h b/drivers/bus/cdx/cdx_logs.h
index a1046ce544a6..e432fae00e4d 100644
--- a/drivers/bus/cdx/cdx_logs.h
+++ b/drivers/bus/cdx/cdx_logs.h
@@ -25,7 +25,7 @@ extern int cdx_logtype_bus;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define CDX_BUS_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, cdx_logtype_bus, fmt, ## args)
 
 #define CDX_BUS_DP_DEBUG(fmt, args...) \
 	CDX_BUS_DP_LOG(DEBUG, fmt, ## args)
-- 
2.42.0


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

* [PATCH 24/26] bus/fslmc: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (22 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 23/26] bus/cdx: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 25/26] dma/dpaa, dma/dpaa2: " Stephen Hemminger
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/fslmc/fslmc_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/fslmc/fslmc_logs.h b/drivers/bus/fslmc/fslmc_logs.h
index a1e14dd84e9a..edd74af04d7c 100644
--- a/drivers/bus/fslmc/fslmc_logs.h
+++ b/drivers/bus/fslmc/fslmc_logs.h
@@ -27,7 +27,7 @@ extern int dpaa2_logtype_bus;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_BUS_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, dpaa2_logtype_bus, fmt, ## args)
 
 #define DPAA2_BUS_DP_DEBUG(fmt, args...) \
 	DPAA2_BUS_DP_LOG(DEBUG, fmt, ## args)
-- 
2.42.0


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

* [PATCH 25/26] dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (23 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 24/26] bus/fslmc: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  1:42 ` [PATCH 26/26] mempool/dpaa, mempool/dpaa2: do not use logtype PMD Stephen Hemminger
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Sachin Saxena, Hemant Agrawal

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/dma/dpaa/dpaa_qdma_logs.h   | 5 +++--
 drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/dpaa/dpaa_qdma_logs.h b/drivers/dma/dpaa/dpaa_qdma_logs.h
index 762598f8f72f..169fbf364265 100644
--- a/drivers/dma/dpaa/dpaa_qdma_logs.h
+++ b/drivers/dma/dpaa/dpaa_qdma_logs.h
@@ -25,8 +25,9 @@ extern int dpaa_qdma_logtype;
 	DPAA_QDMA_LOG(WARNING, fmt, ## args)
 
 /* DP Logs, toggled out at compile time if level lower than current level */
-#define DPAA_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args)
+#define DPAA_QDMA_DP_LOG(level, fmt, args...)			\
+	rte_log_dp(RTE_LOG_ ## level, dpaa_qdma_logtype,	\
+		   "dpaa_qdma: " fmt "\n", ## args)
 
 #define DPAA_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/dma/dpaa2/dpaa2_qdma_logs.h b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
index a46b8f24b5a7..52514c2dcc91 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma_logs.h
+++ b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
@@ -30,7 +30,8 @@ extern int dpaa2_qdma_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa2_qdma: " fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_qdma_logtype, \
+		   "dpaa2_qdma: " fmt "\n", ## args)
 
 #define DPAA2_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
-- 
2.42.0


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

* [PATCH 26/26] mempool/dpaa, mempool/dpaa2: do not use logtype PMD
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (24 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 25/26] dma/dpaa, dma/dpaa2: " Stephen Hemminger
@ 2023-12-13  1:42 ` Stephen Hemminger
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  1:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

The driver already has a logtype, just not consistently used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/mempool/dpaa/dpaa_mempool.h           | 2 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c      | 4 ++--
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 3f0eafa7dd7b..ca97da46910c 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -67,7 +67,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;
 #define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
 
 #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \
-	RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_DEBUG, dpaa_logtype_mempool, fmt, ## args)
 #define DPAA_MEMPOOL_DEBUG(fmt, args...) \
 	DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args)
 #define DPAA_MEMPOOL_ERR(fmt, args...) \
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 84371d5d1abb..e3983d34c25c 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_LOG(ERR, "DPAA2 buffer pool not configured\n");
 		return -ENOMEM;
 	}
 
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_LOG(ERR, "DPAA2 buffer pool not configured");
 		return NULL;
 	}
 
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
index 986264319623..2f4fe0ba4209 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
@@ -25,7 +25,7 @@ extern int dpaa2_logtype_mempool;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_mempool, fmt, ## args)
 
 #define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \
 	DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
-- 
2.42.0


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

* RE: [PATCH 10/26] net/igc: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 ` [PATCH 10/26] net/igc: " Stephen Hemminger
@ 2023-12-13  2:36   ` Guo, Junfeng
  0 siblings, 0 replies; 214+ messages in thread
From: Guo, Junfeng @ 2023-12-13  2:36 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Su, Simei



> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Wednesday, December 13, 2023 09:42
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Guo, Junfeng
> <junfeng.guo@intel.com>; Su, Simei <simei.su@intel.com>
> Subject: [PATCH 10/26] net/igc: replace RTE_LOG_DP with rte_log_dp
> 
> Want datapath logs to use own logtype.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Looks good to me, thanks for improving the code!
Maybe better also cc to the stable?

Acked-by: Junfeng Guo <junfeng.guo@intel.com>

Regards,
Junfeng Guo

> ---
>  drivers/net/igc/igc_logs.h | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> --
> 2.42.0

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

* Re: [PATCH 05/26] net/bnxt: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  1:42 ` [PATCH 05/26] net/bnxt: " Stephen Hemminger
@ 2023-12-13  3:07   ` Somnath Kotur
  0 siblings, 0 replies; 214+ messages in thread
From: Somnath Kotur @ 2023-12-13  3:07 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, Ajit Khaparde, Ruifeng Wang, Bruce Richardson, Konstantin Ananyev

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

On Wed, Dec 13, 2023 at 7:14 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Want datapath logs to use own logtype.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/net/bnxt/bnxt.h               | 5 +++++
>  drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +--
>  drivers/net/bnxt/bnxt_rxtx_vec_sse.c  | 3 +--
>  drivers/net/bnxt/bnxt_txr.c           | 4 +---
>  4 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
> index 0e01b1d4baea..3aa9213a12f9 100644
> --- a/drivers/net/bnxt/bnxt.h
> +++ b/drivers/net/bnxt/bnxt.h
> @@ -1058,6 +1058,11 @@ extern int bnxt_logtype_driver;
>  #define PMD_DRV_LOG(level, fmt, args...) \
>           PMD_DRV_LOG_RAW(level, fmt, ## args)
>
> +#define PMD_DRV_LOG_DP(level, fmt, args...)                    \
> +       rte_log_dp(RTE_LOG_ ## level, bnxt_logtype_driver,      \
> +                  fmt, ## args)
> +
> +
>  extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;
>  int32_t bnxt_ulp_port_init(struct bnxt *bp);
>  void bnxt_ulp_port_deinit(struct bnxt *bp);
> diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
> index aa1b1ab8bb7e..64c1dfac47d9 100644
> --- a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
> +++ b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
> @@ -357,8 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
>                 if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
>                         nb_tx_pkts += txcmp->opaque;
>                 else
> -                       RTE_LOG_DP(ERR, PMD,
> -                                  "Unhandled CMP type %02x\n",
> +                       PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n",
>                                    CMP_TYPE(txcmp));
>                 raw_cons = NEXT_RAW_CMP(raw_cons);
>         } while (nb_tx_pkts < ring_mask);
> diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
> index e99a547f5857..572b21a00837 100644
> --- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
> +++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
> @@ -326,8 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
>                 if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
>                         nb_tx_pkts += txcmp->opaque;
>                 else
> -                       RTE_LOG_DP(ERR, PMD,
> -                                  "Unhandled CMP type %02x\n",
> +                       PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n",
>                                    CMP_TYPE(txcmp));
>                 raw_cons = NEXT_RAW_CMP(raw_cons);
>         } while (nb_tx_pkts < ring_mask);
> diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
> index 899986764f93..bd0a75653ab3 100644
> --- a/drivers/net/bnxt/bnxt_txr.c
> +++ b/drivers/net/bnxt/bnxt_txr.c
> @@ -542,9 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
>                 if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
>                         nb_tx_pkts += opaque;
>                 else
> -                       RTE_LOG_DP(ERR, PMD,
> -                                       "Unhandled CMP type %02x\n",
> -                                       CMP_TYPE(txcmp));
> +                       PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n", CMP_TYPE(txcmp));
>                 raw_cons = NEXT_RAW_CMP(raw_cons);
>         } while (nb_tx_pkts < ring_mask);
>
> --
> 2.42.0
>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]

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

* [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (25 preceding siblings ...)
  2023-12-13  1:42 ` [PATCH 26/26] mempool/dpaa, mempool/dpaa2: do not use logtype PMD Stephen Hemminger
@ 2023-12-13  4:16 ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 01/25] log: fix doc comment for RTE_LOG_DP() Stephen Hemminger
                     ` (25 more replies)
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                   ` (5 subsequent siblings)
  32 siblings, 26 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a leftover and should be removed.
As a first step, fix many drivers to not use it, and add a
helper for the RTE_LOG_DP(). 

Most of this patchset is boiler plate but there were some
places where use of PMD type snuck in with changes to
original driver and get fixed here.

More work is needed before PMD logtype can be retired.

v2 - fix some typos from v1 from CI

Stephen Hemminger (25):
  log: fix doc comment for RTE_LOG_DP()
  log: add rte_log_dp()
  net/atlantic: replace RTE_LOG_DP with rte_log_dp
  net/avp: replace RTE_LOG_DP with rte_log_dp
  net/bnxt: replace RTE_LOG_DP with rte_log_dp
  net/dpaa: replace RTE_LOG_DP with rte_log_dp
  net/dpaa2: replace RTE_LOG_DP with rte_log_dp
  net/enetc, net/enetfec: replace RTE_LOG_DP with rte_log_dp
  net/igc: replace RTE_LOG_DP with rte_log_dp
  net/mana: replace RTE_LOG_DP with rte_log_dp
  net/mvpp2: do not use PMD logtype
  net/octeon_ep: replace RTE_LOG_DP with rte_log_dp
  net/pfe: replace RTE_LOG_DP with rte_log_dp
  net/qede: replace RTE_LOG_DP with rte_log_dp
  net/virtio: replace RTE_LOG_DP with rte_log_dp
  net/vmxnet3: do not use PMD logtype
  common/cnxk: replace RTE_LOG_DP with rte_log_dp
  common/cpt: replace RTE_LOG_DP with rte_log_dp
  common/sfc_efx: remove use of PMD logtype
  common/dpaax: do not use PMD logtype
  basband/la12xx: replace RTE_LOG_DP with rte_log_dp
  bus/cdx: replace RTE_LOG_DP with rte_log_dp
  bus/fslmc: replace RTE_LOG_DP with rte_log_dp
  dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
  mempool/dpaa, mempool/dpaa2: do not use logtype PMD

 .../baseband/la12xx/bbdev_la12xx_pmd_logs.h   |  2 +-
 drivers/bus/cdx/cdx_logs.h                    |  2 +-
 drivers/bus/fslmc/fslmc_logs.h                |  2 +-
 drivers/common/cnxk/roc_platform.h            | 28 ++++++++++---------
 drivers/common/cpt/cpt_pmd_logs.h             |  2 +-
 drivers/common/dpaax/caamflib/compat.h        |  5 +++-
 drivers/common/dpaax/dpaax_logs.h             |  2 +-
 drivers/common/dpaax/version.map              |  1 +
 drivers/common/sfc_efx/sfc_efx.c              | 11 ++------
 drivers/common/sfc_efx/sfc_efx_log.h          |  2 +-
 drivers/dma/dpaa/dpaa_qdma_logs.h             |  5 ++--
 drivers/dma/dpaa2/dpaa2_qdma_logs.h           |  3 +-
 drivers/mempool/dpaa/dpaa_mempool.h           |  2 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c      |  4 +--
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h |  2 +-
 drivers/net/atlantic/atl_logs.h               | 15 +++++-----
 drivers/net/avp/avp_logs.h                    | 20 +++++++------
 drivers/net/bnxt/bnxt.h                       |  5 ++++
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c         |  3 +-
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c          |  3 +-
 drivers/net/bnxt/bnxt_txr.c                   |  4 +--
 drivers/net/dpaa/dpaa_ethdev.c                |  4 +--
 drivers/net/dpaa/dpaa_ethdev.h                |  2 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |  2 +-
 drivers/net/dpaa2/dpaa2_pmd_logs.h            |  2 +-
 drivers/net/dpaa2/dpaa2_sparser.c             |  4 +--
 drivers/net/enetc/enetc_logs.h                |  2 +-
 drivers/net/enetfec/enet_pmd_logs.h           |  2 +-
 drivers/net/igc/igc_logs.h                    | 10 ++++---
 drivers/net/mana/mana.h                       |  2 +-
 drivers/net/mvpp2/mrvl_ethdev.c               |  4 +--
 drivers/net/octeon_ep/otx_ep_common.h         |  7 +++++
 drivers/net/octeon_ep/otx_ep_rxtx.c           |  5 ++--
 drivers/net/octeontx/octeontx_logs.h          |  3 +-
 drivers/net/pfe/pfe_logs.h                    |  2 +-
 drivers/net/qede/qede_logs.h                  | 10 ++++---
 drivers/net/virtio/virtio_logs.h              | 16 ++++++-----
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |  2 +-
 drivers/net/vmxnet3/vmxnet3_logs.h            | 12 +++++---
 lib/log/rte_log.h                             | 26 +++++++++++++++--
 40 files changed, 140 insertions(+), 100 deletions(-)

-- 
2.42.0


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

* [PATCH v2 01/25] log: fix doc comment for RTE_LOG_DP()
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 02/25] log: add rte_log_dp() Stephen Hemminger
                     ` (24 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Olivier Matz

The macro does not return a numeric status, only void.

Fixes: 5d8f0baf69ea ("log: do not drop debug logs at compile time")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/log/rte_log.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 4d207b8da2cd..bbbb051c20e2 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -348,9 +348,6 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
  * @param ...
  *   The fmt string, as in printf(3), followed by the variable arguments
  *   required by the format.
- * @return
- *   - 0: Success.
- *   - Negative on error.
  */
 #define RTE_LOG_DP(l, t, ...)					\
 	(void)((RTE_LOG_ ## l <= RTE_LOG_DP_LEVEL) ?		\
-- 
2.42.0


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

* [PATCH v2 02/25] log: add rte_log_dp()
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 01/25] log: fix doc comment for RTE_LOG_DP() Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 03/25] net/atlantic: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                     ` (23 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Add a new macro for logging in datapath using a logtype.
The existing macro RTE_LOG_DP() takes log type suffix (i.e. PMD)
like RTE_LOG(). This macro allows using a dynamic type.

Ideally, rte_log_dp() could be an always_inline function
but GCC and Clang will not inline a function with variable number
of arguments. Therefore it has to be a macro.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/log/rte_log.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index bbbb051c20e2..8eb2b38b1a9f 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -355,6 +355,29 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
 		 RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) :	\
 	 0)
 
+/**
+ * Generates a log message for data path.
+ *
+ * Similar to rte_log(), except that it gets optimized away
+ * if the RTE_LOG_DP_LEVEL configuration option is lower than the log
+ * level argument.
+ *
+ * @param level
+ *   Log level. A value between RTE_LOG_EMERG (1) and RTE_LOG_DEBUG (8).
+ * @param logtype
+ *   The log type, for example, RTE_LOGTYPE_EAL.
+ * @param format
+ *   The format string, as in printf(3), followed by the variable arguments
+ *   required by the format.
+ * @param ap
+ *   The va_list of the variable arguments required by the format.
+ */
+#define rte_log_dp(lev, t, ...)				\
+	do {						\
+		if (lev <= RTE_LOG_DP_LEVEL)		\
+			rte_log(lev, t, __VA_ARGS__);	\
+	} while(0)
+
 #define RTE_LOG_REGISTER_IMPL(type, name, level)			    \
 int type;								    \
 RTE_INIT(__##type)							    \
-- 
2.42.0


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

* [PATCH v2 03/25] net/atlantic: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 01/25] log: fix doc comment for RTE_LOG_DP() Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 02/25] log: add rte_log_dp() Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 04/25] net/avp: " Stephen Hemminger
                     ` (22 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Igor Russkikh

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/atlantic/atl_logs.h | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/atlantic/atl_logs.h b/drivers/net/atlantic/atl_logs.h
index e3dba334fe92..c2a3a6320c58 100644
--- a/drivers/net/atlantic/atl_logs.h
+++ b/drivers/net/atlantic/atl_logs.h
@@ -14,18 +14,19 @@ extern int atl_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-
 extern int atl_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, atl_logtype_driver, fmt "\n", \
+		   ## args)
+
+#define PMD_RX_LOG(level, fmt, args...) \
+	PMD_DRV_LOG(level, fmt, ## args)
+
+#define PMD_TX_LOG(level, fmt, args...) \
+	PMD_DRV_LOG(level, fmt, ## args)
 
 #endif
-- 
2.42.0


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

* [PATCH v2 04/25] net/avp: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (2 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 03/25] net/atlantic: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 05/25] net/bnxt: " Stephen Hemminger
                     ` (21 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Steven Webster, Matt Peters

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/avp/avp_logs.h | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/avp/avp_logs.h b/drivers/net/avp/avp_logs.h
index 6e297c7a4a81..0ae95a7685c5 100644
--- a/drivers/net/avp/avp_logs.h
+++ b/drivers/net/avp/avp_logs.h
@@ -7,24 +7,26 @@
 
 #include <rte_log.h>
 
+
+extern int avp_logtype_driver;
+
+#define PMD_DRV_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
+		"%s(): " fmt, __func__, ## args)
+
 #ifdef RTE_LIBRTE_AVP_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() rx: " fmt, __func__, ## args)
+	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
+		"%s() rx: " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_AVP_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() tx: " fmt, __func__, ## args)
+	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
+		"%s() tx: " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
-
-extern int avp_logtype_driver;
-
-#define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
-		"%s(): " fmt, __func__, ## args)
-
 #endif /* _AVP_LOGS_H_ */
-- 
2.42.0


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

* [PATCH v2 05/25] net/bnxt: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (3 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 04/25] net/avp: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 06/25] net/dpaa: " Stephen Hemminger
                     ` (20 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Somnath Kotur, Ajit Khaparde, Ruifeng Wang,
	Bruce Richardson, Konstantin Ananyev

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt.h               | 5 +++++
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +--
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c  | 3 +--
 drivers/net/bnxt/bnxt_txr.c           | 4 +---
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 0e01b1d4baea..3aa9213a12f9 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -1058,6 +1058,11 @@ extern int bnxt_logtype_driver;
 #define PMD_DRV_LOG(level, fmt, args...) \
 	  PMD_DRV_LOG_RAW(level, fmt, ## args)
 
+#define PMD_DRV_LOG_DP(level, fmt, args...)			\
+	rte_log_dp(RTE_LOG_ ## level, bnxt_logtype_driver,	\
+		   fmt, ## args)
+
+
 extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;
 int32_t bnxt_ulp_port_init(struct bnxt *bp);
 void bnxt_ulp_port_deinit(struct bnxt *bp);
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
index aa1b1ab8bb7e..64c1dfac47d9 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
@@ -357,8 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
-				   "Unhandled CMP type %02x\n",
+			PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index e99a547f5857..572b21a00837 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -326,8 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
-				   "Unhandled CMP type %02x\n",
+			PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 899986764f93..bd0a75653ab3 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -542,9 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
 		if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
 			nb_tx_pkts += opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
-					"Unhandled CMP type %02x\n",
-					CMP_TYPE(txcmp));
+			PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n", CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
 
-- 
2.42.0


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

* [PATCH v2 06/25] net/dpaa: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (4 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 05/25] net/bnxt: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 07/25] net/dpaa2: " Stephen Hemminger
                     ` (19 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa/dpaa_ethdev.c | 4 ++--
 drivers/net/dpaa/dpaa_ethdev.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index ef4c06db6a4d..0d0d493f3a6d 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -2096,7 +2096,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 	/* copy the primary mac address */
 	rte_ether_addr_copy(&fman_intf->mac_addr, &eth_dev->data->mac_addrs[0]);
 
-	RTE_LOG(INFO, PMD, "net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n",
+	DPAA_PMD_INFO("dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT,
 		dpaa_device->name, RTE_ETHER_ADDR_BYTES(&fman_intf->mac_addr));
 
 	if (!fman_intf->is_shared_mac) {
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 
 		ret = dpaa_dev_init_secondary(eth_dev);
 		if (ret != 0) {
-			RTE_LOG(ERR, PMD, "secondary dev init failed\n");
+			DPAA_PMD_ERR("secondary dev init failed");
 			return ret;
 		}
 
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 5b6802ece8f0..ced3e5f8ff98 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -232,6 +232,6 @@ extern int dpaa_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa_logtype_pmd, fmt, ## args)
 
 #endif
-- 
2.42.0


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

* [PATCH v2 07/25] net/dpaa2: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (5 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 06/25] net/dpaa: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 08/25] net/enetc, net/enetfec: " Stephen Hemminger
                     ` (18 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa2/dpaa2_ethdev.c   | 2 +-
 drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +-
 drivers/net/dpaa2/dpaa2_sparser.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 8e610b6bba30..71d57ab26062 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 			return ret;
 		}
 	}
-	RTE_LOG(INFO, PMD, "%s: netdev created, connected to %s\n",
+	DPAA2_PMD_INFO("%s: netdev created, connected to %s\n",
 		eth_dev->data->name, dpaa2_dev->ep_name);
 
 	return 0;
diff --git a/drivers/net/dpaa2/dpaa2_pmd_logs.h b/drivers/net/dpaa2/dpaa2_pmd_logs.h
index c47ba8e10bfc..89bffc684e50 100644
--- a/drivers/net/dpaa2/dpaa2_pmd_logs.h
+++ b/drivers/net/dpaa2/dpaa2_pmd_logs.h
@@ -28,7 +28,7 @@ extern int dpaa2_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_pmd, fmt, ## args)
 
 #define DPAA2_PMD_DP_DEBUG(fmt, args...) \
 	DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/dpaa2/dpaa2_sparser.c b/drivers/net/dpaa2/dpaa2_sparser.c
index 63463c4fbfd6..202996c5d05d 100644
--- a/drivers/net/dpaa2/dpaa2_sparser.c
+++ b/drivers/net/dpaa2/dpaa2_sparser.c
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 
 	priv->ss_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(addr));
 	priv->ss_offset += sp_param.size;
-	RTE_LOG(INFO, PMD, "Soft parser loaded for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser loaded for dpni@%d\n", priv->hw_id);
 
 	rte_free(addr);
 	return 0;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 	}
 
 	rte_free(param_addr);
-	RTE_LOG(INFO, PMD, "Soft parser enabled for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser enabled for dpni@%d\n", priv->hw_id);
 	return 0;
 }
-- 
2.42.0


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

* [PATCH v2 08/25] net/enetc, net/enetfec: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (6 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 07/25] net/dpaa2: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 09/25] net/igc: " Stephen Hemminger
                     ` (17 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Sachin Saxena, Apeksha Gupta

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/enetc/enetc_logs.h      | 2 +-
 drivers/net/enetfec/enet_pmd_logs.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/enetc/enetc_logs.h b/drivers/net/enetc/enetc_logs.h
index 0976d42debd7..05a540f16490 100644
--- a/drivers/net/enetc/enetc_logs.h
+++ b/drivers/net/enetc/enetc_logs.h
@@ -30,7 +30,7 @@ extern int enetc_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETC_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, enetc_logtype_pmd, fmt, ## args)
 
 #define ENETC_PMD_DP_DEBUG(fmt, args...) \
 	ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/enetfec/enet_pmd_logs.h b/drivers/net/enetfec/enet_pmd_logs.h
index 72d1cb61c598..c0a226284c53 100644
--- a/drivers/net/enetfec/enet_pmd_logs.h
+++ b/drivers/net/enetfec/enet_pmd_logs.h
@@ -28,6 +28,6 @@ extern int enetfec_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETFEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, enetfec_logtype_pmd, fmt, ## args)
 
 #endif /* _ENETFEC_LOGS_H_ */
-- 
2.42.0


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

* [PATCH v2 09/25] net/igc: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (7 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 08/25] net/enetc, net/enetfec: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 10/25] net/mana: " Stephen Hemminger
                     ` (16 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Junfeng Guo, Simei Su

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
---
 drivers/net/igc/igc_logs.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 11071a32b542..ffa1981bae32 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -21,15 +21,17 @@ extern int igc_logtype_driver;
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_ETHDEV_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_RX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, igc_logtype_driver,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_TX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, igc_logtype_driver,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
-- 
2.42.0


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

* [PATCH v2 10/25] net/mana: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (8 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 09/25] net/igc: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13 19:16     ` Long Li
  2023-12-13  4:16   ` [PATCH v2 11/25] net/mvpp2: do not use PMD logtype Stephen Hemminger
                     ` (15 subsequent siblings)
  25 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Long Li

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mana/mana.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index 6836872dc257..8d60f9172d44 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -467,7 +467,7 @@ extern int mana_logtype_init;
 		__func__, ## args)
 
 #define DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, mana_logtype_driver, fmt "\n", ## args)
 
 #define PMD_INIT_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
-- 
2.42.0


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

* [PATCH v2 11/25] net/mvpp2: do not use PMD logtype
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (9 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 10/25] net/mana: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 12/25] net/octeon_ep: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                     ` (14 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Liron Himi, Yelena Krivosheev, Natalie Samsonov

The driver already has a logtype but it was not being used
in one place.

Fixes: 9e79d810911d ("net/mvpp2: support Tx scatter/gather")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index c12364941d62..9a9279a8783a 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)
 
 	/* Use a simple Tx queue (no offloads, no multi segs) if possible */
 	if (priv->multiseg) {
-		RTE_LOG(INFO, PMD, "Using multi-segment tx callback\n");
+		MRVL_LOG(INFO, "Using multi-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst;
 	} else {
-		RTE_LOG(INFO, PMD, "Using single-segment tx callback\n");
+		MRVL_LOG(INFO, "Using single-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_pkt_burst;
 	}
 }
-- 
2.42.0


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

* [PATCH v2 12/25] net/octeon_ep: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (10 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 11/25] net/mvpp2: do not use PMD logtype Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 13/25] net/pfe: " Stephen Hemminger
                     ` (13 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Vamsi Attunuru

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/octeon_ep/otx_ep_common.h | 7 +++++++
 drivers/net/octeon_ep/otx_ep_rxtx.c   | 5 ++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
index 82e57520d38d..5fb63d051ac8 100644
--- a/drivers/net/octeon_ep/otx_ep_common.h
+++ b/drivers/net/octeon_ep/otx_ep_common.h
@@ -81,6 +81,13 @@
 		"%s():%u " fmt "\n",				\
 		__func__, __LINE__, ##args)
 
+#define otx_ep_log_dp(level, fmt, args...)			\
+	rte_log_dp(RTE_LOG_ ## level, otx_net_ep_logtype,	\
+		   "%s():%u " fmt "\n",				\
+		   __func__, __LINE__, ##args)
+
+
+
 /* IO Access */
 #define oct_ep_read64(addr) rte_read64_relaxed((void *)(addr))
 #define oct_ep_write64(val, addr) rte_write64_relaxed((val), (void *)(addr))
diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c
index c421ef0a1c04..fe8885be54ff 100644
--- a/drivers/net/octeon_ep/otx_ep_rxtx.c
+++ b/drivers/net/octeon_ep/otx_ep_rxtx.c
@@ -884,9 +884,8 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		next_fetch = (pkts == new_pkts - 1) ? 0 : 1;
 		oq_pkt = otx_ep_droq_read_packet(otx_ep, droq, next_fetch);
 		if (!oq_pkt) {
-			RTE_LOG_DP(ERR, PMD,
-				   "DROQ read pkt failed pending %" PRIu64
-				    "last_pkt_count %" PRIu64 "new_pkts %d.\n",
+			otx_ep_log_dp(ERR, "DROQ read pkt failed pending %" PRIu64
+				    "last_pkt_count %" PRIu64 "new_pkts %d.",
 				   droq->pkts_pending, droq->last_pkt_count,
 				   new_pkts);
 			droq->stats.rx_err++;
-- 
2.42.0


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

* [PATCH v2 13/25] net/pfe: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (11 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 12/25] net/octeon_ep: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 14/25] net/qede: " Stephen Hemminger
                     ` (12 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Harman Kalra, Gagandeep Singh

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/octeontx/octeontx_logs.h | 3 +--
 drivers/net/pfe/pfe_logs.h           | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/octeontx/octeontx_logs.h b/drivers/net/octeontx/octeontx_logs.h
index dec8042c67ba..cec5346d5a8b 100644
--- a/drivers/net/octeontx/octeontx_logs.h
+++ b/drivers/net/octeontx/octeontx_logs.h
@@ -19,11 +19,10 @@
 	rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \
 			"%s(): " fmt "\n", __func__, ## args)
 
-#define octeontx_log_info(fmt, args...)			\
-	RTE_LOG(INFO, PMD, fmt "\n", ## args)
 
 #define octeontx_log_err(s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)
 #define octeontx_log_dbg(s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__)
+#define octeontx_log_info(s, ...) PMD_DRV_LOG(INFO, s, ##__VA_ARGS__)
 #define octeontx_mbox_log(s, ...) PMD_MBOX_LOG(DEBUG, s, ##__VA_ARGS__)
 
 #define PMD_RX_LOG	PMD_DRV_LOG
diff --git a/drivers/net/pfe/pfe_logs.h b/drivers/net/pfe/pfe_logs.h
index 58d5e8e7cff1..306bfc22ea54 100644
--- a/drivers/net/pfe/pfe_logs.h
+++ b/drivers/net/pfe/pfe_logs.h
@@ -26,6 +26,6 @@ extern int pfe_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define PFE_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ##level, pfe_logtype_pmd, fmt, ## args)
 
 #endif /* _PFE_LOGS_H_ */
-- 
2.42.0


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

* [PATCH v2 14/25] net/qede: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (12 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 13/25] net/pfe: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 15/25] net/virtio: " Stephen Hemminger
                     ` (11 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Devendra Singh Rawat, Alok Prasad

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/qede/qede_logs.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qede/qede_logs.h b/drivers/net/qede/qede_logs.h
index 3187d97bb7b0..f7aa14df7e3b 100644
--- a/drivers/net/qede/qede_logs.h
+++ b/drivers/net/qede/qede_logs.h
@@ -58,16 +58,18 @@ extern int qede_logtype_init;
 #define PMD_INIT_FUNC_TRACE(edev) PMD_INIT_LOG(DEBUG, edev, " >>")
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_TX
-#define PMD_TX_LOG(level, q, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \
+#define PMD_TX_LOG(level, q, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, qede_logtype_driver,		\
+		"%s(): port=%u queue=%u " fmt "\n",		\
 		__func__, q->port_id, q->queue_id, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_RX
-#define PMD_RX_LOG(level, q, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n",	\
+#define PMD_RX_LOG(level, q, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, qede_logtype_driver,		\
+		"%s(): port=%u queue=%u " fmt "\n",		\
 		__func__, q->port_id, q->queue_id, ## args)
 #else
 #define PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
-- 
2.42.0


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

* [PATCH v2 15/25] net/virtio: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (13 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 14/25] net/qede: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 16/25] net/vmxnet3: do not use PMD logtype Stephen Hemminger
                     ` (10 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Maxime Coquelin, Chenbo Xia

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/virtio/virtio_logs.h | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/virtio/virtio_logs.h b/drivers/net/virtio/virtio_logs.h
index 9b1b1defc5a6..0447ee961fb6 100644
--- a/drivers/net/virtio/virtio_logs.h
+++ b/drivers/net/virtio/virtio_logs.h
@@ -14,23 +14,25 @@ extern int virtio_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
+extern int virtio_logtype_driver;
+#define PMD_DRV_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
+		"%s(): " fmt "\n", __func__, ## args)
+
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
+		"%s() rx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
+		"%s() tx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
-extern int virtio_logtype_driver;
-#define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
-		"%s(): " fmt "\n", __func__, ## args)
-
 #endif /* _VIRTIO_LOGS_H_ */
-- 
2.42.0


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

* [PATCH v2 16/25] net/vmxnet3: do not use PMD logtype
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (14 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 15/25] net/virtio: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 17/25] common/cnxk: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                     ` (9 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Jochen Behrens

The driver used a slightly different (and older) format
for datapath logs. Remove PMD logtype here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  2 +-
 drivers/net/vmxnet3/vmxnet3_logs.h   | 12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index e49191718aea..4fd704045fc4 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)
 	if (events == 0)
 		goto done;
 
-	RTE_LOG(DEBUG, PMD, "Reading events: 0x%X", events);
+	PMD_DRV_LOG(DEBUG, "Reading events: 0x%X", events);
 	vmxnet3_process_events(dev);
 done:
 	vmxnet3_enable_intr(hw, *eventIntrIdx);
diff --git a/drivers/net/vmxnet3/vmxnet3_logs.h b/drivers/net/vmxnet3/vmxnet3_logs.h
index 74154e3a1a6d..058d704f82c9 100644
--- a/drivers/net/vmxnet3/vmxnet3_logs.h
+++ b/drivers/net/vmxnet3/vmxnet3_logs.h
@@ -11,28 +11,32 @@ extern int vmxnet3_logtype_init;
 		"%s(): " fmt "\n", __func__, ## args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
+extern int vmxnet3_logtype_driver;
+
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
+		 "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
+		 "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE
 #define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
+		 "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
 #endif
 
-extern int vmxnet3_logtype_driver;
 #define PMD_DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
 		"%s(): " fmt "\n", __func__, ## args)
-- 
2.42.0


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

* [PATCH v2 17/25] common/cnxk: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (15 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 16/25] net/vmxnet3: do not use PMD logtype Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 18/25] common/cpt: " Stephen Hemminger
                     ` (8 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/cnxk/roc_platform.h | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index ba23b2e0d79e..9461f6e93304 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;
 extern int cnxk_logtype_ree;
 extern int cnxk_logtype_dpi;
 
-#define plt_err(fmt, args...)                                                  \
-	RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
-#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args)
-#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
+#define plt_log(level, fmt, args...)					\
+	rte_log(RTE_LOG_ ## level, cnxk_logtype_base,			\
+		"%s():%u " fmt "\n", __func__, __LINE__, ##args)
+#define plt_err(fmt, ...) plt_log(ERR, fmt, ##__VA_ARGS__)
+#define plt_info(fmt, ...) plt_log(INFO, fmt, ##__VA_ARGS__)
+#define plt_warn(fmt, ...) plt_log(WARNING, fmt, ##__VA_ARGS__)
+#define plt_print(fmt, ...) plt_log(INFO, fmt,  ##__VA_ARGS__)
 #define plt_dump(fmt, ...)      fprintf(stderr, fmt "\n", ##__VA_ARGS__)
 #define plt_dump_no_nl(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
 
@@ -278,8 +280,7 @@ extern int cnxk_logtype_dpi;
  */
 #define plt_dbg(subsystem, fmt, args...)                                       \
 	rte_log(RTE_LOG_DEBUG, cnxk_logtype_##subsystem,                       \
-		"[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__,      \
-##args)
+		"[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__, ##args)
 
 #define plt_base_dbg(fmt, ...)	plt_dbg(base, fmt, ##__VA_ARGS__)
 #define plt_cpt_dbg(fmt, ...)	plt_dbg(cpt, fmt, ##__VA_ARGS__)
@@ -295,12 +296,13 @@ extern int cnxk_logtype_dpi;
 #define plt_dpi_dbg(fmt, ...)	plt_dbg(dpi, fmt, ##__VA_ARGS__)
 
 /* Datapath logs */
-#define plt_dp_err(fmt, args...)                                               \
-	RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_dp_info(fmt, args...)                                              \
-	RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_dp_dbg(fmt, args...)                                              \
-	RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+#define plt_dp_log(level, fmt, args...)					\
+	rte_log_dp(RTE_LOG_ ## level, cnxk_logtype_base,		\
+		"%s():%u " fmt "\n", __func__, __LINE__, ## args)
+
+#define plt_dp_err(fmt, ...)  plt_dp_log(ERR, fmt, ##__VA_ARGS__)
+#define plt_dp_info(fmt, ...) plt_dp_log(INFO, fmt, ##__VA_ARGS__)
+#define plt_dp_dbg(fmt, ...)  plt_dp_log(DEBUG, fmt, ##__VA_ARGS__)
 
 #ifdef __cplusplus
 #define CNXK_PCI_ID(subsystem_dev, dev)                                        \
-- 
2.42.0


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

* [PATCH v2 18/25] common/cpt: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (16 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 17/25] common/cnxk: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 19/25] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
                     ` (7 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Anoob Joseph

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/cpt/cpt_pmd_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/cpt/cpt_pmd_logs.h b/drivers/common/cpt/cpt_pmd_logs.h
index 174326c6ce38..6b78fcb6b6fc 100644
--- a/drivers/common/cpt/cpt_pmd_logs.h
+++ b/drivers/common/cpt/cpt_pmd_logs.h
@@ -34,7 +34,7 @@
  * level of 'pmd' has to be used.
  */
 #define CPT_LOG_DP(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, CPT_LOGTYPE, fmt "\n", ## args)
 
 #define CPT_LOG_DP_DEBUG(fmt, args...) \
 	CPT_LOG_DP(DEBUG, fmt, ## args)
-- 
2.42.0


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

* [PATCH v2 19/25] common/sfc_efx: remove use of PMD logtype
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (17 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 18/25] common/cpt: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 20/25] common/dpaax: do not use " Stephen Hemminger
                     ` (6 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Andrew Rybchenko

This code was implemented in a slightly different manner
than all the other logging code (for no good reason).
Make it the same and handle errors in same way as
other drivers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/sfc_efx/sfc_efx.c     | 11 ++---------
 drivers/common/sfc_efx/sfc_efx_log.h |  2 +-
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/common/sfc_efx/sfc_efx.c b/drivers/common/sfc_efx/sfc_efx.c
index 2dc5545760b8..5eeffb065b0d 100644
--- a/drivers/common/sfc_efx/sfc_efx.c
+++ b/drivers/common/sfc_efx/sfc_efx.c
@@ -15,7 +15,7 @@
 #include "sfc_efx_log.h"
 #include "sfc_efx.h"
 
-uint32_t sfc_efx_logtype;
+int sfc_efx_logtype;
 
 static int
 sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,
 	return rc;
 }
 
-RTE_INIT(sfc_efx_register_logtype)
-{
-	int ret;
-
-	ret = rte_log_register_type_and_pick_level("pmd.common.sfc_efx",
-						   RTE_LOG_NOTICE);
-	sfc_efx_logtype = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
-}
+RTE_LOG_REGISTER_DEFAULT(sfc_efx_logtype, NOTICE);
diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h
index 694455c1b14e..1519ebdc175f 100644
--- a/drivers/common/sfc_efx/sfc_efx_log.h
+++ b/drivers/common/sfc_efx/sfc_efx_log.h
@@ -11,7 +11,7 @@
 #define _SFC_EFX_LOG_H_
 
 /** Generic driver log type */
-extern uint32_t sfc_efx_logtype;
+extern int sfc_efx_logtype;
 
 /** Log message, add a prefix and a line break */
 #define SFC_EFX_LOG(level, ...) \
-- 
2.42.0


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

* [PATCH v2 20/25] common/dpaax: do not use PMD logtype
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (18 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 19/25] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 21/25] basband/la12xx: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                     ` (5 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Use existing dpaax_logger log type instead of PMD.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/dpaax/caamflib/compat.h | 5 ++++-
 drivers/common/dpaax/dpaax_logs.h      | 2 +-
 drivers/common/dpaax/version.map       | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/common/dpaax/caamflib/compat.h b/drivers/common/dpaax/caamflib/compat.h
index 9776eed437ad..64ccdca95058 100644
--- a/drivers/common/dpaax/caamflib/compat.h
+++ b/drivers/common/dpaax/caamflib/compat.h
@@ -40,11 +40,14 @@
 #define __maybe_unused __rte_unused
 #endif
 
+extern int dpaax_logger;
+
 #if defined(SUPPRESS_PRINTS)
 #define pr_msg(l, fmt, ...) do { } while (0)
 #else
 #define pr_msg(l, fmt, ...) \
-	RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
+	rte_log(RTE_LOG_ ## l, dpaax_logger, "%s(): " fmt "\n", \
+		__func__, ##__VA_ARGS__)
 #endif
 
 #if !defined(pr_debug)
diff --git a/drivers/common/dpaax/dpaax_logs.h b/drivers/common/dpaax/dpaax_logs.h
index 180476f6757c..cec99a674056 100644
--- a/drivers/common/dpaax/dpaax_logs.h
+++ b/drivers/common/dpaax/dpaax_logs.h
@@ -37,7 +37,7 @@ extern int dpaax_logger;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAAX_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaax_logger, fmt, ## args)
 
 #define DPAAX_DP_DEBUG(fmt, args...) \
 	DPAAX_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/common/dpaax/version.map b/drivers/common/dpaax/version.map
index ee1ca6801c81..d48a6b6f37ee 100644
--- a/drivers/common/dpaax/version.map
+++ b/drivers/common/dpaax/version.map
@@ -6,6 +6,7 @@ INTERNAL {
 	dpaax_iova_table_p;
 	dpaax_iova_table_populate;
 	dpaax_iova_table_update;
+	dpaax_logger;
 	of_device_is_available;
 	of_device_is_compatible;
 	of_find_compatible_node;
-- 
2.42.0


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

* [PATCH v2 21/25] basband/la12xx: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (19 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 20/25] common/dpaax: do not use " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 22/25] bus/cdx: " Stephen Hemminger
                     ` (4 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
index 452435ccb942..922eb601c61c 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
+++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
@@ -23,6 +23,6 @@ extern int bbdev_la12xx_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define rte_bbdev_dp_log(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt, ## args)
 
 #endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
-- 
2.42.0


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

* [PATCH v2 22/25] bus/cdx: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (20 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 21/25] basband/la12xx: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 23/25] bus/fslmc: " Stephen Hemminger
                     ` (3 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Nipun Gupta, Nikhil Agarwal

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/cdx/cdx_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/cdx/cdx_logs.h b/drivers/bus/cdx/cdx_logs.h
index a1046ce544a6..e432fae00e4d 100644
--- a/drivers/bus/cdx/cdx_logs.h
+++ b/drivers/bus/cdx/cdx_logs.h
@@ -25,7 +25,7 @@ extern int cdx_logtype_bus;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define CDX_BUS_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, cdx_logtype_bus, fmt, ## args)
 
 #define CDX_BUS_DP_DEBUG(fmt, args...) \
 	CDX_BUS_DP_LOG(DEBUG, fmt, ## args)
-- 
2.42.0


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

* [PATCH v2 23/25] bus/fslmc: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (21 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 22/25] bus/cdx: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 24/25] dma/dpaa, dma/dpaa2: " Stephen Hemminger
                     ` (2 subsequent siblings)
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/fslmc/fslmc_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/fslmc/fslmc_logs.h b/drivers/bus/fslmc/fslmc_logs.h
index a1e14dd84e9a..edd74af04d7c 100644
--- a/drivers/bus/fslmc/fslmc_logs.h
+++ b/drivers/bus/fslmc/fslmc_logs.h
@@ -27,7 +27,7 @@ extern int dpaa2_logtype_bus;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_BUS_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, dpaa2_logtype_bus, fmt, ## args)
 
 #define DPAA2_BUS_DP_DEBUG(fmt, args...) \
 	DPAA2_BUS_DP_LOG(DEBUG, fmt, ## args)
-- 
2.42.0


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

* [PATCH v2 24/25] dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (22 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 23/25] bus/fslmc: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  4:16   ` [PATCH v2 25/25] mempool/dpaa, mempool/dpaa2: do not use logtype PMD Stephen Hemminger
  2023-12-13  8:00   ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD David Marchand
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Sachin Saxena, Hemant Agrawal

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/dma/dpaa/dpaa_qdma_logs.h   | 5 +++--
 drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/dpaa/dpaa_qdma_logs.h b/drivers/dma/dpaa/dpaa_qdma_logs.h
index 762598f8f72f..169fbf364265 100644
--- a/drivers/dma/dpaa/dpaa_qdma_logs.h
+++ b/drivers/dma/dpaa/dpaa_qdma_logs.h
@@ -25,8 +25,9 @@ extern int dpaa_qdma_logtype;
 	DPAA_QDMA_LOG(WARNING, fmt, ## args)
 
 /* DP Logs, toggled out at compile time if level lower than current level */
-#define DPAA_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args)
+#define DPAA_QDMA_DP_LOG(level, fmt, args...)			\
+	rte_log_dp(RTE_LOG_ ## level, dpaa_qdma_logtype,	\
+		   "dpaa_qdma: " fmt "\n", ## args)
 
 #define DPAA_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/dma/dpaa2/dpaa2_qdma_logs.h b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
index a46b8f24b5a7..52514c2dcc91 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma_logs.h
+++ b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
@@ -30,7 +30,8 @@ extern int dpaa2_qdma_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa2_qdma: " fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_qdma_logtype, \
+		   "dpaa2_qdma: " fmt "\n", ## args)
 
 #define DPAA2_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
-- 
2.42.0


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

* [PATCH v2 25/25] mempool/dpaa, mempool/dpaa2: do not use logtype PMD
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (23 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 24/25] dma/dpaa, dma/dpaa2: " Stephen Hemminger
@ 2023-12-13  4:16   ` Stephen Hemminger
  2023-12-13  8:00   ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD David Marchand
  25 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13  4:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

The driver already has a logtype, just not consistently used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/mempool/dpaa/dpaa_mempool.h           | 2 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c      | 4 ++--
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 3f0eafa7dd7b..ca97da46910c 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -67,7 +67,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;
 #define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
 
 #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \
-	RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_DEBUG, dpaa_logtype_mempool, fmt, ## args)
 #define DPAA_MEMPOOL_DEBUG(fmt, args...) \
 	DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args)
 #define DPAA_MEMPOOL_ERR(fmt, args...) \
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 84371d5d1abb..e3983d34c25c 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_LOG(ERR, "DPAA2 buffer pool not configured\n");
 		return -ENOMEM;
 	}
 
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_LOG(ERR, "DPAA2 buffer pool not configured");
 		return NULL;
 	}
 
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
index 986264319623..2f4fe0ba4209 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
@@ -25,7 +25,7 @@ extern int dpaa2_logtype_mempool;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_mempool, fmt, ## args)
 
 #define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \
 	DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
-- 
2.42.0


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

* Re: [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (24 preceding siblings ...)
  2023-12-13  4:16   ` [PATCH v2 25/25] mempool/dpaa, mempool/dpaa2: do not use logtype PMD Stephen Hemminger
@ 2023-12-13  8:00   ` David Marchand
  2023-12-13 15:09     ` Stephen Hemminger
  25 siblings, 1 reply; 214+ messages in thread
From: David Marchand @ 2023-12-13  8:00 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Wed, Dec 13, 2023 at 5:19 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> The generic RTE_LOGTYPE_PMD is a leftover and should be removed.
> As a first step, fix many drivers to not use it, and add a
> helper for the RTE_LOG_DP().

I don't see why we need a new rte_log_dp helper.
The #define RTE_LOGTYPE_XXX trick should work fine with RTE_LOG_DP().
What else is missing?


>
> Most of this patchset is boiler plate but there were some
> places where use of PMD type snuck in with changes to
> original driver and get fixed here.

I see odd changes, like a change in PMD_DRV_LOG meaning in the first patch:
https://patchwork.dpdk.org/project/dpdk/patch/20231213041920.729403-4-stephen@networkplumber.org/

A lot of drivers use this macro to log "driver"/configuration level
errors (see below).
Switching this macro to the DP version looks wrong to me.

$ git grep PMD_DRV_LOG drivers/net/atlantic/
drivers/net/atlantic/atl_ethdev.c:              PMD_DRV_LOG(ERR,
"rte_eal_alarm_set fail");
drivers/net/atlantic/atl_ethdev.c:              PMD_DRV_LOG(INFO,
"Port %d: Link Up - speed %u Mbps - %s",
drivers/net/atlantic/atl_ethdev.c:              PMD_DRV_LOG(INFO, "
Port %d: Link Down",
drivers/net/atlantic/atl_ethdev.c:      PMD_DRV_LOG(DEBUG, "PCI
Address: " PCI_PRI_FMT,
...


--
David Marchand


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

* Re: [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD
  2023-12-13  8:00   ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD David Marchand
@ 2023-12-13 15:09     ` Stephen Hemminger
  2023-12-18 14:03       ` David Marchand
  0 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 15:09 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

On Wed, 13 Dec 2023 09:00:48 +0100
David Marchand <david.marchand@redhat.com> wrote:

> On Wed, Dec 13, 2023 at 5:19 AM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > The generic RTE_LOGTYPE_PMD is a leftover and should be removed.
> > As a first step, fix many drivers to not use it, and add a
> > helper for the RTE_LOG_DP().  
> 
> I don't see why we need a new rte_log_dp helper.
> The #define RTE_LOGTYPE_XXX trick should work fine with RTE_LOG_DP().
> What else is missing?

The problem is RTE_LOG_DP() usage today takes suffixes. So the param
log type can only be one of the pre-defined fixed values.

Changing the macro in one patch would be a huge patch.

It seemed best to have RTE_LOG_DP() stay like RTE_LOG()
and introduce rte_log_dp() to match rte_log().

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

* [PATCH v3 00/37] Replace uso of RTE_LOGTYPE_PMD
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (26 preceding siblings ...)
  2023-12-13  4:16 ` [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD Stephen Hemminger
@ 2023-12-13 16:35 ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 01/37] log: fix doc comment for RTE_LOG_DP() Stephen Hemminger
                     ` (36 more replies)
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (4 subsequent siblings)
  32 siblings, 37 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a leftover and should be removed.
As a first step, fix many drivers to not use it, and add a
helper for the RTE_LOG_DP(). 

Most of this patchset is boiler plate but there were some
places where use of PMD type snuck in with later changes to
the original driver.

v3 - add more drivers. fix docbook.

Stephen Hemminger (37):
  log: fix doc comment for RTE_LOG_DP()
  log: add rte_log_dp()
  net/atlantic: replace RTE_LOG_DP with rte_log_dp
  net/avp: replace RTE_LOG_DP with rte_log_dp
  net/bnxt: replace RTE_LOG_DP with rte_log_dp
  net/dpaa: replace RTE_LOG_DP with rte_log_dp
  net/dpaa2: replace RTE_LOG_DP with rte_log_dp
  net/enetc, net/enetfec: replace RTE_LOG_DP with rte_log_dp
  net/igc: replace RTE_LOG_DP with rte_log_dp
  net/mana: replace RTE_LOG_DP with rte_log_dp
  net/mvpp2: do not use PMD logtype
  net/octeon_ep: replace RTE_LOG_DP with rte_log_dp
  net/pfe: replace RTE_LOG_DP with rte_log_dp
  net/qede: replace RTE_LOG_DP with rte_log_dp
  net/virtio: replace RTE_LOG_DP with rte_log_dp
  net/vmxnet3: do not use PMD logtype
  common/cnxk: replace RTE_LOG_DP with rte_log_dp
  common/cpt: replace RTE_LOG_DP with rte_log_dp
  common/sfc_efx: remove use of PMD logtype
  common/dpaax: do not use PMD logtype
  basband/la12xx: replace RTE_LOG_DP with rte_log_dp
  bus/cdx: replace RTE_LOG_DP with rte_log_dp
  bus/fslmc: replace RTE_LOG_DP with rte_log_dp
  dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
  mempool/dpaa, mempool/dpaa2: do not use logtype PMD
  vdpa/ifc: replace use of RTE_LOGTYPE_PMD
  raw/cnxk_bphy: replace PMD logtype with dynamic type
  raw/cnxk_gpio: replace PMD logtype with dynamic type
  raw/dpaa2_cmdif: replace PMD logtype with rte_log_dp
  raw/ifpga: replace PMD logtype with dynamic type
  event/dlb2: replace logtype PMD with rte_log_dp
  event/dpaa, event/dpaa2: use local logtype
  event/skeleton: replace logtype PMD with dynamic type
  crypto/caam_jr: replace logtype PMD
  crypto/ccp: do not use PMD logtype
  crypto/scheduler: replace use of logtype PMD
  crypto/dpaa_sec, crypto/dpaa2_sec: replace use of PMD logtype

 .../baseband/la12xx/bbdev_la12xx_pmd_logs.h   |  2 +-
 drivers/bus/cdx/cdx_logs.h                    |  2 +-
 drivers/bus/fslmc/fslmc_logs.h                |  2 +-
 drivers/common/cnxk/roc_platform.h            | 28 +++++++++--------
 drivers/common/cpt/cpt_pmd_logs.h             |  2 +-
 drivers/common/dpaax/caamflib/compat.h        |  5 ++-
 drivers/common/dpaax/dpaax_logs.h             |  2 +-
 drivers/common/dpaax/version.map              |  1 +
 drivers/common/sfc_efx/sfc_efx.c              | 11 ++-----
 drivers/common/sfc_efx/sfc_efx_log.h          |  2 +-
 drivers/crypto/caam_jr/caam_jr.c              |  8 ++---
 drivers/crypto/caam_jr/caam_jr_log.h          |  2 +-
 drivers/crypto/ccp/rte_ccp_pmd.c              | 13 ++++----
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |  6 ++--
 drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h     |  4 +--
 drivers/crypto/dpaa_sec/dpaa_sec.c            |  4 +--
 drivers/crypto/dpaa_sec/dpaa_sec_log.h        |  2 +-
 drivers/crypto/scheduler/scheduler_pmd.c      |  4 +--
 drivers/dma/dpaa/dpaa_qdma_logs.h             |  5 +--
 drivers/dma/dpaa2/dpaa2_qdma_logs.h           |  3 +-
 drivers/event/dlb2/dlb2.c                     |  5 ++-
 drivers/event/dlb2/dlb2_log.h                 |  2 +-
 drivers/event/dpaa/dpaa_eventdev.c            |  2 +-
 drivers/event/dpaa2/dpaa2_eventdev.c          |  4 +--
 drivers/event/dpaa2/dpaa2_eventdev_logs.h     |  2 +-
 drivers/event/dpaa2/dpaa2_eventdev_selftest.c |  6 ++--
 drivers/event/skeleton/skeleton_eventdev.c    |  3 +-
 drivers/event/skeleton/skeleton_eventdev.h    |  8 +++--
 drivers/mempool/dpaa/dpaa_mempool.h           |  2 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c      |  4 +--
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h |  2 +-
 drivers/net/atlantic/atl_logs.h               | 15 ++++-----
 drivers/net/avp/avp_logs.h                    | 20 ++++++------
 drivers/net/bnxt/bnxt.h                       |  5 +++
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c         |  3 +-
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c          |  3 +-
 drivers/net/bnxt/bnxt_txr.c                   |  4 +--
 drivers/net/dpaa/dpaa_ethdev.c                |  4 +--
 drivers/net/dpaa/dpaa_ethdev.h                |  2 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |  2 +-
 drivers/net/dpaa2/dpaa2_pmd_logs.h            |  2 +-
 drivers/net/dpaa2/dpaa2_sparser.c             |  4 +--
 drivers/net/enetc/enetc_logs.h                |  2 +-
 drivers/net/enetfec/enet_pmd_logs.h           |  2 +-
 drivers/net/igc/igc_logs.h                    | 10 +++---
 drivers/net/mana/mana.h                       |  2 +-
 drivers/net/mvpp2/mrvl_ethdev.c               |  4 +--
 drivers/net/octeon_ep/otx_ep_common.h         |  7 +++++
 drivers/net/octeon_ep/otx_ep_rxtx.c           |  5 ++-
 drivers/net/octeontx/octeontx_logs.h          |  3 +-
 drivers/net/pfe/pfe_logs.h                    |  2 +-
 drivers/net/qede/qede_logs.h                  | 10 +++---
 drivers/net/virtio/virtio_logs.h              | 16 +++++-----
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |  2 +-
 drivers/net/vmxnet3/vmxnet3_logs.h            | 12 ++++---
 drivers/raw/cnxk_bphy/cnxk_bphy.c             |  3 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c         |  2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c    | 31 +++++++++----------
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h          |  5 +++
 drivers/raw/cnxk_gpio/cnxk_gpio.c             | 22 +++++++------
 drivers/raw/cnxk_gpio/cnxk_gpio.h             |  4 +++
 drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c    | 31 +++++++++----------
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h    |  3 +-
 .../raw/ifpga/base/osdep_rte/osdep_generic.h  |  4 ++-
 drivers/vdpa/ifc/base/ifcvf.c                 | 14 ++++-----
 drivers/vdpa/ifc/base/ifcvf_osdep.h           |  9 ++++--
 lib/log/rte_log.h                             | 24 ++++++++++++--
 67 files changed, 249 insertions(+), 192 deletions(-)

-- 
2.43.0


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

* [PATCH v3 01/37] log: fix doc comment for RTE_LOG_DP()
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 02/37] log: add rte_log_dp() Stephen Hemminger
                     ` (35 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Olivier Matz

The macro does not return a numeric status, only void.

Fixes: 5d8f0baf69ea ("log: do not drop debug logs at compile time")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/log/rte_log.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 4d207b8da2cd..bbbb051c20e2 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -348,9 +348,6 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
  * @param ...
  *   The fmt string, as in printf(3), followed by the variable arguments
  *   required by the format.
- * @return
- *   - 0: Success.
- *   - Negative on error.
  */
 #define RTE_LOG_DP(l, t, ...)					\
 	(void)((RTE_LOG_ ## l <= RTE_LOG_DP_LEVEL) ?		\
-- 
2.43.0


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

* [PATCH v3 02/37] log: add rte_log_dp()
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 01/37] log: fix doc comment for RTE_LOG_DP() Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 03/37] net/atlantic: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                     ` (34 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Add a new macro for logging in datapath using a logtype.
The existing macro RTE_LOG_DP() takes log type suffix (i.e. PMD)
like RTE_LOG(). This macro allows using a dynamic type.

Ideally, rte_log_dp() could be an always_inline function
but GCC and Clang will not inline a function with variable number
of arguments. Therefore it has to be a macro.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/log/rte_log.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index bbbb051c20e2..4f69c05db91d 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -355,6 +355,27 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
 		 RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) :	\
 	 0)
 
+/**
+ * Generates a log message for data path.
+ *
+ * Similar to rte_log(), except that it gets optimized away
+ * if the RTE_LOG_DP_LEVEL configuration option is lower than the log
+ * level argument.
+ *
+ * @param l
+ *   Log level. A value between RTE_LOG_EMERG (1) and RTE_LOG_DEBUG (8).
+ * @param t
+ *   The log type, for example, RTE_LOGTYPE_EAL.
+ * @param ...
+ *   The format string, as in printf(3), followed by the variable arguments
+ *   required by the format.
+ */
+#define rte_log_dp(l, t, ...)				\
+	do {						\
+		if ((l) <= RTE_LOG_DP_LEVEL)		\
+			rte_log(l, t, __VA_ARGS__);	\
+	} while (0)
+
 #define RTE_LOG_REGISTER_IMPL(type, name, level)			    \
 int type;								    \
 RTE_INIT(__##type)							    \
-- 
2.43.0


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

* [PATCH v3 03/37] net/atlantic: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 01/37] log: fix doc comment for RTE_LOG_DP() Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 02/37] log: add rte_log_dp() Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 04/37] net/avp: " Stephen Hemminger
                     ` (33 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Igor Russkikh

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/atlantic/atl_logs.h | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/atlantic/atl_logs.h b/drivers/net/atlantic/atl_logs.h
index e3dba334fe92..c2a3a6320c58 100644
--- a/drivers/net/atlantic/atl_logs.h
+++ b/drivers/net/atlantic/atl_logs.h
@@ -14,18 +14,19 @@ extern int atl_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-
 extern int atl_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, atl_logtype_driver, fmt "\n", \
+		   ## args)
+
+#define PMD_RX_LOG(level, fmt, args...) \
+	PMD_DRV_LOG(level, fmt, ## args)
+
+#define PMD_TX_LOG(level, fmt, args...) \
+	PMD_DRV_LOG(level, fmt, ## args)
 
 #endif
-- 
2.43.0


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

* [PATCH v3 04/37] net/avp: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (2 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 03/37] net/atlantic: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 05/37] net/bnxt: " Stephen Hemminger
                     ` (32 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Steven Webster, Matt Peters

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/avp/avp_logs.h | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/avp/avp_logs.h b/drivers/net/avp/avp_logs.h
index 6e297c7a4a81..0ae95a7685c5 100644
--- a/drivers/net/avp/avp_logs.h
+++ b/drivers/net/avp/avp_logs.h
@@ -7,24 +7,26 @@
 
 #include <rte_log.h>
 
+
+extern int avp_logtype_driver;
+
+#define PMD_DRV_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
+		"%s(): " fmt, __func__, ## args)
+
 #ifdef RTE_LIBRTE_AVP_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() rx: " fmt, __func__, ## args)
+	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
+		"%s() rx: " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_AVP_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() tx: " fmt, __func__, ## args)
+	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
+		"%s() tx: " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
-
-extern int avp_logtype_driver;
-
-#define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
-		"%s(): " fmt, __func__, ## args)
-
 #endif /* _AVP_LOGS_H_ */
-- 
2.43.0


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

* [PATCH v3 05/37] net/bnxt: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (3 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 04/37] net/avp: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 06/37] net/dpaa: " Stephen Hemminger
                     ` (31 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Somnath Kotur, Ajit Khaparde, Ruifeng Wang,
	Bruce Richardson, Konstantin Ananyev

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt.h               | 5 +++++
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +--
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c  | 3 +--
 drivers/net/bnxt/bnxt_txr.c           | 4 +---
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 0e01b1d4baea..3aa9213a12f9 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -1058,6 +1058,11 @@ extern int bnxt_logtype_driver;
 #define PMD_DRV_LOG(level, fmt, args...) \
 	  PMD_DRV_LOG_RAW(level, fmt, ## args)
 
+#define PMD_DRV_LOG_DP(level, fmt, args...)			\
+	rte_log_dp(RTE_LOG_ ## level, bnxt_logtype_driver,	\
+		   fmt, ## args)
+
+
 extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;
 int32_t bnxt_ulp_port_init(struct bnxt *bp);
 void bnxt_ulp_port_deinit(struct bnxt *bp);
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
index aa1b1ab8bb7e..64c1dfac47d9 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
@@ -357,8 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
-				   "Unhandled CMP type %02x\n",
+			PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index e99a547f5857..572b21a00837 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -326,8 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
-				   "Unhandled CMP type %02x\n",
+			PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 899986764f93..bd0a75653ab3 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -542,9 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
 		if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
 			nb_tx_pkts += opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
-					"Unhandled CMP type %02x\n",
-					CMP_TYPE(txcmp));
+			PMD_DRV_LOG_DP(ERR, "Unhandled CMP type %02x\n", CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
 
-- 
2.43.0


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

* [PATCH v3 06/37] net/dpaa: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (4 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 05/37] net/bnxt: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-15  5:52     ` Hemant Agrawal
  2023-12-13 16:35   ` [PATCH v3 07/37] net/dpaa2: " Stephen Hemminger
                     ` (30 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa/dpaa_ethdev.c | 4 ++--
 drivers/net/dpaa/dpaa_ethdev.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index ef4c06db6a4d..0d0d493f3a6d 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -2096,7 +2096,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 	/* copy the primary mac address */
 	rte_ether_addr_copy(&fman_intf->mac_addr, &eth_dev->data->mac_addrs[0]);
 
-	RTE_LOG(INFO, PMD, "net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n",
+	DPAA_PMD_INFO("dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT,
 		dpaa_device->name, RTE_ETHER_ADDR_BYTES(&fman_intf->mac_addr));
 
 	if (!fman_intf->is_shared_mac) {
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 
 		ret = dpaa_dev_init_secondary(eth_dev);
 		if (ret != 0) {
-			RTE_LOG(ERR, PMD, "secondary dev init failed\n");
+			DPAA_PMD_ERR("secondary dev init failed");
 			return ret;
 		}
 
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 5b6802ece8f0..ced3e5f8ff98 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -232,6 +232,6 @@ extern int dpaa_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa_logtype_pmd, fmt, ## args)
 
 #endif
-- 
2.43.0


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

* [PATCH v3 07/37] net/dpaa2: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (5 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 06/37] net/dpaa: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-15  5:52     ` Hemant Agrawal
  2023-12-13 16:35   ` [PATCH v3 08/37] net/enetc, net/enetfec: " Stephen Hemminger
                     ` (29 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa2/dpaa2_ethdev.c   | 2 +-
 drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +-
 drivers/net/dpaa2/dpaa2_sparser.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 8e610b6bba30..71d57ab26062 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 			return ret;
 		}
 	}
-	RTE_LOG(INFO, PMD, "%s: netdev created, connected to %s\n",
+	DPAA2_PMD_INFO("%s: netdev created, connected to %s\n",
 		eth_dev->data->name, dpaa2_dev->ep_name);
 
 	return 0;
diff --git a/drivers/net/dpaa2/dpaa2_pmd_logs.h b/drivers/net/dpaa2/dpaa2_pmd_logs.h
index c47ba8e10bfc..89bffc684e50 100644
--- a/drivers/net/dpaa2/dpaa2_pmd_logs.h
+++ b/drivers/net/dpaa2/dpaa2_pmd_logs.h
@@ -28,7 +28,7 @@ extern int dpaa2_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_pmd, fmt, ## args)
 
 #define DPAA2_PMD_DP_DEBUG(fmt, args...) \
 	DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/dpaa2/dpaa2_sparser.c b/drivers/net/dpaa2/dpaa2_sparser.c
index 63463c4fbfd6..202996c5d05d 100644
--- a/drivers/net/dpaa2/dpaa2_sparser.c
+++ b/drivers/net/dpaa2/dpaa2_sparser.c
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 
 	priv->ss_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(addr));
 	priv->ss_offset += sp_param.size;
-	RTE_LOG(INFO, PMD, "Soft parser loaded for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser loaded for dpni@%d\n", priv->hw_id);
 
 	rte_free(addr);
 	return 0;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 	}
 
 	rte_free(param_addr);
-	RTE_LOG(INFO, PMD, "Soft parser enabled for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser enabled for dpni@%d\n", priv->hw_id);
 	return 0;
 }
-- 
2.43.0


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

* [PATCH v3 08/37] net/enetc, net/enetfec: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (6 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 07/37] net/dpaa2: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 09/37] net/igc: " Stephen Hemminger
                     ` (28 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Sachin Saxena, Apeksha Gupta

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/enetc/enetc_logs.h      | 2 +-
 drivers/net/enetfec/enet_pmd_logs.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/enetc/enetc_logs.h b/drivers/net/enetc/enetc_logs.h
index 0976d42debd7..05a540f16490 100644
--- a/drivers/net/enetc/enetc_logs.h
+++ b/drivers/net/enetc/enetc_logs.h
@@ -30,7 +30,7 @@ extern int enetc_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETC_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, enetc_logtype_pmd, fmt, ## args)
 
 #define ENETC_PMD_DP_DEBUG(fmt, args...) \
 	ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/enetfec/enet_pmd_logs.h b/drivers/net/enetfec/enet_pmd_logs.h
index 72d1cb61c598..c0a226284c53 100644
--- a/drivers/net/enetfec/enet_pmd_logs.h
+++ b/drivers/net/enetfec/enet_pmd_logs.h
@@ -28,6 +28,6 @@ extern int enetfec_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETFEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, enetfec_logtype_pmd, fmt, ## args)
 
 #endif /* _ENETFEC_LOGS_H_ */
-- 
2.43.0


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

* [PATCH v3 09/37] net/igc: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (7 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 08/37] net/enetc, net/enetfec: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 10/37] net/mana: " Stephen Hemminger
                     ` (27 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Junfeng Guo, Simei Su

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
---
 drivers/net/igc/igc_logs.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 11071a32b542..ffa1981bae32 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -21,15 +21,17 @@ extern int igc_logtype_driver;
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_ETHDEV_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_RX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, igc_logtype_driver,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_TX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, igc_logtype_driver,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
-- 
2.43.0


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

* [PATCH v3 10/37] net/mana: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (8 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 09/37] net/igc: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 19:17     ` Long Li
  2023-12-13 16:35   ` [PATCH v3 11/37] net/mvpp2: do not use PMD logtype Stephen Hemminger
                     ` (26 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Long Li

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mana/mana.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index 6836872dc257..8d60f9172d44 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -467,7 +467,7 @@ extern int mana_logtype_init;
 		__func__, ## args)
 
 #define DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, mana_logtype_driver, fmt "\n", ## args)
 
 #define PMD_INIT_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
-- 
2.43.0


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

* [PATCH v3 11/37] net/mvpp2: do not use PMD logtype
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (9 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 10/37] net/mana: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 12/37] net/octeon_ep: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                     ` (25 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Liron Himi, Natalie Samsonov, Yelena Krivosheev

The driver already has a logtype but it was not being used
in one place.

Fixes: 9e79d810911d ("net/mvpp2: support Tx scatter/gather")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index c12364941d62..9a9279a8783a 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)
 
 	/* Use a simple Tx queue (no offloads, no multi segs) if possible */
 	if (priv->multiseg) {
-		RTE_LOG(INFO, PMD, "Using multi-segment tx callback\n");
+		MRVL_LOG(INFO, "Using multi-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst;
 	} else {
-		RTE_LOG(INFO, PMD, "Using single-segment tx callback\n");
+		MRVL_LOG(INFO, "Using single-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_pkt_burst;
 	}
 }
-- 
2.43.0


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

* [PATCH v3 12/37] net/octeon_ep: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (10 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 11/37] net/mvpp2: do not use PMD logtype Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 13/37] net/pfe: " Stephen Hemminger
                     ` (24 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Vamsi Attunuru

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/octeon_ep/otx_ep_common.h | 7 +++++++
 drivers/net/octeon_ep/otx_ep_rxtx.c   | 5 ++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
index 82e57520d38d..5fb63d051ac8 100644
--- a/drivers/net/octeon_ep/otx_ep_common.h
+++ b/drivers/net/octeon_ep/otx_ep_common.h
@@ -81,6 +81,13 @@
 		"%s():%u " fmt "\n",				\
 		__func__, __LINE__, ##args)
 
+#define otx_ep_log_dp(level, fmt, args...)			\
+	rte_log_dp(RTE_LOG_ ## level, otx_net_ep_logtype,	\
+		   "%s():%u " fmt "\n",				\
+		   __func__, __LINE__, ##args)
+
+
+
 /* IO Access */
 #define oct_ep_read64(addr) rte_read64_relaxed((void *)(addr))
 #define oct_ep_write64(val, addr) rte_write64_relaxed((val), (void *)(addr))
diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c
index c421ef0a1c04..fe8885be54ff 100644
--- a/drivers/net/octeon_ep/otx_ep_rxtx.c
+++ b/drivers/net/octeon_ep/otx_ep_rxtx.c
@@ -884,9 +884,8 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		next_fetch = (pkts == new_pkts - 1) ? 0 : 1;
 		oq_pkt = otx_ep_droq_read_packet(otx_ep, droq, next_fetch);
 		if (!oq_pkt) {
-			RTE_LOG_DP(ERR, PMD,
-				   "DROQ read pkt failed pending %" PRIu64
-				    "last_pkt_count %" PRIu64 "new_pkts %d.\n",
+			otx_ep_log_dp(ERR, "DROQ read pkt failed pending %" PRIu64
+				    "last_pkt_count %" PRIu64 "new_pkts %d.",
 				   droq->pkts_pending, droq->last_pkt_count,
 				   new_pkts);
 			droq->stats.rx_err++;
-- 
2.43.0


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

* [PATCH v3 13/37] net/pfe: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (11 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 12/37] net/octeon_ep: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 14/37] net/qede: " Stephen Hemminger
                     ` (23 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Harman Kalra, Gagandeep Singh

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/octeontx/octeontx_logs.h | 3 +--
 drivers/net/pfe/pfe_logs.h           | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/octeontx/octeontx_logs.h b/drivers/net/octeontx/octeontx_logs.h
index dec8042c67ba..cec5346d5a8b 100644
--- a/drivers/net/octeontx/octeontx_logs.h
+++ b/drivers/net/octeontx/octeontx_logs.h
@@ -19,11 +19,10 @@
 	rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \
 			"%s(): " fmt "\n", __func__, ## args)
 
-#define octeontx_log_info(fmt, args...)			\
-	RTE_LOG(INFO, PMD, fmt "\n", ## args)
 
 #define octeontx_log_err(s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)
 #define octeontx_log_dbg(s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__)
+#define octeontx_log_info(s, ...) PMD_DRV_LOG(INFO, s, ##__VA_ARGS__)
 #define octeontx_mbox_log(s, ...) PMD_MBOX_LOG(DEBUG, s, ##__VA_ARGS__)
 
 #define PMD_RX_LOG	PMD_DRV_LOG
diff --git a/drivers/net/pfe/pfe_logs.h b/drivers/net/pfe/pfe_logs.h
index 58d5e8e7cff1..306bfc22ea54 100644
--- a/drivers/net/pfe/pfe_logs.h
+++ b/drivers/net/pfe/pfe_logs.h
@@ -26,6 +26,6 @@ extern int pfe_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define PFE_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ##level, pfe_logtype_pmd, fmt, ## args)
 
 #endif /* _PFE_LOGS_H_ */
-- 
2.43.0


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

* [PATCH v3 14/37] net/qede: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (12 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 13/37] net/pfe: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-14  0:34     ` [EXT] " Devendra Singh Rawat
  2023-12-13 16:35   ` [PATCH v3 15/37] net/virtio: " Stephen Hemminger
                     ` (22 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Devendra Singh Rawat, Alok Prasad

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/qede/qede_logs.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qede/qede_logs.h b/drivers/net/qede/qede_logs.h
index 3187d97bb7b0..f7aa14df7e3b 100644
--- a/drivers/net/qede/qede_logs.h
+++ b/drivers/net/qede/qede_logs.h
@@ -58,16 +58,18 @@ extern int qede_logtype_init;
 #define PMD_INIT_FUNC_TRACE(edev) PMD_INIT_LOG(DEBUG, edev, " >>")
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_TX
-#define PMD_TX_LOG(level, q, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \
+#define PMD_TX_LOG(level, q, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, qede_logtype_driver,		\
+		"%s(): port=%u queue=%u " fmt "\n",		\
 		__func__, q->port_id, q->queue_id, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_RX
-#define PMD_RX_LOG(level, q, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n",	\
+#define PMD_RX_LOG(level, q, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, qede_logtype_driver,		\
+		"%s(): port=%u queue=%u " fmt "\n",		\
 		__func__, q->port_id, q->queue_id, ## args)
 #else
 #define PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
-- 
2.43.0


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

* [PATCH v3 15/37] net/virtio: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (13 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 14/37] net/qede: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 16/37] net/vmxnet3: do not use PMD logtype Stephen Hemminger
                     ` (21 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Maxime Coquelin, Chenbo Xia

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/virtio/virtio_logs.h | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/virtio/virtio_logs.h b/drivers/net/virtio/virtio_logs.h
index 9b1b1defc5a6..0447ee961fb6 100644
--- a/drivers/net/virtio/virtio_logs.h
+++ b/drivers/net/virtio/virtio_logs.h
@@ -14,23 +14,25 @@ extern int virtio_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
+extern int virtio_logtype_driver;
+#define PMD_DRV_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
+		"%s(): " fmt "\n", __func__, ## args)
+
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
+		"%s() rx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
+		"%s() tx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
-extern int virtio_logtype_driver;
-#define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
-		"%s(): " fmt "\n", __func__, ## args)
-
 #endif /* _VIRTIO_LOGS_H_ */
-- 
2.43.0


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

* [PATCH v3 16/37] net/vmxnet3: do not use PMD logtype
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (14 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 15/37] net/virtio: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 17/37] common/cnxk: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                     ` (20 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Jochen Behrens

The driver used a slightly different (and older) format
for datapath logs. Remove PMD logtype here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  2 +-
 drivers/net/vmxnet3/vmxnet3_logs.h   | 12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index e49191718aea..4fd704045fc4 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)
 	if (events == 0)
 		goto done;
 
-	RTE_LOG(DEBUG, PMD, "Reading events: 0x%X", events);
+	PMD_DRV_LOG(DEBUG, "Reading events: 0x%X", events);
 	vmxnet3_process_events(dev);
 done:
 	vmxnet3_enable_intr(hw, *eventIntrIdx);
diff --git a/drivers/net/vmxnet3/vmxnet3_logs.h b/drivers/net/vmxnet3/vmxnet3_logs.h
index 74154e3a1a6d..058d704f82c9 100644
--- a/drivers/net/vmxnet3/vmxnet3_logs.h
+++ b/drivers/net/vmxnet3/vmxnet3_logs.h
@@ -11,28 +11,32 @@ extern int vmxnet3_logtype_init;
 		"%s(): " fmt "\n", __func__, ## args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
+extern int vmxnet3_logtype_driver;
+
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
+		 "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
+		 "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE
 #define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
+		 "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
 #endif
 
-extern int vmxnet3_logtype_driver;
 #define PMD_DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
 		"%s(): " fmt "\n", __func__, ## args)
-- 
2.43.0


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

* [PATCH v3 17/37] common/cnxk: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (15 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 16/37] net/vmxnet3: do not use PMD logtype Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 18/37] common/cpt: " Stephen Hemminger
                     ` (19 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/cnxk/roc_platform.h | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index ba23b2e0d79e..9461f6e93304 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;
 extern int cnxk_logtype_ree;
 extern int cnxk_logtype_dpi;
 
-#define plt_err(fmt, args...)                                                  \
-	RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
-#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args)
-#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
+#define plt_log(level, fmt, args...)					\
+	rte_log(RTE_LOG_ ## level, cnxk_logtype_base,			\
+		"%s():%u " fmt "\n", __func__, __LINE__, ##args)
+#define plt_err(fmt, ...) plt_log(ERR, fmt, ##__VA_ARGS__)
+#define plt_info(fmt, ...) plt_log(INFO, fmt, ##__VA_ARGS__)
+#define plt_warn(fmt, ...) plt_log(WARNING, fmt, ##__VA_ARGS__)
+#define plt_print(fmt, ...) plt_log(INFO, fmt,  ##__VA_ARGS__)
 #define plt_dump(fmt, ...)      fprintf(stderr, fmt "\n", ##__VA_ARGS__)
 #define plt_dump_no_nl(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
 
@@ -278,8 +280,7 @@ extern int cnxk_logtype_dpi;
  */
 #define plt_dbg(subsystem, fmt, args...)                                       \
 	rte_log(RTE_LOG_DEBUG, cnxk_logtype_##subsystem,                       \
-		"[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__,      \
-##args)
+		"[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__, ##args)
 
 #define plt_base_dbg(fmt, ...)	plt_dbg(base, fmt, ##__VA_ARGS__)
 #define plt_cpt_dbg(fmt, ...)	plt_dbg(cpt, fmt, ##__VA_ARGS__)
@@ -295,12 +296,13 @@ extern int cnxk_logtype_dpi;
 #define plt_dpi_dbg(fmt, ...)	plt_dbg(dpi, fmt, ##__VA_ARGS__)
 
 /* Datapath logs */
-#define plt_dp_err(fmt, args...)                                               \
-	RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_dp_info(fmt, args...)                                              \
-	RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_dp_dbg(fmt, args...)                                              \
-	RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+#define plt_dp_log(level, fmt, args...)					\
+	rte_log_dp(RTE_LOG_ ## level, cnxk_logtype_base,		\
+		"%s():%u " fmt "\n", __func__, __LINE__, ## args)
+
+#define plt_dp_err(fmt, ...)  plt_dp_log(ERR, fmt, ##__VA_ARGS__)
+#define plt_dp_info(fmt, ...) plt_dp_log(INFO, fmt, ##__VA_ARGS__)
+#define plt_dp_dbg(fmt, ...)  plt_dp_log(DEBUG, fmt, ##__VA_ARGS__)
 
 #ifdef __cplusplus
 #define CNXK_PCI_ID(subsystem_dev, dev)                                        \
-- 
2.43.0


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

* [PATCH v3 18/37] common/cpt: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (16 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 17/37] common/cnxk: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 19/37] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
                     ` (18 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Anoob Joseph

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/cpt/cpt_pmd_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/cpt/cpt_pmd_logs.h b/drivers/common/cpt/cpt_pmd_logs.h
index 174326c6ce38..6b78fcb6b6fc 100644
--- a/drivers/common/cpt/cpt_pmd_logs.h
+++ b/drivers/common/cpt/cpt_pmd_logs.h
@@ -34,7 +34,7 @@
  * level of 'pmd' has to be used.
  */
 #define CPT_LOG_DP(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, CPT_LOGTYPE, fmt "\n", ## args)
 
 #define CPT_LOG_DP_DEBUG(fmt, args...) \
 	CPT_LOG_DP(DEBUG, fmt, ## args)
-- 
2.43.0


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

* [PATCH v3 19/37] common/sfc_efx: remove use of PMD logtype
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (17 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 18/37] common/cpt: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 20/37] common/dpaax: do not use " Stephen Hemminger
                     ` (17 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Andrew Rybchenko

This code was implemented in a slightly different manner
than all the other logging code (for no good reason).
Make it the same and handle errors in same way as
other drivers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/sfc_efx/sfc_efx.c     | 11 ++---------
 drivers/common/sfc_efx/sfc_efx_log.h |  2 +-
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/common/sfc_efx/sfc_efx.c b/drivers/common/sfc_efx/sfc_efx.c
index 2dc5545760b8..5eeffb065b0d 100644
--- a/drivers/common/sfc_efx/sfc_efx.c
+++ b/drivers/common/sfc_efx/sfc_efx.c
@@ -15,7 +15,7 @@
 #include "sfc_efx_log.h"
 #include "sfc_efx.h"
 
-uint32_t sfc_efx_logtype;
+int sfc_efx_logtype;
 
 static int
 sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,
 	return rc;
 }
 
-RTE_INIT(sfc_efx_register_logtype)
-{
-	int ret;
-
-	ret = rte_log_register_type_and_pick_level("pmd.common.sfc_efx",
-						   RTE_LOG_NOTICE);
-	sfc_efx_logtype = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
-}
+RTE_LOG_REGISTER_DEFAULT(sfc_efx_logtype, NOTICE);
diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h
index 694455c1b14e..1519ebdc175f 100644
--- a/drivers/common/sfc_efx/sfc_efx_log.h
+++ b/drivers/common/sfc_efx/sfc_efx_log.h
@@ -11,7 +11,7 @@
 #define _SFC_EFX_LOG_H_
 
 /** Generic driver log type */
-extern uint32_t sfc_efx_logtype;
+extern int sfc_efx_logtype;
 
 /** Log message, add a prefix and a line break */
 #define SFC_EFX_LOG(level, ...) \
-- 
2.43.0


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

* [PATCH v3 20/37] common/dpaax: do not use PMD logtype
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (18 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 19/37] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-15  5:56     ` Hemant Agrawal
  2023-12-13 16:35   ` [PATCH v3 21/37] basband/la12xx: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
                     ` (16 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Use existing dpaax_logger log type instead of PMD.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/dpaax/caamflib/compat.h | 5 ++++-
 drivers/common/dpaax/dpaax_logs.h      | 2 +-
 drivers/common/dpaax/version.map       | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/common/dpaax/caamflib/compat.h b/drivers/common/dpaax/caamflib/compat.h
index 9776eed437ad..64ccdca95058 100644
--- a/drivers/common/dpaax/caamflib/compat.h
+++ b/drivers/common/dpaax/caamflib/compat.h
@@ -40,11 +40,14 @@
 #define __maybe_unused __rte_unused
 #endif
 
+extern int dpaax_logger;
+
 #if defined(SUPPRESS_PRINTS)
 #define pr_msg(l, fmt, ...) do { } while (0)
 #else
 #define pr_msg(l, fmt, ...) \
-	RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
+	rte_log(RTE_LOG_ ## l, dpaax_logger, "%s(): " fmt "\n", \
+		__func__, ##__VA_ARGS__)
 #endif
 
 #if !defined(pr_debug)
diff --git a/drivers/common/dpaax/dpaax_logs.h b/drivers/common/dpaax/dpaax_logs.h
index 180476f6757c..cec99a674056 100644
--- a/drivers/common/dpaax/dpaax_logs.h
+++ b/drivers/common/dpaax/dpaax_logs.h
@@ -37,7 +37,7 @@ extern int dpaax_logger;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAAX_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaax_logger, fmt, ## args)
 
 #define DPAAX_DP_DEBUG(fmt, args...) \
 	DPAAX_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/common/dpaax/version.map b/drivers/common/dpaax/version.map
index ee1ca6801c81..d48a6b6f37ee 100644
--- a/drivers/common/dpaax/version.map
+++ b/drivers/common/dpaax/version.map
@@ -6,6 +6,7 @@ INTERNAL {
 	dpaax_iova_table_p;
 	dpaax_iova_table_populate;
 	dpaax_iova_table_update;
+	dpaax_logger;
 	of_device_is_available;
 	of_device_is_compatible;
 	of_find_compatible_node;
-- 
2.43.0


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

* [PATCH v3 21/37] basband/la12xx: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (19 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 20/37] common/dpaax: do not use " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-15  5:53     ` Hemant Agrawal
  2023-12-13 16:35   ` [PATCH v3 22/37] bus/cdx: " Stephen Hemminger
                     ` (15 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
index 452435ccb942..922eb601c61c 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
+++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
@@ -23,6 +23,6 @@ extern int bbdev_la12xx_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define rte_bbdev_dp_log(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt, ## args)
 
 #endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
-- 
2.43.0


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

* [PATCH v3 22/37] bus/cdx: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (20 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 21/37] basband/la12xx: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-13 16:35   ` [PATCH v3 23/37] bus/fslmc: " Stephen Hemminger
                     ` (14 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Nipun Gupta, Nikhil Agarwal

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/cdx/cdx_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/cdx/cdx_logs.h b/drivers/bus/cdx/cdx_logs.h
index a1046ce544a6..e432fae00e4d 100644
--- a/drivers/bus/cdx/cdx_logs.h
+++ b/drivers/bus/cdx/cdx_logs.h
@@ -25,7 +25,7 @@ extern int cdx_logtype_bus;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define CDX_BUS_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, cdx_logtype_bus, fmt, ## args)
 
 #define CDX_BUS_DP_DEBUG(fmt, args...) \
 	CDX_BUS_DP_LOG(DEBUG, fmt, ## args)
-- 
2.43.0


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

* [PATCH v3 23/37] bus/fslmc: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (21 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 22/37] bus/cdx: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-15  5:54     ` Hemant Agrawal
  2023-12-13 16:35   ` [PATCH v3 24/37] dma/dpaa, dma/dpaa2: " Stephen Hemminger
                     ` (13 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/fslmc/fslmc_logs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/fslmc/fslmc_logs.h b/drivers/bus/fslmc/fslmc_logs.h
index a1e14dd84e9a..edd74af04d7c 100644
--- a/drivers/bus/fslmc/fslmc_logs.h
+++ b/drivers/bus/fslmc/fslmc_logs.h
@@ -27,7 +27,7 @@ extern int dpaa2_logtype_bus;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_BUS_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, dpaa2_logtype_bus, fmt, ## args)
 
 #define DPAA2_BUS_DP_DEBUG(fmt, args...) \
 	DPAA2_BUS_DP_LOG(DEBUG, fmt, ## args)
-- 
2.43.0


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

* [PATCH v3 24/37] dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (22 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 23/37] bus/fslmc: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-15  5:54     ` Hemant Agrawal
  2023-12-13 16:35   ` [PATCH v3 25/37] mempool/dpaa, mempool/dpaa2: do not use logtype PMD Stephen Hemminger
                     ` (12 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Sachin Saxena, Hemant Agrawal

Want datapath logs to use own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/dma/dpaa/dpaa_qdma_logs.h   | 5 +++--
 drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/dpaa/dpaa_qdma_logs.h b/drivers/dma/dpaa/dpaa_qdma_logs.h
index 762598f8f72f..169fbf364265 100644
--- a/drivers/dma/dpaa/dpaa_qdma_logs.h
+++ b/drivers/dma/dpaa/dpaa_qdma_logs.h
@@ -25,8 +25,9 @@ extern int dpaa_qdma_logtype;
 	DPAA_QDMA_LOG(WARNING, fmt, ## args)
 
 /* DP Logs, toggled out at compile time if level lower than current level */
-#define DPAA_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args)
+#define DPAA_QDMA_DP_LOG(level, fmt, args...)			\
+	rte_log_dp(RTE_LOG_ ## level, dpaa_qdma_logtype,	\
+		   "dpaa_qdma: " fmt "\n", ## args)
 
 #define DPAA_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/dma/dpaa2/dpaa2_qdma_logs.h b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
index a46b8f24b5a7..52514c2dcc91 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma_logs.h
+++ b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
@@ -30,7 +30,8 @@ extern int dpaa2_qdma_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa2_qdma: " fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_qdma_logtype, \
+		   "dpaa2_qdma: " fmt "\n", ## args)
 
 #define DPAA2_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
-- 
2.43.0


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

* [PATCH v3 25/37] mempool/dpaa, mempool/dpaa2: do not use logtype PMD
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (23 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 24/37] dma/dpaa, dma/dpaa2: " Stephen Hemminger
@ 2023-12-13 16:35   ` Stephen Hemminger
  2023-12-15  5:54     ` Hemant Agrawal
  2023-12-13 16:36   ` [PATCH v3 26/37] vdpa/ifc: replace use of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (11 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:35 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

The driver already has a logtype, just not consistently used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/mempool/dpaa/dpaa_mempool.h           | 2 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c      | 4 ++--
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 3f0eafa7dd7b..ca97da46910c 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -67,7 +67,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;
 #define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
 
 #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \
-	RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_DEBUG, dpaa_logtype_mempool, fmt, ## args)
 #define DPAA_MEMPOOL_DEBUG(fmt, args...) \
 	DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args)
 #define DPAA_MEMPOOL_ERR(fmt, args...) \
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 84371d5d1abb..e3983d34c25c 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_LOG(ERR, "DPAA2 buffer pool not configured\n");
 		return -ENOMEM;
 	}
 
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_LOG(ERR, "DPAA2 buffer pool not configured");
 		return NULL;
 	}
 
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
index 986264319623..2f4fe0ba4209 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
@@ -25,7 +25,7 @@ extern int dpaa2_logtype_mempool;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_mempool, fmt, ## args)
 
 #define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \
 	DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
-- 
2.43.0


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

* [PATCH v3 26/37] vdpa/ifc: replace use of RTE_LOGTYPE_PMD
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (24 preceding siblings ...)
  2023-12-13 16:35   ` [PATCH v3 25/37] mempool/dpaa, mempool/dpaa2: do not use logtype PMD Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-13 16:36   ` [PATCH v3 27/37] raw/cnxk_bphy: replace PMD logtype with dynamic type Stephen Hemminger
                     ` (10 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Xiao Wang

This driver is using RTE_LOGTYPE_PMD, fix to have a dynamic
type.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/vdpa/ifc/base/ifcvf.c       | 14 +++++++-------
 drivers/vdpa/ifc/base/ifcvf_osdep.h |  9 +++++++--
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c
index 53e982a52e9d..d8c1595cdb02 100644
--- a/drivers/vdpa/ifc/base/ifcvf.c
+++ b/drivers/vdpa/ifc/base/ifcvf.c
@@ -224,11 +224,10 @@ ifcvf_enable_mq(struct ifcvf_hw *hw)
 	if (mq_cfg) {
 		if (hw->device_type == IFCVF_BLK) {
 			*(u32 *)mq_cfg = nr_queue;
-			RTE_LOG(INFO, PMD, "%d queues are enabled\n", nr_queue);
+			IFCVF_LOG(INFO, "%d queues are enabled", nr_queue);
 		} else {
 			*(u32 *)mq_cfg = nr_queue / 2;
-			RTE_LOG(INFO, PMD, "%d queue pairs are enabled\n",
-				nr_queue / 2);
+			IFCVF_LOG(INFO, "%d queue pairs are enabled", nr_queue / 2);
 		}
 	}
 }
@@ -246,7 +245,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
 
 	cfg = hw->common_cfg;
 	if (!cfg) {
-		RTE_LOG(ERR, PMD, "common_cfg in HW is NULL.\n");
+		IFCVF_LOG(ERR, "common_cfg in HW is NULL.");
 		return -1;
 	}
 
@@ -258,8 +257,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
 		IFCVF_WRITE_REG16(i + 1, &cfg->queue_msix_vector);
 		msix_vector = IFCVF_READ_REG16(&cfg->queue_msix_vector);
 		if (msix_vector == IFCVF_MSI_NO_VECTOR) {
-			RTE_LOG(ERR, PMD, "queue %d, msix vec alloc failed\n",
-				i);
+			IFCVF_LOG(ERR, "queue %d, msix vec alloc failed", i);
 			return -1;
 		}
 	}
@@ -307,7 +305,7 @@ ifcvf_disable_vring_hw(struct ifcvf_hw *hw, int i)
 
 	cfg = hw->common_cfg;
 	if (!cfg) {
-		RTE_LOG(ERR, PMD, "common_cfg in HW is NULL.\n");
+		IFCVF_LOG(ERR, "common_cfg in HW is NULL.");
 		return;
 	}
 
@@ -531,3 +529,5 @@ ifcvf_get_queue_notify_off(struct ifcvf_hw *hw, int qid)
 	return (u8 *)hw->notify_addr[qid] -
 		(u8 *)hw->mem_resource[hw->notify_region].addr;
 }
+
+RTE_LOG_REGISTER_DEFAULT(ifcvf_logtype, INFO);
diff --git a/drivers/vdpa/ifc/base/ifcvf_osdep.h b/drivers/vdpa/ifc/base/ifcvf_osdep.h
index dd2ff08f77cc..7100a8b968a4 100644
--- a/drivers/vdpa/ifc/base/ifcvf_osdep.h
+++ b/drivers/vdpa/ifc/base/ifcvf_osdep.h
@@ -13,8 +13,13 @@
 #include <rte_log.h>
 #include <rte_io.h>
 
-#define WARNINGOUT(S, args...)  RTE_LOG(WARNING, PMD, S, ##args)
-#define DEBUGOUT(S, args...)    RTE_LOG(DEBUG, PMD, S, ##args)
+extern int ifcvf_logtype;
+
+#define IFCVF_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, ifcvf_logtype, fmt "\n", ## args)
+
+#define WARNINGOUT(S, args...)  IFCVF_LOG(WARNING, S, ##args)
+#define DEBUGOUT(S, args...)    IFCVF_LOG(DEBUG, S, ##args)
 #define STATIC                  static
 
 #define msec_delay(x)	rte_delay_us_sleep(1000 * (x))
-- 
2.43.0


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

* [PATCH v3 27/37] raw/cnxk_bphy: replace PMD logtype with dynamic type
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (25 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 26/37] vdpa/ifc: replace use of RTE_LOGTYPE_PMD Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-13 16:36   ` [PATCH v3 28/37] raw/cnxk_gpio: " Stephen Hemminger
                     ` (9 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Jakub Palider, Tomasz Duszynski

Driver should not be using PMD logtype, they should have their
own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/raw/cnxk_bphy/cnxk_bphy.c          |  3 ++-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c      |  2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +++++++++++-----------
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h       |  5 ++++
 4 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
index 15dbc4c1a637..f1c14125d5c5 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
@@ -251,7 +251,7 @@ cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev,
 
 	/* get rid of last response if any */
 	if (qp->rsp) {
-		RTE_LOG(WARNING, PMD, "Previous response got overwritten\n");
+		BPHY_LOG(WARNING, "Previous response got overwritten");
 		rte_free(qp->rsp);
 	}
 	qp->rsp = rsp;
@@ -410,3 +410,4 @@ static struct rte_pci_driver cnxk_bphy_rawdev_pmd = {
 RTE_PMD_REGISTER_PCI(bphy_rawdev_pci_driver, cnxk_bphy_rawdev_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(bphy_rawdev_pci_driver, pci_bphy_map);
 RTE_PMD_REGISTER_KMOD_DEP(bphy_rawdev_pci_driver, "vfio-pci");
+RTE_LOG_REGISTER_DEFAULT(bphy_logtype, INFO);
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
index 2d8466ef918b..b2e8fc0e5c6f 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
@@ -189,7 +189,7 @@ cnxk_bphy_cgx_process_buf(struct cnxk_bphy_cgx *cgx, unsigned int queue,
 
 	/* get rid of last response if any */
 	if (qp->rsp) {
-		RTE_LOG(WARNING, PMD, "Previous response got overwritten\n");
+		BPHY_LOG(WARNING, "Previous response got overwritten");
 		rte_free(qp->rsp);
 	}
 	qp->rsp = rsp;
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
index a3021b4bb7db..148ee551ead1 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
@@ -57,62 +57,61 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)
 		if (ret)
 			break;
 		if (descs != 1) {
-			RTE_LOG(ERR, PMD, "Wrong number of descs reported\n");
+			BPHY_LOG(ERR, "Wrong number of descs reported");
 			ret = -ENODEV;
 			break;
 		}
 
-		RTE_LOG(INFO, PMD, "Testing queue %d\n", i);
+		BPHY_LOG(INFO, "Testing queue %d", i);
 
 		ret = rte_pmd_bphy_cgx_stop_rxtx(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to stop rx/tx\n");
+			BPHY_LOG(ERR, "Failed to stop rx/tx");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_start_rxtx(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to start rx/tx\n");
+			BPHY_LOG(ERR, "Failed to start rx/tx");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_set_link_state(dev_id, i, false);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set link down\n");
+			BPHY_LOG(ERR, "Failed to set link down");
 			break;
 		}
 
 		ret = cnxk_bphy_cgx_link_cond(dev_id, i, 0);
 		if (ret != 0)
-			RTE_LOG(ERR, PMD,
-				"Timed out waiting for a link down\n");
+			BPHY_LOG(ERR, "Timed out waiting for a link down");
 
 		ret = rte_pmd_bphy_cgx_set_link_state(dev_id, i, true);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set link up\n");
+			BPHY_LOG(ERR, "Failed to set link up");
 			break;
 		}
 
 		ret = cnxk_bphy_cgx_link_cond(dev_id, i, 1);
 		if (ret != 1)
-			RTE_LOG(ERR, PMD, "Timed out waiting for a link up\n");
+			BPHY_LOG(ERR, "Timed out waiting for a link up");
 
 		ret = rte_pmd_bphy_cgx_intlbk_enable(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to enable internal lbk\n");
+			BPHY_LOG(ERR, "Failed to enable internal lbk");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_intlbk_disable(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to disable internal lbk\n");
+			BPHY_LOG(ERR, "Failed to disable internal lbk");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_ptp_rx_enable(dev_id, i);
 		/* ptp not available on RPM */
 		if (ret < 0 && ret != -ENOTSUP) {
-			RTE_LOG(ERR, PMD, "Failed to enable ptp\n");
+			BPHY_LOG(ERR, "Failed to enable ptp");
 			break;
 		}
 		ret = 0;
@@ -120,27 +119,27 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)
 		ret = rte_pmd_bphy_cgx_ptp_rx_disable(dev_id, i);
 		/* ptp not available on RPM */
 		if (ret < 0 && ret != -ENOTSUP) {
-			RTE_LOG(ERR, PMD, "Failed to disable ptp\n");
+			BPHY_LOG(ERR, "Failed to disable ptp");
 			break;
 		}
 		ret = 0;
 
 		ret = rte_pmd_bphy_cgx_get_supported_fec(dev_id, i, &fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to get supported FEC\n");
+			BPHY_LOG(ERR, "Failed to get supported FEC");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_set_fec(dev_id, i, fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set FEC to %d\n", fec);
+			BPHY_LOG(ERR, "Failed to set FEC to %d", fec);
 			break;
 		}
 
 		fec = CNXK_BPHY_CGX_ETH_LINK_FEC_NONE;
 		ret = rte_pmd_bphy_cgx_set_fec(dev_id, i, fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to disable FEC\n");
+			BPHY_LOG(ERR, "Failed to disable FEC");
 			break;
 		}
 	}
diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
index 9d8d0285581b..5926adbcece9 100644
--- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
+++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
@@ -26,6 +26,11 @@
 extern "C" {
 #endif
 
+extern int bphy_logtype;
+
+#define BPHY_LOG(level, fmt, args...)	\
+	rte_log(RTE_LOG_ ## level, bphy_logtype, "%s(): " fmt "\n", __func__, ## args)
+
 /** Available message types */
 enum cnxk_bphy_cgx_msg_type {
 	/** Type used to obtain link information */
-- 
2.43.0


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

* [PATCH v3 28/37] raw/cnxk_gpio: replace PMD logtype with dynamic type
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (26 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 27/37] raw/cnxk_bphy: replace PMD logtype with dynamic type Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-13 16:36   ` [PATCH v3 29/37] raw/dpaa2_cmdif: replace PMD logtype with rte_log_dp Stephen Hemminger
                     ` (8 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Jakub Palider, Tomasz Duszynski

Driver should not be using PMD logtype, they should have their
own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/raw/cnxk_gpio/cnxk_gpio.c          | 22 ++++++++-------
 drivers/raw/cnxk_gpio/cnxk_gpio.h          |  4 +++
 drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 31 +++++++++++-----------
 3 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.c b/drivers/raw/cnxk_gpio/cnxk_gpio.c
index 3c4d79e4810e..0ec1b869b805 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.c
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.c
@@ -8,6 +8,7 @@
 
 #include <bus_vdev_driver.h>
 #include <rte_eal.h>
+#include <rte_log.h>
 #include <rte_kvargs.h>
 #include <rte_lcore.h>
 #include <rte_rawdev_pmd.h>
@@ -215,13 +216,13 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)
 		errno = 0;
 		val = strtol(token, NULL, 10);
 		if (errno) {
-			RTE_LOG(ERR, PMD, "failed to parse %s\n", token);
+			CNXK_LOG(ERR, "failed to parse %s", token);
 			ret = -errno;
 			goto out;
 		}
 
 		if (val < 0 || val >= gpiochip->num_gpios) {
-			RTE_LOG(ERR, PMD, "gpio%d out of 0-%d range\n", val,
+			CNXK_LOG(ERR, "gpio%d out of 0-%d range", val,
 				gpiochip->num_gpios - 1);
 			ret = -EINVAL;
 			goto out;
@@ -231,7 +232,7 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)
 			if (list[i] != val)
 				continue;
 
-			RTE_LOG(WARNING, PMD, "gpio%d already allowed\n", val);
+			CNXK_LOG(WARNING, "gpio%d already allowed", val);
 			break;
 		}
 		if (i == queue)
@@ -398,7 +399,7 @@ cnxk_gpio_queue_setup(struct rte_rawdev *dev, uint16_t queue_id,
 			return ret;
 		}
 	} else {
-		RTE_LOG(WARNING, PMD, "using existing gpio%d\n", gpio->num);
+		CNXK_LOG(WARNING, "using existing gpio%u", gpio->num);
 	}
 
 	gpiochip->gpios[num] = gpio;
@@ -647,7 +648,7 @@ cnxk_gpio_process_buf(struct cnxk_gpio *gpio, struct rte_rawdev_buf *rbuf)
 
 	/* get rid of last response if any */
 	if (gpio->rsp) {
-		RTE_LOG(WARNING, PMD, "previous response got overwritten\n");
+		CNXK_LOG(WARNING, "previous response got overwritten");
 		rte_free(gpio->rsp);
 	}
 	gpio->rsp = rsp;
@@ -741,7 +742,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	cnxk_gpio_format_name(name, sizeof(name));
 	rawdev = rte_rawdev_pmd_allocate(name, sizeof(*gpiochip), rte_socket_id());
 	if (!rawdev) {
-		RTE_LOG(ERR, PMD, "failed to allocate %s rawdev\n", name);
+		CNXK_LOG(ERR, "failed to allocate %s rawdev", name);
 		return -ENOMEM;
 	}
 
@@ -770,7 +771,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	snprintf(buf, sizeof(buf), "%s/gpiochip%d/base", CNXK_GPIO_CLASS_PATH, gpiochip->num);
 	ret = cnxk_gpio_read_attr_int(buf, &gpiochip->base);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to read %s\n", buf);
+		CNXK_LOG(ERR, "failed to read %s", buf);
 		goto out;
 	}
 
@@ -778,20 +779,20 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	snprintf(buf, sizeof(buf), "%s/gpiochip%d/ngpio", CNXK_GPIO_CLASS_PATH, gpiochip->num);
 	ret = cnxk_gpio_read_attr_int(buf, &gpiochip->num_gpios);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to read %s\n", buf);
+		CNXK_LOG(ERR, "failed to read %s", buf);
 		goto out;
 	}
 	gpiochip->num_queues = gpiochip->num_gpios;
 
 	ret = cnxk_gpio_parse_allowlist(gpiochip, params->allowlist);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to parse allowed gpios\n");
+		CNXK_LOG(ERR, "failed to parse allowed gpios");
 		goto out;
 	}
 
 	gpiochip->gpios = rte_calloc(NULL, gpiochip->num_gpios, sizeof(struct cnxk_gpio *), 0);
 	if (!gpiochip->gpios) {
-		RTE_LOG(ERR, PMD, "failed to allocate gpios memory\n");
+		CNXK_LOG(ERR, "failed to allocate gpios memory");
 		ret = -ENOMEM;
 		goto out;
 	}
@@ -851,3 +852,4 @@ RTE_PMD_REGISTER_VDEV(cnxk_gpio, cnxk_gpio_drv);
 RTE_PMD_REGISTER_PARAM_STRING(cnxk_gpio,
 		"gpiochip=<int> "
 		"allowlist=<list>");
+RTE_LOG_REGISTER_DEFAULT(cnxk_logtype, INFO);
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.h b/drivers/raw/cnxk_gpio/cnxk_gpio.h
index e62f78a7604a..d9058c364068 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.h
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.h
@@ -5,6 +5,10 @@
 #ifndef _CNXK_GPIO_H_
 #define _CNXK_GPIO_H_
 
+extern int cnxk_logtype;
+#define CNXK_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, cnxk_logtype, fmt "\n", ## args)
+
 struct cnxk_gpiochip;
 
 struct cnxk_gpio {
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c b/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
index 10742b5dc48a..e3ec85990c92 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
@@ -54,12 +54,14 @@ cnxk_gpio_read_attr(char *attr, char *val)
 	return 0;
 }
 
-#define CNXK_GPIO_ERR_STR(err, str, ...) do {                                  \
-	if (err) {                                                             \
-		RTE_LOG(ERR, PMD, "%s:%d: " str " (%d)\n", __func__, __LINE__, \
-			##__VA_ARGS__, err);                                   \
-		goto out;                                                      \
-	}                                                                      \
+
+
+#define CNXK_GPIO_ERR_STR(err, str, ...) do {				\
+	if (err) {							\
+		CNXK_LOG(ERR, "%s:%d: " str " (%d)",__func__, __LINE__, \
+			##__VA_ARGS__, err);				\
+		goto out;						\
+	}								\
 } while (0)
 
 static int
@@ -330,30 +332,28 @@ cnxk_gpio_selftest(uint16_t dev_id)
 	for (i = 0; i < queues; i++) {
 		ret = rte_rawdev_queue_conf_get(dev_id, i, &conf, sizeof(conf));
 		if (ret) {
-			RTE_LOG(ERR, PMD,
-				"failed to read queue configuration (%d)\n",
-				ret);
+			CNXK_LOG(ERR, "failed to read queue configuration (%d)n", ret);
 			goto out;
 		}
 
-		RTE_LOG(INFO, PMD, "testing queue%d (gpio%d)\n", i, conf.gpio);
+		CNXK_LOG(INFO, "testing queue%u (gpio%u)", i, conf.gpio);
 
 		if (conf.size != 1) {
-			RTE_LOG(ERR, PMD, "wrong queue size received\n");
+			CNXK_LOG(ERR, "wrong queue size received: %u", conf.size);
 			ret = -EIO;
 			goto out;
 		}
 
 		ret = rte_rawdev_queue_setup(dev_id, i, NULL, 0);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "failed to setup queue (%d)\n", ret);
+			CNXK_LOG(ERR, "failed to setup queue%u (%d)", i, ret);
 			goto out;
 		}
 
 		gpio = gpiochip->gpios[conf.gpio];
 		snprintf(buf, sizeof(buf), CNXK_GPIO_PATH_FMT, gpio->num);
 		if (!cnxk_gpio_attr_exists(buf)) {
-			RTE_LOG(ERR, PMD, "%s does not exist\n", buf);
+			CNXK_LOG(ERR, "%s does not exist", buf);
 			ret = -ENOENT;
 			goto release;
 		}
@@ -371,13 +371,12 @@ cnxk_gpio_selftest(uint16_t dev_id)
 		ret2 = ret;
 		ret = rte_rawdev_queue_release(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "failed to release queue (%d)\n",
-				ret);
+			CNXK_LOG(ERR, "failed to release queue%u (%d)", i, ret);
 			break;
 		}
 
 		if (cnxk_gpio_attr_exists(buf)) {
-			RTE_LOG(ERR, PMD, "%s still exists\n", buf);
+			CNXK_LOG(ERR, "%s still exists", buf);
 			ret = -EIO;
 			break;
 		}
-- 
2.43.0


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

* [PATCH v3 29/37] raw/dpaa2_cmdif: replace PMD logtype with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (27 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 28/37] raw/cnxk_gpio: " Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-13 16:36   ` [PATCH v3 30/37] raw/ifpga: replace PMD logtype with dynamic type Stephen Hemminger
                     ` (7 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh

Use local logtype for datapath logs.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
index 8991e8327d68..7cb423c7a57b 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
@@ -30,7 +30,8 @@ extern int dpaa2_cmdif_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_CMDIF_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa2_cmdif: " fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_cmdif_logtype, \
+		   "dpaa2_cmdif: " fmt "\n", ## args)
 
 #define DPAA2_CMDIF_DP_DEBUG(fmt, args...) \
 	DPAA2_CMDIF_DP_LOG(DEBUG, fmt, ## args)
-- 
2.43.0


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

* [PATCH v3 30/37] raw/ifpga: replace PMD logtype with dynamic type
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (28 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 29/37] raw/dpaa2_cmdif: replace PMD logtype with rte_log_dp Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-14  0:01     ` Xu, Rosen
  2023-12-13 16:36   ` [PATCH v3 31/37] event/dlb2: replace logtype PMD with rte_log_dp Stephen Hemminger
                     ` (6 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Rosen Xu, Tianfei Zhang

Driver should not be using PMD logtype, they should have their
own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/raw/ifpga/base/osdep_rte/osdep_generic.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h b/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
index 33041c907e19..ad885107ab7d 100644
--- a/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
+++ b/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
@@ -16,8 +16,10 @@
 #include <rte_byteorder.h>
 #include <rte_memcpy.h>
 
+extern int ifpga_rawdev_logtype;
+
 #define dev_printf(level, fmt, args...) \
-	RTE_LOG(level, PMD, "osdep_rte: " fmt, ## args)
+	rte_log(RTE_LOG_ ## level, ifpga_rawdev_logtype, "osdep_rte: " fmt, ## args)
 
 #define osdep_panic(...) rte_panic(...)
 
-- 
2.43.0


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

* [PATCH v3 31/37] event/dlb2: replace logtype PMD with rte_log_dp
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (29 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 30/37] raw/ifpga: replace PMD logtype with dynamic type Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-13 16:36   ` [PATCH v3 32/37] event/dpaa, event/dpaa2: use local logtype Stephen Hemminger
                     ` (5 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Abdullah Sevincer

Use local logtype for all log messages.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/dlb2/dlb2.c     | 5 ++---
 drivers/event/dlb2/dlb2_log.h | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 050ace0904b4..5a16123f0af9 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -4741,9 +4741,8 @@ dlb2_parse_params(const char *params,
 		struct rte_kvargs *kvlist = rte_kvargs_parse(params, args);
 
 		if (kvlist == NULL) {
-			RTE_LOG(INFO, PMD,
-				"Ignoring unsupported parameters when creating device '%s'\n",
-				name);
+			DLB2_LOG_INFO("Ignoring unsupported parameters when creating device '%s'\n",
+				      name);
 		} else {
 			int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG,
 						     set_numa_node,
diff --git a/drivers/event/dlb2/dlb2_log.h b/drivers/event/dlb2/dlb2_log.h
index dc1481ef870c..3d4e1879350d 100644
--- a/drivers/event/dlb2/dlb2_log.h
+++ b/drivers/event/dlb2/dlb2_log.h
@@ -20,6 +20,6 @@ extern int eventdev_dlb2_log_level;
 
 /* remove debug logs at compile time unless actually debugging */
 #define DLB2_LOG_DBG(fmt, args...) \
-	RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_DEBUG, eventdev_dlb2_log_level, fmt, ## args)
 
 #endif /* _DLB2_EVDEV_LOG_H_ */
-- 
2.43.0


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

* [PATCH v3 32/37] event/dpaa, event/dpaa2: use local logtype
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (30 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 31/37] event/dlb2: replace logtype PMD with rte_log_dp Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-15  5:55     ` Hemant Agrawal
  2023-12-13 16:36   ` [PATCH v3 33/37] event/skeleton: replace logtype PMD with dynamic type Stephen Hemminger
                     ` (4 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

The driver has macros to use local logtype, but some changes
added PMD log messages.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/dpaa/dpaa_eventdev.c            | 2 +-
 drivers/event/dpaa2/dpaa2_eventdev.c          | 4 ++--
 drivers/event/dpaa2/dpaa2_eventdev_logs.h     | 2 +-
 drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
index 46a9b88c73ae..a8e5c3421df1 100644
--- a/drivers/event/dpaa/dpaa_eventdev.c
+++ b/drivers/event/dpaa/dpaa_eventdev.c
@@ -1025,7 +1025,7 @@ dpaa_event_dev_create(const char *name, const char *params, struct rte_vdev_devi
 	eventdev->txa_enqueue = dpaa_eventdev_txa_enqueue;
 	eventdev->txa_enqueue_same_dest	= dpaa_eventdev_txa_enqueue_same_dest;
 
-	RTE_LOG(INFO, PMD, "%s eventdev added", name);
+	DPAA_EVENTDEV_INFO("%s eventdev added", name);
 
 	/* For secondary processes, the primary has done all the work */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index dd4e64395fe5..85c2dbd998dd 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -1141,7 +1141,7 @@ dpaa2_eventdev_create(const char *name, struct rte_vdev_device *vdev)
 		priv->max_event_queues++;
 	} while (dpcon_dev && dpci_dev);
 
-	RTE_LOG(INFO, PMD, "%s eventdev created\n", name);
+	DPAA2_EVENTDEV_INFO("%s eventdev created", name);
 
 done:
 	event_dev_probing_finish(eventdev);
@@ -1178,7 +1178,7 @@ dpaa2_eventdev_destroy(const char *name)
 	}
 	priv->max_event_queues = 0;
 
-	RTE_LOG(INFO, PMD, "%s eventdev cleaned\n", name);
+	DPAA2_EVENTDEV_INFO("%s eventdev cleaned", name);
 	return 0;
 }
 
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
index 66c8c772740d..69aebf569fa5 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_logs.h
+++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
@@ -26,7 +26,7 @@ extern int dpaa2_logtype_event;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_EVENTDEV_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_event, fmt, ## args)
 
 #define DPAA2_EVENTDEV_DP_DEBUG(fmt, args...) \
 	DPAA2_EVENTDEV_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
index 427aff4b1111..9d4938efe6aa 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
@@ -774,15 +774,15 @@ static void dpaa2_test_run(int (*setup)(void), void (*tdown)(void),
 		int (*test)(void), const char *name)
 {
 	if (setup() < 0) {
-		RTE_LOG(INFO, PMD, "Error setting up test %s", name);
+		DPAA2_EVENTDEV_INFO("Error setting up test %s", name);
 		unsupported++;
 	} else {
 		if (test() < 0) {
 			failed++;
-			RTE_LOG(INFO, PMD, "%s Failed\n", name);
+			DPAA2_EVENTDEV_INFO("%s Failed", name);
 		} else {
 			passed++;
-			RTE_LOG(INFO, PMD, "%s Passed", name);
+			DPAA2_EVENTDEV_INFO("%s Passed", name);
 		}
 	}
 
-- 
2.43.0


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

* [PATCH v3 33/37] event/skeleton: replace logtype PMD with dynamic type
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (31 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 32/37] event/dpaa, event/dpaa2: use local logtype Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-13 16:36   ` [PATCH v3 34/37] crypto/caam_jr: replace logtype PMD Stephen Hemminger
                     ` (3 subsequent siblings)
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Jerin Jacob

The skeleton is supposed to match current best practices.
Change it to use dynamic logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/skeleton/skeleton_eventdev.c | 3 ++-
 drivers/event/skeleton/skeleton_eventdev.h | 8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c
index 7df032b7daa1..df50d2e4e4ff 100644
--- a/drivers/event/skeleton/skeleton_eventdev.c
+++ b/drivers/event/skeleton/skeleton_eventdev.c
@@ -457,7 +457,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)
 	const char *name;
 
 	name = rte_vdev_device_name(vdev);
-	RTE_LOG(INFO, PMD, "Initializing %s on NUMA node %d\n", name,
+	PMD_DRV_LOG(INFO, "Initializing %s on NUMA node %d\n", name,
 			rte_socket_id());
 	return skeleton_eventdev_create(name, rte_socket_id(), vdev);
 }
@@ -479,3 +479,4 @@ static struct rte_vdev_driver vdev_eventdev_skeleton_pmd = {
 };
 
 RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_SKELETON_PMD, vdev_eventdev_skeleton_pmd);
+RTE_LOG_REGISTER_DEFAULT(skeleton_eventdev_logtype, INFO);
diff --git a/drivers/event/skeleton/skeleton_eventdev.h b/drivers/event/skeleton/skeleton_eventdev.h
index 9193f45f4782..9c1ed4ec5755 100644
--- a/drivers/event/skeleton/skeleton_eventdev.h
+++ b/drivers/event/skeleton/skeleton_eventdev.h
@@ -8,9 +8,12 @@
 #include <eventdev_pmd_pci.h>
 #include <eventdev_pmd_vdev.h>
 
+extern int skeleton_eventdev_logtype;
+
 #ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG
 #define PMD_DRV_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, skeleton_eventdev_logtype, \
+		"%s(): " fmt "\n", __func__, ## args)
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
 #else
 #define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
@@ -18,7 +21,8 @@
 #endif
 
 #define PMD_DRV_ERR(fmt, args...) \
-	RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ERR, skeleton_eventdev_logtype, \
+		"%s(): " fmt "\n", __func__, ## args)
 
 struct skeleton_eventdev {
 	uintptr_t reg_base;
-- 
2.43.0


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

* [PATCH v3 34/37] crypto/caam_jr: replace logtype PMD
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (32 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 33/37] event/skeleton: replace logtype PMD with dynamic type Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-15  5:54     ` Hemant Agrawal
  2023-12-13 16:36   ` [PATCH v3 35/37] crypto/ccp: do not use PMD logtype Stephen Hemminger
                     ` (2 subsequent siblings)
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal

The driver has macros for logging, they just weren't used
everywhere.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/caam_jr/caam_jr.c     | 8 +++-----
 drivers/crypto/caam_jr/caam_jr_log.h | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index b55258689b49..9c713d4e8133 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -2346,7 +2346,7 @@ caam_jr_dev_init(const char *name,
 
 	rte_cryptodev_pmd_probing_finish(dev);
 
-	RTE_LOG(INFO, PMD, "%s cryptodev init\n", dev->data->name);
+	CAAM_JR_INFO("%s cryptodev init\n", dev->data->name);
 
 	return 0;
 
@@ -2386,8 +2386,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev)
 
 	ret = of_init();
 	if (ret) {
-		RTE_LOG(ERR, PMD,
-		"of_init failed\n");
+		CAAM_JR_ERR("of_init failed\n");
 		return -EINVAL;
 	}
 	/* if sec device version is not configured */
@@ -2407,8 +2406,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev)
 	}
 #ifdef RTE_LIBRTE_PMD_CAAM_JR_BE
 	if (rta_get_sec_era() > RTA_SEC_ERA_8) {
-		RTE_LOG(ERR, PMD,
-		"CAAM is compiled in BE mode for device with sec era > 8???\n");
+		CAAM_JR_ERR("CAAM is compiled in BE mode for device with sec era > 8???\n");
 		return -EINVAL;
 	}
 #endif
diff --git a/drivers/crypto/caam_jr/caam_jr_log.h b/drivers/crypto/caam_jr/caam_jr_log.h
index 106ff07a70fe..2dded646dbdc 100644
--- a/drivers/crypto/caam_jr/caam_jr_log.h
+++ b/drivers/crypto/caam_jr/caam_jr_log.h
@@ -28,7 +28,7 @@ extern int caam_jr_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define CAAM_JR_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	rte_log_dp(RTE_LOG_ ## level, caam_jr_logtype, fmt "\n", ## args)
 
 #define CAAM_JR_DP_DEBUG(fmt, args...) \
 	CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
-- 
2.43.0


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

* [PATCH v3 35/37] crypto/ccp: do not use PMD logtype
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (33 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 34/37] crypto/caam_jr: replace logtype PMD Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-13 16:36   ` [PATCH v3 36/37] crypto/scheduler: replace use of logtype PMD Stephen Hemminger
  2023-12-13 16:36   ` [PATCH v3 37/37] crypto/dpaa_sec, crypto/dpaa2_sec: replace use of PMD logtype Stephen Hemminger
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Sunil Uttarwar, Ravi Kumar

This driver has logging macros but not used consistently.

Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/ccp/rte_ccp_pmd.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index a5271d72273d..46a9275e3743 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -194,8 +194,7 @@ cryptodev_ccp_remove(struct rte_pci_device *pci_dev)
 
 	ccp_pmd_init_done = 0;
 
-	RTE_LOG(INFO, PMD, "Closing ccp device %s on numa socket %u\n",
-			name, rte_socket_id());
+	CCP_LOG_INFO("Closing ccp device %s on numa socket %u", name, rte_socket_id());
 
 	return rte_cryptodev_pmd_destroy(dev);
 }
@@ -228,7 +227,7 @@ cryptodev_ccp_create(const char *name,
 	}
 	cryptodev_cnt++;
 
-	CCP_LOG_DBG("CCP : Crypto device count = %d\n", cryptodev_cnt);
+	CCP_LOG_DBG("CCP : Crypto device count = %d", cryptodev_cnt);
 	dev->device = &pci_dev->device;
 	dev->device->driver = &pci_drv->driver;
 	dev->driver_id = ccp_cryptodev_driver_id;
@@ -279,7 +278,7 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	};
 
 	if (ccp_pmd_init_done) {
-		RTE_LOG(INFO, PMD, "CCP PMD already initialized\n");
+		CCP_LOG_INFO("CCP PMD already initialized");
 		return -EFAULT;
 	}
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
@@ -288,11 +287,11 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	init_params.def_p.max_nb_queue_pairs = CCP_PMD_MAX_QUEUE_PAIRS;
 
-	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
+	CCP_LOG_INFO("Initialising %s on NUMA node %d", name,
 		init_params.def_p.socket_id);
-	RTE_LOG(INFO, PMD, "Max number of queue pairs = %d\n",
+	CCP_LOG_INFO("Max number of queue pairs = %d",
 		init_params.def_p.max_nb_queue_pairs);
-	RTE_LOG(INFO, PMD, "Authentication offload to %s\n",
+	CCP_LOG_INFO("Authentication offload to %s",
 		((init_params.auth_opt == 0) ? "CCP" : "CPU"));
 
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
-- 
2.43.0


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

* [PATCH v3 36/37] crypto/scheduler: replace use of logtype PMD
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (34 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 35/37] crypto/ccp: do not use PMD logtype Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-13 16:36   ` [PATCH v3 37/37] crypto/dpaa_sec, crypto/dpaa2_sec: replace use of PMD logtype Stephen Hemminger
  36 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Kai Ji, Fan Zhang

Driver has logging macro but not used everywhere.

Fixes: 6760463c9f26 ("crypto/scheduler: add mode-specific threshold parameter")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/scheduler/scheduler_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
index 589d092d7457..aaf2dcdb57ec 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -197,8 +197,8 @@ cryptodev_scheduler_create(const char *name,
 				return -EINVAL;
 			}
 
-			RTE_LOG(INFO, PMD, "  Sched mode param (%s = %s)\n",
-					param_name, param_val);
+			CR_SCHED_LOG(INFO, "  Sched mode param (%s = %s)\n",
+				     param_name, param_val);
 		}
 	}
 
-- 
2.43.0


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

* [PATCH v3 37/37] crypto/dpaa_sec, crypto/dpaa2_sec: replace use of PMD logtype
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
                     ` (35 preceding siblings ...)
  2023-12-13 16:36   ` [PATCH v3 36/37] crypto/scheduler: replace use of logtype PMD Stephen Hemminger
@ 2023-12-13 16:36   ` Stephen Hemminger
  2023-12-15  5:55     ` Hemant Agrawal
  36 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-13 16:36 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal

Use macro consistently for all logs and rte_log_dp() for datapath.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 +++---
 drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h   | 4 ++--
 drivers/crypto/dpaa_sec/dpaa_sec.c          | 4 ++--
 drivers/crypto/dpaa_sec/dpaa_sec_log.h      | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index bb5a2c629e53..1cae6c45059e 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -4153,7 +4153,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 		ret = dpseci_set_opr(dpseci, CMD_PRI_LOW, priv->token,
 				   qp_id, OPR_OPT_CREATE, &ocfg);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Error setting opr: ret: %d\n", ret);
+			DPAA2_SEC_ERR("Error setting opr: ret: %d", ret);
 			return ret;
 		}
 		qp->tx_vq.cb_eqresp_free = dpaa2_sec_free_eqresp_buf;
@@ -4163,7 +4163,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 	ret = dpseci_set_rx_queue(dpseci, CMD_PRI_LOW, priv->token,
 				  qp_id, &cfg);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "Error in dpseci_set_queue: ret: %d\n", ret);
+		DPAA2_SEC_ERR("Error in dpseci_set_queue: ret: %d", ret);
 		return ret;
 	}
 
@@ -4188,7 +4188,7 @@ dpaa2_sec_eventq_detach(const struct rte_cryptodev *dev,
 	ret = dpseci_set_rx_queue(dpseci, CMD_PRI_LOW, priv->token,
 				  qp_id, &cfg);
 	if (ret)
-		RTE_LOG(ERR, PMD, "Error in dpseci_set_queue: ret: %d\n", ret);
+		DPAA2_SEC_ERR("Error in dpseci_set_queue: ret: %d", ret);
 
 	return ret;
 }
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
index c2e11f9516f9..cd47225f4720 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
@@ -29,7 +29,7 @@ extern int dpaa2_logtype_sec;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_SEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_sec, fmt, ## args)
 
 #define DPAA2_SEC_DP_DEBUG(fmt, args...) \
 	DPAA2_SEC_DP_LOG(DEBUG, fmt, ## args)
@@ -38,7 +38,7 @@ extern int dpaa2_logtype_sec;
 #define DPAA2_SEC_DP_WARN(fmt, args...) \
 	DPAA2_SEC_DP_LOG(WARNING, fmt, ## args)
 #define DPAA2_SEC_DP_ERR(fmt, args...) \
-		DPAA2_SEC_DP_LOG(ERR, fmt, ## args)
+	DPAA2_SEC_DP_LOG(ERR, fmt, ## args)
 
 
 #endif /* _DPAA2_SEC_LOGS_H_ */
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index a301e8edb2a4..3008ca4dc2f7 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -3518,7 +3518,7 @@ dpaa_sec_eventq_detach(const struct rte_cryptodev *dev,
 	qman_oos_fq(&qp->outq);
 	ret = qman_init_fq(&qp->outq, 0, &opts);
 	if (ret)
-		RTE_LOG(ERR, PMD, "Error in qman_init_fq: ret: %d\n", ret);
+		DPAA_SEC_ERR("Error in qman_init_fq: ret: %d\n", ret);
 	qp->outq.cb.dqrr = NULL;
 
 	return ret;
@@ -3709,7 +3709,7 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)
 
 	dpaa_sec_get_devargs(cryptodev->device->devargs, DRIVER_DUMP_MODE);
 
-	RTE_LOG(INFO, PMD, "%s cryptodev init\n", cryptodev->data->name);
+	DPAA_SEC_INFO("%s cryptodev init\n", cryptodev->data->name);
 	return 0;
 
 init_error:
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_log.h b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
index fb895a8bc67f..936a61c2c18f 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec_log.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
@@ -29,7 +29,7 @@ extern int dpaa_logtype_sec;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_SEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	rte_log_dp(RTE_LOG_ ## level, dpaa_logtype_sec, fmt, ## args)
 
 #define DPAA_SEC_DP_DEBUG(fmt, args...) \
 	DPAA_SEC_DP_LOG(DEBUG, fmt, ## args)
-- 
2.43.0


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

* RE: [PATCH v2 10/25] net/mana: replace RTE_LOG_DP with rte_log_dp
  2023-12-13  4:16   ` [PATCH v2 10/25] net/mana: " Stephen Hemminger
@ 2023-12-13 19:16     ` Long Li
  0 siblings, 0 replies; 214+ messages in thread
From: Long Li @ 2023-12-13 19:16 UTC (permalink / raw)
  To: stephen, dev; +Cc: stephen

> Subject: [PATCH v2 10/25] net/mana: replace RTE_LOG_DP with rte_log_dp
> 
> Want datapath logs to use own logtype.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Long Li <longli@microsoft.com>

> ---
>  drivers/net/mana/mana.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h index
> 6836872dc257..8d60f9172d44 100644
> --- a/drivers/net/mana/mana.h
> +++ b/drivers/net/mana/mana.h
> @@ -467,7 +467,7 @@ extern int mana_logtype_init;
>  		__func__, ## args)
> 
>  #define DP_LOG(level, fmt, args...) \
> -	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
> +	rte_log_dp(RTE_LOG_ ## level, mana_logtype_driver, fmt "\n", ## args)
> 
>  #define PMD_INIT_LOG(level, fmt, args...) \
>  	rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
> --
> 2.42.0


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

* RE: [PATCH v3 10/37] net/mana: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35   ` [PATCH v3 10/37] net/mana: " Stephen Hemminger
@ 2023-12-13 19:17     ` Long Li
  0 siblings, 0 replies; 214+ messages in thread
From: Long Li @ 2023-12-13 19:17 UTC (permalink / raw)
  To: stephen, dev; +Cc: stephen

> Subject: [PATCH v3 10/37] net/mana: replace RTE_LOG_DP with rte_log_dp
> 
> Want datapath logs to use own logtype.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Long Li <longli@microsoft.com>

> ---
>  drivers/net/mana/mana.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h index
> 6836872dc257..8d60f9172d44 100644
> --- a/drivers/net/mana/mana.h
> +++ b/drivers/net/mana/mana.h
> @@ -467,7 +467,7 @@ extern int mana_logtype_init;
>  		__func__, ## args)
> 
>  #define DP_LOG(level, fmt, args...) \
> -	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
> +	rte_log_dp(RTE_LOG_ ## level, mana_logtype_driver, fmt "\n", ## args)
> 
>  #define PMD_INIT_LOG(level, fmt, args...) \
>  	rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
> --
> 2.43.0


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

* RE: [PATCH v3 30/37] raw/ifpga: replace PMD logtype with dynamic type
  2023-12-13 16:36   ` [PATCH v3 30/37] raw/ifpga: replace PMD logtype with dynamic type Stephen Hemminger
@ 2023-12-14  0:01     ` Xu, Rosen
  0 siblings, 0 replies; 214+ messages in thread
From: Xu, Rosen @ 2023-12-14  0:01 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Tianfei Zhang

Hi,

> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Thursday, December 14, 2023 12:36 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Xu, Rosen
> <rosen.xu@intel.com>; Tianfei Zhang <tianfei.zhang@intel.com>
> Subject: [PATCH v3 30/37] raw/ifpga: replace PMD logtype with dynamic type
> 
> Driver should not be using PMD logtype, they should have their own logtype.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/raw/ifpga/base/osdep_rte/osdep_generic.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
> b/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
> index 33041c907e19..ad885107ab7d 100644
> --- a/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
> +++ b/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
> @@ -16,8 +16,10 @@
>  #include <rte_byteorder.h>
>  #include <rte_memcpy.h>
> 
> +extern int ifpga_rawdev_logtype;
> +
>  #define dev_printf(level, fmt, args...) \
> -	RTE_LOG(level, PMD, "osdep_rte: " fmt, ## args)
> +	rte_log(RTE_LOG_ ## level, ifpga_rawdev_logtype, "osdep_rte: "
> fmt, ##
> +args)
> 
>  #define osdep_panic(...) rte_panic(...)
> 
> --
> 2.43.0

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

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

* RE: [EXT] [PATCH v3 14/37] net/qede: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35   ` [PATCH v3 14/37] net/qede: " Stephen Hemminger
@ 2023-12-14  0:34     ` Devendra Singh Rawat
  0 siblings, 0 replies; 214+ messages in thread
From: Devendra Singh Rawat @ 2023-12-14  0:34 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Alok Prasad


>-----Original Message-----
>From: Stephen Hemminger <stephen@networkplumber.org>
>Sent: Wednesday, December 13, 2023 10:06 PM
>To: dev@dpdk.org
>Cc: Stephen Hemminger <stephen@networkplumber.org>; Devendra Singh
>Rawat <dsinghrawat@marvell.com>; Alok Prasad <palok@marvell.com>
>Subject: [EXT] [PATCH v3 14/37] net/qede: replace RTE_LOG_DP with
>rte_log_dp
>
>External Email
>
>----------------------------------------------------------------------
>Want datapath logs to use own logtype.
>
>Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>---
> drivers/net/qede/qede_logs.h | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/net/qede/qede_logs.h b/drivers/net/qede/qede_logs.h
>index 3187d97bb7b0..f7aa14df7e3b 100644
>--- a/drivers/net/qede/qede_logs.h
>+++ b/drivers/net/qede/qede_logs.h
>@@ -58,16 +58,18 @@ extern int qede_logtype_init;  #define
>PMD_INIT_FUNC_TRACE(edev) PMD_INIT_LOG(DEBUG, edev, " >>")
>
> #ifdef RTE_LIBRTE_QEDE_DEBUG_TX
>-#define PMD_TX_LOG(level, q, fmt, args...) \
>-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \
>+#define PMD_TX_LOG(level, q, fmt, args...)			\
>+	rte_log(RTE_LOG_ ## level, qede_logtype_driver,		\
>+		"%s(): port=%u queue=%u " fmt "\n",		\
> 		__func__, q->port_id, q->queue_id, ## args)  #else  #define
>PMD_TX_LOG(level, fmt, args...) do { } while (0)  #endif
>
> #ifdef RTE_LIBRTE_QEDE_DEBUG_RX
>-#define PMD_RX_LOG(level, q, fmt, args...) \
>-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n",	\
>+#define PMD_RX_LOG(level, q, fmt, args...)			\
>+	rte_log(RTE_LOG_ ## level, qede_logtype_driver,		\
>+		"%s(): port=%u queue=%u " fmt "\n",		\
> 		__func__, q->port_id, q->queue_id, ## args)  #else  #define
>PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
>--
>2.43.0

Acked.
Acked-by: Devendra Singh Rawat <dsinghrawat@marvell.com>

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

* RE: [PATCH v3 06/37] net/dpaa: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35   ` [PATCH v3 06/37] net/dpaa: " Stephen Hemminger
@ 2023-12-15  5:52     ` Hemant Agrawal
  0 siblings, 0 replies; 214+ messages in thread
From: Hemant Agrawal @ 2023-12-15  5:52 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Sachin Saxena

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

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

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

* RE: [PATCH v3 07/37] net/dpaa2: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35   ` [PATCH v3 07/37] net/dpaa2: " Stephen Hemminger
@ 2023-12-15  5:52     ` Hemant Agrawal
  0 siblings, 0 replies; 214+ messages in thread
From: Hemant Agrawal @ 2023-12-15  5:52 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Sachin Saxena

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

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

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

* RE: [PATCH v3 21/37] basband/la12xx: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35   ` [PATCH v3 21/37] basband/la12xx: replace RTE_LOG_DP with rte_log_dp Stephen Hemminger
@ 2023-12-15  5:53     ` Hemant Agrawal
  0 siblings, 0 replies; 214+ messages in thread
From: Hemant Agrawal @ 2023-12-15  5:53 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Gagandeep Singh

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

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

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

* RE: [PATCH v3 23/37] bus/fslmc: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35   ` [PATCH v3 23/37] bus/fslmc: " Stephen Hemminger
@ 2023-12-15  5:54     ` Hemant Agrawal
  0 siblings, 0 replies; 214+ messages in thread
From: Hemant Agrawal @ 2023-12-15  5:54 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Sachin Saxena

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

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

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

* RE: [PATCH v3 24/37] dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
  2023-12-13 16:35   ` [PATCH v3 24/37] dma/dpaa, dma/dpaa2: " Stephen Hemminger
@ 2023-12-15  5:54     ` Hemant Agrawal
  0 siblings, 0 replies; 214+ messages in thread
From: Hemant Agrawal @ 2023-12-15  5:54 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Gagandeep Singh, Sachin Saxena

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

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

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

* RE: [PATCH v3 25/37] mempool/dpaa, mempool/dpaa2: do not use logtype PMD
  2023-12-13 16:35   ` [PATCH v3 25/37] mempool/dpaa, mempool/dpaa2: do not use logtype PMD Stephen Hemminger
@ 2023-12-15  5:54     ` Hemant Agrawal
  0 siblings, 0 replies; 214+ messages in thread
From: Hemant Agrawal @ 2023-12-15  5:54 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Sachin Saxena

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

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

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

* RE: [PATCH v3 34/37] crypto/caam_jr: replace logtype PMD
  2023-12-13 16:36   ` [PATCH v3 34/37] crypto/caam_jr: replace logtype PMD Stephen Hemminger
@ 2023-12-15  5:54     ` Hemant Agrawal
  0 siblings, 0 replies; 214+ messages in thread
From: Hemant Agrawal @ 2023-12-15  5:54 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Gagandeep Singh

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

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

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

* RE: [PATCH v3 32/37] event/dpaa, event/dpaa2: use local logtype
  2023-12-13 16:36   ` [PATCH v3 32/37] event/dpaa, event/dpaa2: use local logtype Stephen Hemminger
@ 2023-12-15  5:55     ` Hemant Agrawal
  0 siblings, 0 replies; 214+ messages in thread
From: Hemant Agrawal @ 2023-12-15  5:55 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Sachin Saxena

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

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

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

* RE: [PATCH v3 37/37] crypto/dpaa_sec, crypto/dpaa2_sec: replace use of PMD logtype
  2023-12-13 16:36   ` [PATCH v3 37/37] crypto/dpaa_sec, crypto/dpaa2_sec: replace use of PMD logtype Stephen Hemminger
@ 2023-12-15  5:55     ` Hemant Agrawal
  0 siblings, 0 replies; 214+ messages in thread
From: Hemant Agrawal @ 2023-12-15  5:55 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Gagandeep Singh

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

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

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

* RE: [PATCH v3 20/37] common/dpaax: do not use PMD logtype
  2023-12-13 16:35   ` [PATCH v3 20/37] common/dpaax: do not use " Stephen Hemminger
@ 2023-12-15  5:56     ` Hemant Agrawal
  0 siblings, 0 replies; 214+ messages in thread
From: Hemant Agrawal @ 2023-12-15  5:56 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Sachin Saxena

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

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

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

* Re: [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD
  2023-12-13 15:09     ` Stephen Hemminger
@ 2023-12-18 14:03       ` David Marchand
  0 siblings, 0 replies; 214+ messages in thread
From: David Marchand @ 2023-12-18 14:03 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Wed, Dec 13, 2023 at 4:09 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Wed, 13 Dec 2023 09:00:48 +0100
> David Marchand <david.marchand@redhat.com> wrote:
>
> > On Wed, Dec 13, 2023 at 5:19 AM Stephen Hemminger
> > <stephen@networkplumber.org> wrote:
> > >
> > > The generic RTE_LOGTYPE_PMD is a leftover and should be removed.
> > > As a first step, fix many drivers to not use it, and add a
> > > helper for the RTE_LOG_DP().
> >
> > I don't see why we need a new rte_log_dp helper.
> > The #define RTE_LOGTYPE_XXX trick should work fine with RTE_LOG_DP().
> > What else is missing?
>
> The problem is RTE_LOG_DP() usage today takes suffixes. So the param
> log type can only be one of the pre-defined fixed values.
>
> Changing the macro in one patch would be a huge patch.

I am not asking for change in the RTE_LOG_DP() API.
I sent a patch doing for what I had in mind:
https://patchwork.dpdk.org/project/dpdk/patch/20231218135932.1497163-1-david.marchand@redhat.com/


>
> It seemed best to have RTE_LOG_DP() stay like RTE_LOG()
> and introduce rte_log_dp() to match rte_log().
>

rte_log() seems a low level API, I don't like the idea of adding
another one with rte_log_dp().
And it will conflict with the cleanup I started on multiline / line
with \n in logs.


-- 
David Marchand


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

* [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (27 preceding siblings ...)
  2023-12-13 16:35 ` [PATCH v3 00/37] Replace uso " Stephen Hemminger
@ 2023-12-18 19:22 ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 01/17] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
                     ` (16 more replies)
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                   ` (3 subsequent siblings)
  32 siblings, 17 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a leftover and should be removed.
This replaces all uses in current tree. It leaves PMD logtype
as deprecated because there maybe other uses in external projects
leftover.

Depends-on: patch-135264 ("drivers: use dedicated logtypes")

Stephen Hemminger (17):
  common/sfc_efx: remove use of PMD logtype
  mempool/dpaa2: use driver logtype not PMD
  net/dpaa: use dedicated logtype not PMD
  net/dpaa2: used dedicated logtype not PMD
  net/mvpp2: use dedicated logtype
  net/vmxnet3: used dedicated logtype not PMD
  raw/cnxk: replace PMD logtype with dynamic type
  crypto/scheduler: replace use of logtype PMD
  crypto/ccp: do not use PMD logtype
  crypto/caam_jr: use dedicated logtype
  crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
  event/dlb2: use dedicated logtype
  event/dpaa, event/dpaa2: use dedicated logtype
  event/skeleton: replace logtype PMD with dynamic type
  net/nfb: use dynamic logtype
  examples/fips_validation: replace use of PMD logtype
  log: mark PMD logtype as deprecated

 drivers/common/cnxk/roc_platform.h            | 16 ++++---
 drivers/common/sfc_efx/sfc_efx.c              | 11 +----
 drivers/common/sfc_efx/sfc_efx_log.h          |  2 +-
 drivers/crypto/caam_jr/caam_jr.c              | 10 ++---
 drivers/crypto/ccp/rte_ccp_pmd.c              | 13 +++---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |  6 +--
 drivers/crypto/dpaa_sec/dpaa_sec.c            |  4 +-
 drivers/crypto/scheduler/scheduler_pmd.c      |  4 +-
 drivers/event/dlb2/dlb2.c                     |  5 +--
 drivers/event/dpaa/dpaa_eventdev.c            |  2 +-
 drivers/event/dpaa2/dpaa2_eventdev.c          |  4 +-
 drivers/event/dpaa2/dpaa2_eventdev_selftest.c |  6 +--
 drivers/event/skeleton/skeleton_eventdev.c    |  3 +-
 drivers/event/skeleton/skeleton_eventdev.h    |  8 +++-
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c      |  4 +-
 drivers/net/dpaa/dpaa_ethdev.c                |  8 ++--
 drivers/net/dpaa2/dpaa2_ethdev.c              |  2 +-
 drivers/net/dpaa2/dpaa2_sparser.c             |  4 +-
 drivers/net/mvpp2/mrvl_ethdev.c               |  4 +-
 drivers/net/nfb/nfb.h                         |  5 +++
 drivers/net/nfb/nfb_ethdev.c                  | 24 +++++-----
 drivers/net/nfb/nfb_rx.c                      |  9 ++--
 drivers/net/nfb/nfb_rx.h                      |  2 +-
 drivers/net/nfb/nfb_tx.c                      |  9 ++--
 drivers/net/nfb/nfb_tx.h                      |  2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |  2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy.c             |  3 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c         |  2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c    | 31 +++++++------
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h          |  6 +++
 drivers/raw/cnxk_gpio/cnxk_gpio.c             | 21 ++++-----
 drivers/raw/cnxk_gpio/cnxk_gpio.h             |  5 +++
 drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c    | 17 ++++---
 examples/fips_validation/fips_dev_self_test.c | 44 +++++++++----------
 lib/log/log.c                                 |  3 ++
 lib/log/rte_log.h                             |  2 +-
 36 files changed, 156 insertions(+), 147 deletions(-)

-- 
2.43.0


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

* [PATCH v4 01/17] common/sfc_efx: remove use of PMD logtype
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 02/17] mempool/dpaa2: use driver logtype not PMD Stephen Hemminger
                     ` (15 subsequent siblings)
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This code was implemented in a slightly different manner
than all the other logging code (for no good reason).
Make it the same and handle errors in same way as
other drivers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/sfc_efx/sfc_efx.c     | 11 ++---------
 drivers/common/sfc_efx/sfc_efx_log.h |  2 +-
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/common/sfc_efx/sfc_efx.c b/drivers/common/sfc_efx/sfc_efx.c
index 2dc5545760b8..5eeffb065b0d 100644
--- a/drivers/common/sfc_efx/sfc_efx.c
+++ b/drivers/common/sfc_efx/sfc_efx.c
@@ -15,7 +15,7 @@
 #include "sfc_efx_log.h"
 #include "sfc_efx.h"
 
-uint32_t sfc_efx_logtype;
+int sfc_efx_logtype;
 
 static int
 sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,
 	return rc;
 }
 
-RTE_INIT(sfc_efx_register_logtype)
-{
-	int ret;
-
-	ret = rte_log_register_type_and_pick_level("pmd.common.sfc_efx",
-						   RTE_LOG_NOTICE);
-	sfc_efx_logtype = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
-}
+RTE_LOG_REGISTER_DEFAULT(sfc_efx_logtype, NOTICE);
diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h
index 694455c1b14e..1519ebdc175f 100644
--- a/drivers/common/sfc_efx/sfc_efx_log.h
+++ b/drivers/common/sfc_efx/sfc_efx_log.h
@@ -11,7 +11,7 @@
 #define _SFC_EFX_LOG_H_
 
 /** Generic driver log type */
-extern uint32_t sfc_efx_logtype;
+extern int sfc_efx_logtype;
 
 /** Log message, add a prefix and a line break */
 #define SFC_EFX_LOG(level, ...) \
-- 
2.43.0


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

* [PATCH v4 02/17] mempool/dpaa2: use driver logtype not PMD
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 01/17] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 03/17] net/dpaa: use dedicated " Stephen Hemminger
                     ` (14 subsequent siblings)
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The driver already has macros for logging, use them.
Fixes: 7ed359909556 ("mempool/dpaa2: add functions for CMDIF")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 84371d5d1abb..4c9245cb814c 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_ERR("DPAA2 buffer pool not configured");
 		return -ENOMEM;
 	}
 
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_ERR("DPAA2 buffer pool not configured");
 		return NULL;
 	}
 
-- 
2.43.0


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

* [PATCH v4 03/17] net/dpaa: use dedicated logtype not PMD
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 01/17] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 02/17] mempool/dpaa2: use driver logtype not PMD Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 04/17] net/dpaa2: used " Stephen Hemminger
                     ` (13 subsequent siblings)
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The driver already has a logtype, but was not used in couple
places.

Fixes: 6b10d1f7bdea ("net/dpaa: update process specific device info")
Fixes: c2c4f87b1259 ("net: add macro for MAC address print")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa/dpaa_ethdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index ef4c06db6a4d..2b497694cb02 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -2096,8 +2096,8 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 	/* copy the primary mac address */
 	rte_ether_addr_copy(&fman_intf->mac_addr, &eth_dev->data->mac_addrs[0]);
 
-	RTE_LOG(INFO, PMD, "net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n",
-		dpaa_device->name, RTE_ETHER_ADDR_BYTES(&fman_intf->mac_addr));
+	DPAA_PMD_INFO("net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT,
+		      dpaa_device->name, RTE_ETHER_ADDR_BYTES(&fman_intf->mac_addr));
 
 	if (!fman_intf->is_shared_mac) {
 		/* Configure error packet handling */
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 
 		ret = dpaa_dev_init_secondary(eth_dev);
 		if (ret != 0) {
-			RTE_LOG(ERR, PMD, "secondary dev init failed\n");
+			DPAA_PMD_ERR("secondary dev init failed");
 			return ret;
 		}
 
@@ -2182,7 +2182,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 
 		if (!(default_q || fmc_q)) {
 			if (dpaa_fm_init()) {
-				DPAA_PMD_ERR("FM init failed\n");
+				DPAA_PMD_ERR("FM init failed");
 				return -1;
 			}
 		}
-- 
2.43.0


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

* [PATCH v4 04/17] net/dpaa2: used dedicated logtype not PMD
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (2 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 03/17] net/dpaa: use dedicated " Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 05/17] net/mvpp2: use dedicated logtype Stephen Hemminger
                     ` (12 subsequent siblings)
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The driver has a logtype, but was not being used in one place.

Fixes: f023d059769f ("net/dpaa2: support recycle loopback port")
Fixes: 72ec7a678e70 ("net/dpaa2: add soft parser driver")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa2/dpaa2_ethdev.c  | 2 +-
 drivers/net/dpaa2/dpaa2_sparser.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 8e610b6bba30..91846fcd2f23 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 			return ret;
 		}
 	}
-	RTE_LOG(INFO, PMD, "%s: netdev created, connected to %s\n",
+	DPAA2_PMD_INFO("%s: netdev created, connected to %s",
 		eth_dev->data->name, dpaa2_dev->ep_name);
 
 	return 0;
diff --git a/drivers/net/dpaa2/dpaa2_sparser.c b/drivers/net/dpaa2/dpaa2_sparser.c
index 63463c4fbfd6..36a14526a5c5 100644
--- a/drivers/net/dpaa2/dpaa2_sparser.c
+++ b/drivers/net/dpaa2/dpaa2_sparser.c
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 
 	priv->ss_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(addr));
 	priv->ss_offset += sp_param.size;
-	RTE_LOG(INFO, PMD, "Soft parser loaded for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser loaded for dpni@%d", priv->hw_id);
 
 	rte_free(addr);
 	return 0;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 	}
 
 	rte_free(param_addr);
-	RTE_LOG(INFO, PMD, "Soft parser enabled for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser enabled for dpni@%d", priv->hw_id);
 	return 0;
 }
-- 
2.43.0


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

* [PATCH v4 05/17] net/mvpp2: use dedicated logtype
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (3 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 04/17] net/dpaa2: used " Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 06/17] net/vmxnet3: used dedicated logtype not PMD Stephen Hemminger
                     ` (11 subsequent siblings)
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Always use the dedicated logtype, not PMD.

Fixes: 9e79d810911d ("net/mvpp2: support Tx scatter/gather")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index c12364941d62..9a9279a8783a 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)
 
 	/* Use a simple Tx queue (no offloads, no multi segs) if possible */
 	if (priv->multiseg) {
-		RTE_LOG(INFO, PMD, "Using multi-segment tx callback\n");
+		MRVL_LOG(INFO, "Using multi-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst;
 	} else {
-		RTE_LOG(INFO, PMD, "Using single-segment tx callback\n");
+		MRVL_LOG(INFO, "Using single-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_pkt_burst;
 	}
 }
-- 
2.43.0


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

* [PATCH v4 06/17] net/vmxnet3: used dedicated logtype not PMD
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (4 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 05/17] net/mvpp2: use dedicated logtype Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 07/17] raw/cnxk: replace PMD logtype with dynamic type Stephen Hemminger
                     ` (10 subsequent siblings)
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The driver has log macros, just not used in one place.

Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index e49191718aea..4fd704045fc4 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)
 	if (events == 0)
 		goto done;
 
-	RTE_LOG(DEBUG, PMD, "Reading events: 0x%X", events);
+	PMD_DRV_LOG(DEBUG, "Reading events: 0x%X", events);
 	vmxnet3_process_events(dev);
 done:
 	vmxnet3_enable_intr(hw, *eventIntrIdx);
-- 
2.43.0


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

* [PATCH v4 07/17] raw/cnxk: replace PMD logtype with dynamic type
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (5 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 06/17] net/vmxnet3: used dedicated logtype not PMD Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-21  9:49     ` David Marchand
  2023-12-18 19:22   ` [PATCH v4 08/17] crypto/scheduler: replace use of logtype PMD Stephen Hemminger
                     ` (9 subsequent siblings)
  16 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Driver should not be using PMD logtype, they should have their
own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/cnxk/roc_platform.h         | 16 ++++++-----
 drivers/raw/cnxk_bphy/cnxk_bphy.c          |  3 ++-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c      |  2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +++++++++++-----------
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h       |  6 +++++
 drivers/raw/cnxk_gpio/cnxk_gpio.c          | 21 ++++++++-------
 drivers/raw/cnxk_gpio/cnxk_gpio.h          |  5 ++++
 drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 17 ++++++------
 8 files changed, 57 insertions(+), 44 deletions(-)

diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index ba23b2e0d79e..9d2ea8f00965 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;
 extern int cnxk_logtype_ree;
 extern int cnxk_logtype_dpi;
 
+#define RTE_LOGTYPE_CNXK cnxk_logtype_base
+
 #define plt_err(fmt, args...)                                                  \
-	RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
-#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args)
-#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
+	RTE_LOG(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+#define plt_info(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)
+#define plt_warn(fmt, args...) RTE_LOG(WARNING, CNXK, fmt "\n", ##args)
+#define plt_print(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)
 #define plt_dump(fmt, ...)      fprintf(stderr, fmt "\n", ##__VA_ARGS__)
 #define plt_dump_no_nl(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
 
@@ -296,11 +298,11 @@ extern int cnxk_logtype_dpi;
 
 /* Datapath logs */
 #define plt_dp_err(fmt, args...)                                               \
-	RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
 #define plt_dp_info(fmt, args...)                                              \
-	RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP(INFO, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
 #define plt_dp_dbg(fmt, args...)                                              \
-	RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP(DEBUG, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
 
 #ifdef __cplusplus
 #define CNXK_PCI_ID(subsystem_dev, dev)                                        \
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
index 15dbc4c1a637..831f0d001adc 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
@@ -251,7 +251,7 @@ cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev,
 
 	/* get rid of last response if any */
 	if (qp->rsp) {
-		RTE_LOG(WARNING, PMD, "Previous response got overwritten\n");
+		CNXK_BPHY_LOG(ERR, "Previous response got overwritten");
 		rte_free(qp->rsp);
 	}
 	qp->rsp = rsp;
@@ -410,3 +410,4 @@ static struct rte_pci_driver cnxk_bphy_rawdev_pmd = {
 RTE_PMD_REGISTER_PCI(bphy_rawdev_pci_driver, cnxk_bphy_rawdev_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(bphy_rawdev_pci_driver, pci_bphy_map);
 RTE_PMD_REGISTER_KMOD_DEP(bphy_rawdev_pci_driver, "vfio-pci");
+RTE_LOG_REGISTER_SUFFIX(cnxk_logtype_bphy, bphy, INFO);
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
index 2d8466ef918b..4358aeecc3e5 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
@@ -189,7 +189,7 @@ cnxk_bphy_cgx_process_buf(struct cnxk_bphy_cgx *cgx, unsigned int queue,
 
 	/* get rid of last response if any */
 	if (qp->rsp) {
-		RTE_LOG(WARNING, PMD, "Previous response got overwritten\n");
+		CNXK_BPHY_LOG(WARNING, "Previous response got overwritten");
 		rte_free(qp->rsp);
 	}
 	qp->rsp = rsp;
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
index a3021b4bb7db..f01d958661ad 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
@@ -57,62 +57,61 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)
 		if (ret)
 			break;
 		if (descs != 1) {
-			RTE_LOG(ERR, PMD, "Wrong number of descs reported\n");
+			CNXK_BPHY_LOG(ERR, "Wrong number of descs reported");
 			ret = -ENODEV;
 			break;
 		}
 
-		RTE_LOG(INFO, PMD, "Testing queue %d\n", i);
+		CNXK_BPHY_LOG(INFO, "Testing queue %d", i);
 
 		ret = rte_pmd_bphy_cgx_stop_rxtx(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to stop rx/tx\n");
+			CNXK_BPHY_LOG(ERR, "Failed to stop rx/tx");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_start_rxtx(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to start rx/tx\n");
+			CNXK_BPHY_LOG(ERR, "Failed to start rx/tx");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_set_link_state(dev_id, i, false);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set link down\n");
+			CNXK_BPHY_LOG(ERR, "Failed to set link down");
 			break;
 		}
 
 		ret = cnxk_bphy_cgx_link_cond(dev_id, i, 0);
 		if (ret != 0)
-			RTE_LOG(ERR, PMD,
-				"Timed out waiting for a link down\n");
+			CNXK_BPHY_LOG(ERR, "Timed out waiting for a link down");
 
 		ret = rte_pmd_bphy_cgx_set_link_state(dev_id, i, true);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set link up\n");
+			CNXK_BPHY_LOG(ERR, "Failed to set link up");
 			break;
 		}
 
 		ret = cnxk_bphy_cgx_link_cond(dev_id, i, 1);
 		if (ret != 1)
-			RTE_LOG(ERR, PMD, "Timed out waiting for a link up\n");
+			CNXK_BPHY_LOG(ERR, "Timed out waiting for a link up");
 
 		ret = rte_pmd_bphy_cgx_intlbk_enable(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to enable internal lbk\n");
+			CNXK_BPHY_LOG(ERR, "Failed to enable internal lbk");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_intlbk_disable(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to disable internal lbk\n");
+			CNXK_BPHY_LOG(ERR, "Failed to disable internal lbk");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_ptp_rx_enable(dev_id, i);
 		/* ptp not available on RPM */
 		if (ret < 0 && ret != -ENOTSUP) {
-			RTE_LOG(ERR, PMD, "Failed to enable ptp\n");
+			CNXK_BPHY_LOG(ERR, "Failed to enable ptp");
 			break;
 		}
 		ret = 0;
@@ -120,27 +119,27 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)
 		ret = rte_pmd_bphy_cgx_ptp_rx_disable(dev_id, i);
 		/* ptp not available on RPM */
 		if (ret < 0 && ret != -ENOTSUP) {
-			RTE_LOG(ERR, PMD, "Failed to disable ptp\n");
+			CNXK_BPHY_LOG(ERR, "Failed to disable ptp");
 			break;
 		}
 		ret = 0;
 
 		ret = rte_pmd_bphy_cgx_get_supported_fec(dev_id, i, &fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to get supported FEC\n");
+			CNXK_BPHY_LOG(ERR, "Failed to get supported FEC");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_set_fec(dev_id, i, fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set FEC to %d\n", fec);
+			CNXK_BPHY_LOG(ERR, "Failed to set FEC to %d", fec);
 			break;
 		}
 
 		fec = CNXK_BPHY_CGX_ETH_LINK_FEC_NONE;
 		ret = rte_pmd_bphy_cgx_set_fec(dev_id, i, fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to disable FEC\n");
+			CNXK_BPHY_LOG(ERR, "Failed to disable FEC");
 			break;
 		}
 	}
diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
index 9d8d0285581b..7a7d9f6fa66f 100644
--- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
+++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
@@ -26,6 +26,12 @@
 extern "C" {
 #endif
 
+extern int cnxk_logtype_bphy;
+
+#define CNXK_BPHY_LOG(level, fmt, args...)	\
+	rte_log(RTE_LOG_ ## level, cnxk_logtype_bphy, \
+		"%s(): " fmt "\n", __func__, ## args)
+
 /** Available message types */
 enum cnxk_bphy_cgx_msg_type {
 	/** Type used to obtain link information */
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.c b/drivers/raw/cnxk_gpio/cnxk_gpio.c
index 3c4d79e4810e..329ac28a2736 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.c
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.c
@@ -215,13 +215,13 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)
 		errno = 0;
 		val = strtol(token, NULL, 10);
 		if (errno) {
-			RTE_LOG(ERR, PMD, "failed to parse %s\n", token);
+			CNXK_GPIO_LOG(ERR, "failed to parse %s", token);
 			ret = -errno;
 			goto out;
 		}
 
 		if (val < 0 || val >= gpiochip->num_gpios) {
-			RTE_LOG(ERR, PMD, "gpio%d out of 0-%d range\n", val,
+			CNXK_GPIO_LOG(ERR, "gpio%d out of 0-%d range", val,
 				gpiochip->num_gpios - 1);
 			ret = -EINVAL;
 			goto out;
@@ -231,7 +231,7 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)
 			if (list[i] != val)
 				continue;
 
-			RTE_LOG(WARNING, PMD, "gpio%d already allowed\n", val);
+			CNXK_GPIO_LOG(WARNING, "gpio%d already allowed", val);
 			break;
 		}
 		if (i == queue)
@@ -398,7 +398,7 @@ cnxk_gpio_queue_setup(struct rte_rawdev *dev, uint16_t queue_id,
 			return ret;
 		}
 	} else {
-		RTE_LOG(WARNING, PMD, "using existing gpio%d\n", gpio->num);
+		CNXK_GPIO_LOG(WARNING, "using existing gpio%d", gpio->num);
 	}
 
 	gpiochip->gpios[num] = gpio;
@@ -647,7 +647,7 @@ cnxk_gpio_process_buf(struct cnxk_gpio *gpio, struct rte_rawdev_buf *rbuf)
 
 	/* get rid of last response if any */
 	if (gpio->rsp) {
-		RTE_LOG(WARNING, PMD, "previous response got overwritten\n");
+		CNXK_GPIO_LOG(WARNING, "previous response got overwritten");
 		rte_free(gpio->rsp);
 	}
 	gpio->rsp = rsp;
@@ -741,7 +741,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	cnxk_gpio_format_name(name, sizeof(name));
 	rawdev = rte_rawdev_pmd_allocate(name, sizeof(*gpiochip), rte_socket_id());
 	if (!rawdev) {
-		RTE_LOG(ERR, PMD, "failed to allocate %s rawdev\n", name);
+		CNXK_GPIO_LOG(ERR, "failed to allocate %s rawdev", name);
 		return -ENOMEM;
 	}
 
@@ -770,7 +770,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	snprintf(buf, sizeof(buf), "%s/gpiochip%d/base", CNXK_GPIO_CLASS_PATH, gpiochip->num);
 	ret = cnxk_gpio_read_attr_int(buf, &gpiochip->base);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to read %s\n", buf);
+		CNXK_GPIO_LOG(ERR, "failed to read %s", buf);
 		goto out;
 	}
 
@@ -778,20 +778,20 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	snprintf(buf, sizeof(buf), "%s/gpiochip%d/ngpio", CNXK_GPIO_CLASS_PATH, gpiochip->num);
 	ret = cnxk_gpio_read_attr_int(buf, &gpiochip->num_gpios);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to read %s\n", buf);
+		CNXK_GPIO_LOG(ERR, "failed to read %s", buf);
 		goto out;
 	}
 	gpiochip->num_queues = gpiochip->num_gpios;
 
 	ret = cnxk_gpio_parse_allowlist(gpiochip, params->allowlist);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to parse allowed gpios\n");
+		CNXK_GPIO_LOG(ERR, "failed to parse allowed gpios");
 		goto out;
 	}
 
 	gpiochip->gpios = rte_calloc(NULL, gpiochip->num_gpios, sizeof(struct cnxk_gpio *), 0);
 	if (!gpiochip->gpios) {
-		RTE_LOG(ERR, PMD, "failed to allocate gpios memory\n");
+		CNXK_GPIO_LOG(ERR, "failed to allocate gpios memory");
 		ret = -ENOMEM;
 		goto out;
 	}
@@ -851,3 +851,4 @@ RTE_PMD_REGISTER_VDEV(cnxk_gpio, cnxk_gpio_drv);
 RTE_PMD_REGISTER_PARAM_STRING(cnxk_gpio,
 		"gpiochip=<int> "
 		"allowlist=<list>");
+RTE_LOG_REGISTER_SUFFIX(cnxk_logtype_gpio, gpio, INFO);
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.h b/drivers/raw/cnxk_gpio/cnxk_gpio.h
index e62f78a7604a..336d7ac373d7 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.h
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.h
@@ -5,6 +5,11 @@
 #ifndef _CNXK_GPIO_H_
 #define _CNXK_GPIO_H_
 
+extern int cnxk_logtype_gpio;
+
+#define CNXK_GPIO_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, cnxk_logtype_gpio, fmt "\n", ## args)
+
 struct cnxk_gpiochip;
 
 struct cnxk_gpio {
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c b/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
index 10742b5dc48a..2f3973a7b5e6 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
@@ -56,7 +56,7 @@ cnxk_gpio_read_attr(char *attr, char *val)
 
 #define CNXK_GPIO_ERR_STR(err, str, ...) do {                                  \
 	if (err) {                                                             \
-		RTE_LOG(ERR, PMD, "%s:%d: " str " (%d)\n", __func__, __LINE__, \
+		CNXK_GPIO_LOG(ERR, "%s:%d: " str " (%d)", __func__, __LINE__, \
 			##__VA_ARGS__, err);                                   \
 		goto out;                                                      \
 	}                                                                      \
@@ -330,30 +330,29 @@ cnxk_gpio_selftest(uint16_t dev_id)
 	for (i = 0; i < queues; i++) {
 		ret = rte_rawdev_queue_conf_get(dev_id, i, &conf, sizeof(conf));
 		if (ret) {
-			RTE_LOG(ERR, PMD,
-				"failed to read queue configuration (%d)\n",
+			CNXK_GPIO_LOG(ERR, "failed to read queue configuration (%d)",
 				ret);
 			goto out;
 		}
 
-		RTE_LOG(INFO, PMD, "testing queue%d (gpio%d)\n", i, conf.gpio);
+		CNXK_GPIO_LOG(INFO, "testing queue%d (gpio%d)", i, conf.gpio);
 
 		if (conf.size != 1) {
-			RTE_LOG(ERR, PMD, "wrong queue size received\n");
+			CNXK_GPIO_LOG(ERR, "wrong queue size received");
 			ret = -EIO;
 			goto out;
 		}
 
 		ret = rte_rawdev_queue_setup(dev_id, i, NULL, 0);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "failed to setup queue (%d)\n", ret);
+			CNXK_GPIO_LOG(ERR, "failed to setup queue (%d)", ret);
 			goto out;
 		}
 
 		gpio = gpiochip->gpios[conf.gpio];
 		snprintf(buf, sizeof(buf), CNXK_GPIO_PATH_FMT, gpio->num);
 		if (!cnxk_gpio_attr_exists(buf)) {
-			RTE_LOG(ERR, PMD, "%s does not exist\n", buf);
+			CNXK_GPIO_LOG(ERR, "%s does not exist", buf);
 			ret = -ENOENT;
 			goto release;
 		}
@@ -371,13 +370,13 @@ cnxk_gpio_selftest(uint16_t dev_id)
 		ret2 = ret;
 		ret = rte_rawdev_queue_release(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "failed to release queue (%d)\n",
+			CNXK_GPIO_LOG(ERR, "failed to release queue (%d)",
 				ret);
 			break;
 		}
 
 		if (cnxk_gpio_attr_exists(buf)) {
-			RTE_LOG(ERR, PMD, "%s still exists\n", buf);
+			CNXK_GPIO_LOG(ERR, "%s still exists", buf);
 			ret = -EIO;
 			break;
 		}
-- 
2.43.0


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

* [PATCH v4 08/17] crypto/scheduler: replace use of logtype PMD
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (6 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 07/17] raw/cnxk: replace PMD logtype with dynamic type Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-21  9:40     ` David Marchand
  2023-12-18 19:22   ` [PATCH v4 09/17] crypto/ccp: do not use PMD logtype Stephen Hemminger
                     ` (8 subsequent siblings)
  16 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Driver has logging macro but not used everywhere.

Fixes: 6760463c9f26 ("crypto/scheduler: add mode-specific threshold parameter")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/scheduler/scheduler_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
index 589d092d7457..aaf2dcdb57ec 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -197,8 +197,8 @@ cryptodev_scheduler_create(const char *name,
 				return -EINVAL;
 			}
 
-			RTE_LOG(INFO, PMD, "  Sched mode param (%s = %s)\n",
-					param_name, param_val);
+			CR_SCHED_LOG(INFO, "  Sched mode param (%s = %s)\n",
+				     param_name, param_val);
 		}
 	}
 
-- 
2.43.0


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

* [PATCH v4 09/17] crypto/ccp: do not use PMD logtype
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (7 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 08/17] crypto/scheduler: replace use of logtype PMD Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 10/17] crypto/caam_jr: use dedicated logtype Stephen Hemminger
                     ` (7 subsequent siblings)
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This driver has logging macros but not used consistently.

Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/ccp/rte_ccp_pmd.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index a5271d72273d..46a9275e3743 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -194,8 +194,7 @@ cryptodev_ccp_remove(struct rte_pci_device *pci_dev)
 
 	ccp_pmd_init_done = 0;
 
-	RTE_LOG(INFO, PMD, "Closing ccp device %s on numa socket %u\n",
-			name, rte_socket_id());
+	CCP_LOG_INFO("Closing ccp device %s on numa socket %u", name, rte_socket_id());
 
 	return rte_cryptodev_pmd_destroy(dev);
 }
@@ -228,7 +227,7 @@ cryptodev_ccp_create(const char *name,
 	}
 	cryptodev_cnt++;
 
-	CCP_LOG_DBG("CCP : Crypto device count = %d\n", cryptodev_cnt);
+	CCP_LOG_DBG("CCP : Crypto device count = %d", cryptodev_cnt);
 	dev->device = &pci_dev->device;
 	dev->device->driver = &pci_drv->driver;
 	dev->driver_id = ccp_cryptodev_driver_id;
@@ -279,7 +278,7 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	};
 
 	if (ccp_pmd_init_done) {
-		RTE_LOG(INFO, PMD, "CCP PMD already initialized\n");
+		CCP_LOG_INFO("CCP PMD already initialized");
 		return -EFAULT;
 	}
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
@@ -288,11 +287,11 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	init_params.def_p.max_nb_queue_pairs = CCP_PMD_MAX_QUEUE_PAIRS;
 
-	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
+	CCP_LOG_INFO("Initialising %s on NUMA node %d", name,
 		init_params.def_p.socket_id);
-	RTE_LOG(INFO, PMD, "Max number of queue pairs = %d\n",
+	CCP_LOG_INFO("Max number of queue pairs = %d",
 		init_params.def_p.max_nb_queue_pairs);
-	RTE_LOG(INFO, PMD, "Authentication offload to %s\n",
+	CCP_LOG_INFO("Authentication offload to %s",
 		((init_params.auth_opt == 0) ? "CCP" : "CPU"));
 
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
-- 
2.43.0


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

* [PATCH v4 10/17] crypto/caam_jr: use dedicated logtype
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (8 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 09/17] crypto/ccp: do not use PMD logtype Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-21  9:38     ` David Marchand
  2023-12-18 19:22   ` [PATCH v4 11/17] crypto/dpaa_sec, crypto/dpaa2_sec: " Stephen Hemminger
                     ` (6 subsequent siblings)
  16 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The driver has macro and logtype but not used in a couple places.

Fixes: af7c9b5e9ce7 ("crypto/caam_jr: introduce basic driver")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/caam_jr/caam_jr.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index b55258689b49..7b42ca529e9f 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -309,7 +309,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses)
 
 	cdb = caam_jr_dma_mem_alloc(L1_CACHE_BYTES, sizeof(struct sec_cdb));
 	if (!cdb) {
-		CAAM_JR_ERR("failed to allocate memory for cdb\n");
+		CAAM_JR_ERR("failed to allocate memory for cdb");
 		return -1;
 	}
 
@@ -2346,7 +2346,7 @@ caam_jr_dev_init(const char *name,
 
 	rte_cryptodev_pmd_probing_finish(dev);
 
-	RTE_LOG(INFO, PMD, "%s cryptodev init\n", dev->data->name);
+	CAAM_JR_INFO("%s cryptodev init\n", dev->data->name);
 
 	return 0;
 
@@ -2386,8 +2386,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev)
 
 	ret = of_init();
 	if (ret) {
-		RTE_LOG(ERR, PMD,
-		"of_init failed\n");
+		CAAM_JR_ERR("of_init failed\n");
 		return -EINVAL;
 	}
 	/* if sec device version is not configured */
@@ -2407,8 +2406,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev)
 	}
 #ifdef RTE_LIBRTE_PMD_CAAM_JR_BE
 	if (rta_get_sec_era() > RTA_SEC_ERA_8) {
-		RTE_LOG(ERR, PMD,
-		"CAAM is compiled in BE mode for device with sec era > 8???\n");
+		CAAM_JR_ERR("CAAM is compiled in BE mode for device with sec era > 8???\n");
 		return -EINVAL;
 	}
 #endif
-- 
2.43.0


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

* [PATCH v4 11/17] crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (9 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 10/17] crypto/caam_jr: use dedicated logtype Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-21  9:39     ` David Marchand
  2023-12-18 19:22   ` [PATCH v4 12/17] event/dlb2: " Stephen Hemminger
                     ` (5 subsequent siblings)
  16 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

A couple of messages were using RTE_LOGTYPE_PMD when dedicated
logtype was already available.

Fixes: fe3688ba7950 ("crypto/dpaa_sec: support event crypto adapter")
Fixes: bffc7d561c81 ("crypto/dpaa2_sec: support event crypto adapter")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 +++---
 drivers/crypto/dpaa_sec/dpaa_sec.c          | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index bb5a2c629e53..1cae6c45059e 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -4153,7 +4153,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 		ret = dpseci_set_opr(dpseci, CMD_PRI_LOW, priv->token,
 				   qp_id, OPR_OPT_CREATE, &ocfg);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Error setting opr: ret: %d\n", ret);
+			DPAA2_SEC_ERR("Error setting opr: ret: %d", ret);
 			return ret;
 		}
 		qp->tx_vq.cb_eqresp_free = dpaa2_sec_free_eqresp_buf;
@@ -4163,7 +4163,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 	ret = dpseci_set_rx_queue(dpseci, CMD_PRI_LOW, priv->token,
 				  qp_id, &cfg);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "Error in dpseci_set_queue: ret: %d\n", ret);
+		DPAA2_SEC_ERR("Error in dpseci_set_queue: ret: %d", ret);
 		return ret;
 	}
 
@@ -4188,7 +4188,7 @@ dpaa2_sec_eventq_detach(const struct rte_cryptodev *dev,
 	ret = dpseci_set_rx_queue(dpseci, CMD_PRI_LOW, priv->token,
 				  qp_id, &cfg);
 	if (ret)
-		RTE_LOG(ERR, PMD, "Error in dpseci_set_queue: ret: %d\n", ret);
+		DPAA2_SEC_ERR("Error in dpseci_set_queue: ret: %d", ret);
 
 	return ret;
 }
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index a301e8edb2a4..3008ca4dc2f7 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -3518,7 +3518,7 @@ dpaa_sec_eventq_detach(const struct rte_cryptodev *dev,
 	qman_oos_fq(&qp->outq);
 	ret = qman_init_fq(&qp->outq, 0, &opts);
 	if (ret)
-		RTE_LOG(ERR, PMD, "Error in qman_init_fq: ret: %d\n", ret);
+		DPAA_SEC_ERR("Error in qman_init_fq: ret: %d\n", ret);
 	qp->outq.cb.dqrr = NULL;
 
 	return ret;
@@ -3709,7 +3709,7 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)
 
 	dpaa_sec_get_devargs(cryptodev->device->devargs, DRIVER_DUMP_MODE);
 
-	RTE_LOG(INFO, PMD, "%s cryptodev init\n", cryptodev->data->name);
+	DPAA_SEC_INFO("%s cryptodev init\n", cryptodev->data->name);
 	return 0;
 
 init_error:
-- 
2.43.0


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

* [PATCH v4 12/17] event/dlb2: use dedicated logtype
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (10 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 11/17] crypto/dpaa_sec, crypto/dpaa2_sec: " Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-21  9:41     ` David Marchand
  2023-12-18 19:22   ` [PATCH v4 13/17] event/dpaa, event/dpaa2: " Stephen Hemminger
                     ` (4 subsequent siblings)
  16 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Driver was using RTE_LOGTYPE_PMD when it had its own logtype.
Fixes: 5433956d5185 ("event/dlb2: add eventdev probe")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/dlb2/dlb2.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 050ace0904b4..5a16123f0af9 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -4741,9 +4741,8 @@ dlb2_parse_params(const char *params,
 		struct rte_kvargs *kvlist = rte_kvargs_parse(params, args);
 
 		if (kvlist == NULL) {
-			RTE_LOG(INFO, PMD,
-				"Ignoring unsupported parameters when creating device '%s'\n",
-				name);
+			DLB2_LOG_INFO("Ignoring unsupported parameters when creating device '%s'\n",
+				      name);
 		} else {
 			int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG,
 						     set_numa_node,
-- 
2.43.0


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

* [PATCH v4 13/17] event/dpaa, event/dpaa2: use dedicated logtype
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (11 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 12/17] event/dlb2: " Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 14/17] event/skeleton: replace logtype PMD with dynamic type Stephen Hemminger
                     ` (3 subsequent siblings)
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Do not use RTE_LOGTYPE_PMD.

Fixes: b0f66a68ca74 ("event/dpaa: support crypto adapter")
Fixes: 4ab57b042e7c ("event/dpaa2: affine portal at runtime during I/O")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/dpaa/dpaa_eventdev.c            | 2 +-
 drivers/event/dpaa2/dpaa2_eventdev.c          | 4 ++--
 drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
index 46a9b88c73ae..a8e5c3421df1 100644
--- a/drivers/event/dpaa/dpaa_eventdev.c
+++ b/drivers/event/dpaa/dpaa_eventdev.c
@@ -1025,7 +1025,7 @@ dpaa_event_dev_create(const char *name, const char *params, struct rte_vdev_devi
 	eventdev->txa_enqueue = dpaa_eventdev_txa_enqueue;
 	eventdev->txa_enqueue_same_dest	= dpaa_eventdev_txa_enqueue_same_dest;
 
-	RTE_LOG(INFO, PMD, "%s eventdev added", name);
+	DPAA_EVENTDEV_INFO("%s eventdev added", name);
 
 	/* For secondary processes, the primary has done all the work */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index dd4e64395fe5..85c2dbd998dd 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -1141,7 +1141,7 @@ dpaa2_eventdev_create(const char *name, struct rte_vdev_device *vdev)
 		priv->max_event_queues++;
 	} while (dpcon_dev && dpci_dev);
 
-	RTE_LOG(INFO, PMD, "%s eventdev created\n", name);
+	DPAA2_EVENTDEV_INFO("%s eventdev created", name);
 
 done:
 	event_dev_probing_finish(eventdev);
@@ -1178,7 +1178,7 @@ dpaa2_eventdev_destroy(const char *name)
 	}
 	priv->max_event_queues = 0;
 
-	RTE_LOG(INFO, PMD, "%s eventdev cleaned\n", name);
+	DPAA2_EVENTDEV_INFO("%s eventdev cleaned", name);
 	return 0;
 }
 
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
index 427aff4b1111..9d4938efe6aa 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
@@ -774,15 +774,15 @@ static void dpaa2_test_run(int (*setup)(void), void (*tdown)(void),
 		int (*test)(void), const char *name)
 {
 	if (setup() < 0) {
-		RTE_LOG(INFO, PMD, "Error setting up test %s", name);
+		DPAA2_EVENTDEV_INFO("Error setting up test %s", name);
 		unsupported++;
 	} else {
 		if (test() < 0) {
 			failed++;
-			RTE_LOG(INFO, PMD, "%s Failed\n", name);
+			DPAA2_EVENTDEV_INFO("%s Failed", name);
 		} else {
 			passed++;
-			RTE_LOG(INFO, PMD, "%s Passed", name);
+			DPAA2_EVENTDEV_INFO("%s Passed", name);
 		}
 	}
 
-- 
2.43.0


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

* [PATCH v4 14/17] event/skeleton: replace logtype PMD with dynamic type
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (12 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 13/17] event/dpaa, event/dpaa2: " Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-21  9:43     ` David Marchand
  2023-12-18 19:22   ` [PATCH v4 15/17] net/nfb: use dynamic logtype Stephen Hemminger
                     ` (2 subsequent siblings)
  16 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The skeleton is supposed to match current best practices.
Change it to use dynamic logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/skeleton/skeleton_eventdev.c | 3 ++-
 drivers/event/skeleton/skeleton_eventdev.h | 8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c
index 7df032b7daa1..df50d2e4e4ff 100644
--- a/drivers/event/skeleton/skeleton_eventdev.c
+++ b/drivers/event/skeleton/skeleton_eventdev.c
@@ -457,7 +457,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)
 	const char *name;
 
 	name = rte_vdev_device_name(vdev);
-	RTE_LOG(INFO, PMD, "Initializing %s on NUMA node %d\n", name,
+	PMD_DRV_LOG(INFO, "Initializing %s on NUMA node %d\n", name,
 			rte_socket_id());
 	return skeleton_eventdev_create(name, rte_socket_id(), vdev);
 }
@@ -479,3 +479,4 @@ static struct rte_vdev_driver vdev_eventdev_skeleton_pmd = {
 };
 
 RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_SKELETON_PMD, vdev_eventdev_skeleton_pmd);
+RTE_LOG_REGISTER_DEFAULT(skeleton_eventdev_logtype, INFO);
diff --git a/drivers/event/skeleton/skeleton_eventdev.h b/drivers/event/skeleton/skeleton_eventdev.h
index 9193f45f4782..9c1ed4ec5755 100644
--- a/drivers/event/skeleton/skeleton_eventdev.h
+++ b/drivers/event/skeleton/skeleton_eventdev.h
@@ -8,9 +8,12 @@
 #include <eventdev_pmd_pci.h>
 #include <eventdev_pmd_vdev.h>
 
+extern int skeleton_eventdev_logtype;
+
 #ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG
 #define PMD_DRV_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, skeleton_eventdev_logtype, \
+		"%s(): " fmt "\n", __func__, ## args)
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
 #else
 #define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
@@ -18,7 +21,8 @@
 #endif
 
 #define PMD_DRV_ERR(fmt, args...) \
-	RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ERR, skeleton_eventdev_logtype, \
+		"%s(): " fmt "\n", __func__, ## args)
 
 struct skeleton_eventdev {
 	uintptr_t reg_base;
-- 
2.43.0


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

* [PATCH v4 15/17] net/nfb: use dynamic logtype
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (13 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 14/17] event/skeleton: replace logtype PMD with dynamic type Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 16/17] examples/fips_validation: replace use of PMD logtype Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 17/17] log: mark PMD logtype as deprecated Stephen Hemminger
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

All drivers should be using dynamic logtype.

Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/nfb/nfb.h        |  5 +++++
 drivers/net/nfb/nfb_ethdev.c | 24 ++++++++++--------------
 drivers/net/nfb/nfb_rx.c     |  9 ++++-----
 drivers/net/nfb/nfb_rx.h     |  2 +-
 drivers/net/nfb/nfb_tx.c     |  9 ++++-----
 drivers/net/nfb/nfb_tx.h     |  2 +-
 6 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/net/nfb/nfb.h b/drivers/net/nfb/nfb.h
index 7dc5bd29e44c..45226ee3d938 100644
--- a/drivers/net/nfb/nfb.h
+++ b/drivers/net/nfb/nfb.h
@@ -12,6 +12,11 @@
 #include <netcope/rxmac.h>
 #include <netcope/txmac.h>
 
+extern int nfb_logtype;
+#define NFB_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, nfb_logtype, "%s(): " fmt "\n", \
+		__func__, ## args)
+
 #include "nfb_rx.h"
 #include "nfb_tx.h"
 
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index defd118bd0ee..e533144efe5d 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -12,11 +12,9 @@
 #include <ethdev_pci.h>
 #include <rte_kvargs.h>
 
+#include "nfb.h"
 #include "nfb_stats.h"
-#include "nfb_rx.h"
-#include "nfb_tx.h"
 #include "nfb_rxmode.h"
-#include "nfb.h"
 
 /**
  * Default MAC addr
@@ -192,8 +190,7 @@ nfb_eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
 				(&nfb_timestamp_dynfield_offset,
 				&nfb_timestamp_rx_dynflag);
 		if (ret != 0) {
-			RTE_LOG(ERR, PMD, "Cannot register Rx timestamp"
-					" field/flag %d\n", ret);
+			NFB_LOG(ERR, "Cannot register Rx timestamp field/flag %d", ret);
 			nfb_close(internals->nfb);
 			return -rte_errno;
 		}
@@ -520,7 +517,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 	struct rte_ether_addr eth_addr_init;
 	struct rte_kvargs *kvlist;
 
-	RTE_LOG(INFO, PMD, "Initializing NFB device (" PCI_PRI_FMT ")\n",
+	NFB_LOG(INFO, "Initializing NFB device (" PCI_PRI_FMT ")",
 		pci_addr->domain, pci_addr->bus, pci_addr->devid,
 		pci_addr->function);
 
@@ -536,7 +533,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 		kvlist = rte_kvargs_parse(dev->device->devargs->args,
 						VALID_KEYS);
 		if (kvlist == NULL) {
-			RTE_LOG(ERR, PMD, "Failed to parse device arguments %s",
+			NFB_LOG(ERR, "Failed to parse device arguments %s",
 				dev->device->devargs->args);
 			rte_kvargs_free(kvlist);
 			return -EINVAL;
@@ -551,14 +548,14 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 	 */
 	internals->nfb = nfb_open(internals->nfb_dev);
 	if (internals->nfb == NULL) {
-		RTE_LOG(ERR, PMD, "nfb_open(): failed to open %s",
+		NFB_LOG(ERR, "nfb_open(): failed to open %s",
 			internals->nfb_dev);
 		return -EINVAL;
 	}
 	data->nb_rx_queues = ndp_get_rx_queue_available_count(internals->nfb);
 	data->nb_tx_queues = ndp_get_tx_queue_available_count(internals->nfb);
 
-	RTE_LOG(INFO, PMD, "Available NDP queues RX: %u TX: %u\n",
+	NFB_LOG(INFO, "Available NDP queues RX: %u TX: %u\n",
 		data->nb_rx_queues, data->nb_tx_queues);
 
 	nfb_nc_rxmac_init(internals->nfb,
@@ -583,7 +580,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 	data->mac_addrs = rte_zmalloc(data->name,
 		sizeof(struct rte_ether_addr) * mac_count, RTE_CACHE_LINE_SIZE);
 	if (data->mac_addrs == NULL) {
-		RTE_LOG(ERR, PMD, "Could not alloc space for MAC address!\n");
+		NFB_LOG(ERR, "Could not alloc space for MAC address");
 		nfb_close(internals->nfb);
 		return -EINVAL;
 	}
@@ -601,8 +598,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 
 	dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 
-	RTE_LOG(INFO, PMD, "NFB device ("
-		PCI_PRI_FMT ") successfully initialized\n",
+	NFB_LOG(INFO, "NFB device (" PCI_PRI_FMT ") successfully initialized",
 		pci_addr->domain, pci_addr->bus, pci_addr->devid,
 		pci_addr->function);
 
@@ -626,8 +622,7 @@ nfb_eth_dev_uninit(struct rte_eth_dev *dev)
 
 	nfb_eth_dev_close(dev);
 
-	RTE_LOG(INFO, PMD, "NFB device ("
-		PCI_PRI_FMT ") successfully uninitialized\n",
+	NFB_LOG(INFO, "NFB device (" PCI_PRI_FMT ") successfully uninitialized",
 		pci_addr->domain, pci_addr->bus, pci_addr->devid,
 		pci_addr->function);
 
@@ -690,3 +685,4 @@ static struct rte_pci_driver nfb_eth_driver = {
 RTE_PMD_REGISTER_PCI(RTE_NFB_DRIVER_NAME, nfb_eth_driver);
 RTE_PMD_REGISTER_PCI_TABLE(RTE_NFB_DRIVER_NAME, nfb_pci_id_table);
 RTE_PMD_REGISTER_KMOD_DEP(RTE_NFB_DRIVER_NAME, "* nfb");
+RTE_LOG_REGISTER_DEFAULT(nfb_logtype, NOTICE);
diff --git a/drivers/net/nfb/nfb_rx.c b/drivers/net/nfb/nfb_rx.c
index 8a9b232305f2..a20f7b9b4b41 100644
--- a/drivers/net/nfb/nfb_rx.c
+++ b/drivers/net/nfb/nfb_rx.c
@@ -6,7 +6,6 @@
 
 #include <rte_kvargs.h>
 
-#include "nfb_rx.h"
 #include "nfb.h"
 
 uint64_t nfb_timestamp_rx_dynflag;
@@ -19,7 +18,7 @@ nfb_eth_rx_queue_start(struct rte_eth_dev *dev, uint16_t rxq_id)
 	int ret;
 
 	if (rxq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "RX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -40,7 +39,7 @@ nfb_eth_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rxq_id)
 	int ret;
 
 	if (rxq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "RX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -70,8 +69,8 @@ nfb_eth_rx_queue_setup(struct rte_eth_dev *dev,
 			RTE_CACHE_LINE_SIZE, socket_id);
 
 	if (rxq == NULL) {
-		RTE_LOG(ERR, PMD, "rte_zmalloc_socket() failed for rx queue id "
-				"%" PRIu16 "!\n", rx_queue_id);
+		NFB_LOG(ERR, "rte_zmalloc_socket() failed for rx queue id %" PRIu16,
+			rx_queue_id);
 		return -ENOMEM;
 	}
 
diff --git a/drivers/net/nfb/nfb_rx.h b/drivers/net/nfb/nfb_rx.h
index b618682e1393..2802f17091a0 100644
--- a/drivers/net/nfb/nfb_rx.h
+++ b/drivers/net/nfb/nfb_rx.h
@@ -156,7 +156,7 @@ nfb_eth_ndp_rx(void *queue,
 	struct rte_mbuf *mbufs[nb_pkts];
 
 	if (unlikely(ndp->queue == NULL || nb_pkts == 0)) {
-		RTE_LOG(ERR, PMD, "RX invalid arguments!\n");
+		NFB_LOG(ERR, "RX invalid arguments");
 		return 0;
 	}
 
diff --git a/drivers/net/nfb/nfb_tx.c b/drivers/net/nfb/nfb_tx.c
index d49fc324e76b..0cc2f596301a 100644
--- a/drivers/net/nfb/nfb_tx.c
+++ b/drivers/net/nfb/nfb_tx.c
@@ -4,7 +4,6 @@
  * All rights reserved.
  */
 
-#include "nfb_tx.h"
 #include "nfb.h"
 
 int
@@ -14,7 +13,7 @@ nfb_eth_tx_queue_start(struct rte_eth_dev *dev, uint16_t txq_id)
 	int ret;
 
 	if (txq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "RX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -35,7 +34,7 @@ nfb_eth_tx_queue_stop(struct rte_eth_dev *dev, uint16_t txq_id)
 	int ret;
 
 	if (txq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "TX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "TX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -62,8 +61,8 @@ nfb_eth_tx_queue_setup(struct rte_eth_dev *dev,
 		RTE_CACHE_LINE_SIZE, socket_id);
 
 	if (txq == NULL) {
-		RTE_LOG(ERR, PMD, "rte_zmalloc_socket() failed for tx queue id "
-			"%" PRIu16 "!\n", tx_queue_id);
+		NFB_LOG(ERR, "rte_zmalloc_socket() failed for tx queue id %" PRIu16,
+			tx_queue_id);
 		return -ENOMEM;
 	}
 
diff --git a/drivers/net/nfb/nfb_tx.h b/drivers/net/nfb/nfb_tx.h
index 910020e9e96f..f107cf914bbd 100644
--- a/drivers/net/nfb/nfb_tx.h
+++ b/drivers/net/nfb/nfb_tx.h
@@ -140,7 +140,7 @@ nfb_eth_ndp_tx(void *queue,
 		return 0;
 
 	if (unlikely(ndp->queue == NULL)) {
-		RTE_LOG(ERR, PMD, "TX invalid arguments!\n");
+		NFB_LOG(ERR, "TX invalid arguments");
 		return 0;
 	}
 
-- 
2.43.0


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

* [PATCH v4 16/17] examples/fips_validation: replace use of PMD logtype
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (14 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 15/17] net/nfb: use dynamic logtype Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  2023-12-18 19:22   ` [PATCH v4 17/17] log: mark PMD logtype as deprecated Stephen Hemminger
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Replace PMD with USER1 since that is already used in main

Fixes: 41d561cbdd24 ("examples/fips_validation: add power on self test")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/fips_validation/fips_dev_self_test.c | 44 +++++++++----------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/examples/fips_validation/fips_dev_self_test.c b/examples/fips_validation/fips_dev_self_test.c
index b17f664a5eda..667f5da4e7d9 100644
--- a/examples/fips_validation/fips_dev_self_test.c
+++ b/examples/fips_validation/fips_dev_self_test.c
@@ -1032,7 +1032,7 @@ prepare_cipher_xform(uint8_t dev_id,
 
 	cap = rte_cryptodev_sym_capability_get(dev_id, &cap_idx);
 	if (!cap) {
-		RTE_LOG(ERR, PMD, "Failed to get capability for cdev %u\n",
+		RTE_LOG(ERR, USER1, "Failed to get capability for cdev %u\n",
 				dev_id);
 		return -EACCES;
 	}
@@ -1040,7 +1040,7 @@ prepare_cipher_xform(uint8_t dev_id,
 	if (rte_cryptodev_sym_capability_check_cipher(cap,
 			cipher_xform->key.length,
 			cipher_xform->iv.length) != 0) {
-		RTE_LOG(ERR, PMD, "PMD %s key length %u IV length %u\n",
+		RTE_LOG(ERR, USER1, "PMD %s key length %u IV length %u\n",
 				rte_cryptodev_name_get(dev_id),
 				cipher_xform->key.length,
 				cipher_xform->iv.length);
@@ -1088,7 +1088,7 @@ prepare_auth_xform(uint8_t dev_id,
 
 	cap = rte_cryptodev_sym_capability_get(dev_id, &cap_idx);
 	if (!cap) {
-		RTE_LOG(ERR, PMD, "Failed to get capability for cdev %u\n",
+		RTE_LOG(ERR, USER1, "Failed to get capability for cdev %u\n",
 				dev_id);
 		return -EACCES;
 	}
@@ -1096,7 +1096,7 @@ prepare_auth_xform(uint8_t dev_id,
 	if (rte_cryptodev_sym_capability_check_auth(cap,
 			auth_xform->key.length,
 			auth_xform->digest_length, 0) != 0) {
-		RTE_LOG(ERR, PMD, "PMD %s key length %u Digest length %u\n",
+		RTE_LOG(ERR, USER1, "PMD %s key length %u Digest length %u\n",
 				rte_cryptodev_name_get(dev_id),
 				auth_xform->key.length,
 				auth_xform->digest_length);
@@ -1147,7 +1147,7 @@ prepare_aead_xform(uint8_t dev_id,
 
 	cap = rte_cryptodev_sym_capability_get(dev_id, &cap_idx);
 	if (!cap) {
-		RTE_LOG(ERR, PMD, "Failed to get capability for cdev %u\n",
+		RTE_LOG(ERR, USER1, "Failed to get capability for cdev %u\n",
 				dev_id);
 		return -EACCES;
 	}
@@ -1156,7 +1156,7 @@ prepare_aead_xform(uint8_t dev_id,
 			aead_xform->key.length,
 			aead_xform->digest_length, aead_xform->aad_length,
 			aead_xform->iv.length) != 0) {
-		RTE_LOG(ERR, PMD,
+		RTE_LOG(ERR, USER1,
 			"PMD %s key_len %u tag_len %u aad_len %u iv_len %u\n",
 				rte_cryptodev_name_get(dev_id),
 				aead_xform->key.length,
@@ -1195,7 +1195,7 @@ prepare_cipher_op(struct rte_crypto_op *op,
 
 	dst = (uint8_t *)rte_pktmbuf_append(mbuf, len);
 	if (!dst) {
-		RTE_LOG(ERR, PMD, "Error %i: MBUF too small\n", -ENOMEM);
+		RTE_LOG(ERR, USER1, "Error %i: MBUF too small\n", -ENOMEM);
 		return -ENOMEM;
 	}
 
@@ -1219,7 +1219,7 @@ prepare_auth_op(struct rte_crypto_op *op,
 	uint8_t *dst;
 
 	if (vec->input.len + vec->digest.len > RTE_MBUF_MAX_NB_SEGS) {
-		RTE_LOG(ERR, PMD, "Error %i: Test data too long (%u).\n",
+		RTE_LOG(ERR, USER1, "Error %i: Test data too long (%u).\n",
 				-ENOMEM, vec->input.len + vec->digest.len);
 		return -ENOMEM;
 	}
@@ -1229,7 +1229,7 @@ prepare_auth_op(struct rte_crypto_op *op,
 	dst = (uint8_t *)rte_pktmbuf_append(mbuf, vec->input.len +
 			vec->digest.len);
 	if (!dst) {
-		RTE_LOG(ERR, PMD, "Error %i: MBUF too small\n", -ENOMEM);
+		RTE_LOG(ERR, USER1, "Error %i: MBUF too small\n", -ENOMEM);
 		return -ENOMEM;
 	}
 
@@ -1274,7 +1274,7 @@ prepare_aead_op(struct rte_crypto_op *op,
 		memcpy(iv, vec->iv.data, vec->iv.len);
 
 	if (len + vec->digest.len > RTE_MBUF_MAX_NB_SEGS) {
-		RTE_LOG(ERR, PMD, "Error %i: Test data too long (%u).\n",
+		RTE_LOG(ERR, USER1, "Error %i: Test data too long (%u).\n",
 				-ENOMEM, len + vec->digest.len);
 		return -ENOMEM;
 	}
@@ -1282,7 +1282,7 @@ prepare_aead_op(struct rte_crypto_op *op,
 	dst = (uint8_t *)rte_pktmbuf_append(mbuf, RTE_ALIGN_CEIL(len +
 			vec->digest.len, 16));
 	if (!dst) {
-		RTE_LOG(ERR, PMD, "Error %i: MBUF too small\n", -ENOMEM);
+		RTE_LOG(ERR, USER1, "Error %i: MBUF too small\n", -ENOMEM);
 		return -ENOMEM;
 	}
 
@@ -1303,7 +1303,7 @@ prepare_aead_op(struct rte_crypto_op *op,
 
 	dst = rte_malloc(NULL, len, 16);
 	if (!dst) {
-		RTE_LOG(ERR, PMD, "Error %i: Not enough memory\n", -ENOMEM);
+		RTE_LOG(ERR, USER1, "Error %i: Not enough memory\n", -ENOMEM);
 		return -ENOMEM;
 	}
 
@@ -1474,24 +1474,24 @@ run_single_test(uint8_t dev_id,
 	ret = test_ops->prepare_xform(dev_id, &xform, vec, dir, key,
 			negative_test);
 	if (ret < 0) {
-		RTE_LOG(ERR, PMD, "Error %i: Prepare Xform\n", ret);
+		RTE_LOG(ERR, USER1, "Error %i: Prepare Xform\n", ret);
 		return ret;
 	}
 
 	sess = rte_cryptodev_sym_session_create(dev_id, &xform, env->sess_pool);
 	if (!sess) {
-		RTE_LOG(ERR, PMD, "Error %i: Init session\n", ret);
+		RTE_LOG(ERR, USER1, "Error %i: Init session\n", ret);
 		return ret;
 	}
 
 	ret = test_ops->prepare_op(env->op, env->mbuf, sess, dir, vec);
 	if (ret < 0) {
-		RTE_LOG(ERR, PMD, "Error %i: Prepare op\n", ret);
+		RTE_LOG(ERR, USER1, "Error %i: Prepare op\n", ret);
 		return ret;
 	}
 
 	if (rte_cryptodev_enqueue_burst(dev_id, 0, &env->op, 1) < 1) {
-		RTE_LOG(ERR, PMD, "Error: Failed enqueue\n");
+		RTE_LOG(ERR, USER1, "Error: Failed enqueue\n");
 		return ret;
 	}
 
@@ -1622,7 +1622,7 @@ fips_dev_self_test(uint8_t dev_id,
 
 	ret = fips_dev_auto_test_init(dev_id, &env);
 	if (ret < 0) {
-		RTE_LOG(ERR, PMD, "Failed to init self-test for PMD %u\n",
+		RTE_LOG(ERR, USER1, "Failed to init self-test for PMD %u\n",
 				dev_id);
 		return ret;
 	}
@@ -1644,7 +1644,7 @@ fips_dev_self_test(uint8_t dev_id,
 					negative_test = 0;
 			}
 
-			RTE_LOG(INFO, PMD, "Testing (ID %u) %s %s%s...\n",
+			RTE_LOG(INFO, USER1, "Testing (ID %u) %s %s%s...\n",
 					i,
 					vec->name,
 					j == self_test_dir_enc_auth_gen ?
@@ -1658,18 +1658,18 @@ fips_dev_self_test(uint8_t dev_id,
 				if (!negative_test)
 					break;
 				ret = -1;
-				RTE_LOG(ERR, PMD, "PMD %u Failed test %s %s\n",
+				RTE_LOG(ERR, USER1, "PMD %u Failed test %s %s\n",
 					dev_id, vec->name,
 					j == self_test_dir_enc_auth_gen ?
 					"Encrypt" : "Decrypt");
 				goto error_exit;
 			case -EACCES:
-				RTE_LOG(ERR, PMD, "Not supported by %s. Skip\n",
+				RTE_LOG(ERR, USER1, "Not supported by %s. Skip\n",
 					rte_cryptodev_name_get(dev_id));
 				ret = 0;
 				break;
 			default:
-				RTE_LOG(ERR, PMD, "PMD %u Failed test %s %s\n",
+				RTE_LOG(ERR, USER1, "PMD %u Failed test %s %s\n",
 					dev_id, vec->name,
 					j == self_test_dir_enc_auth_gen ?
 					"Encrypt" : "Decrypt");
@@ -1682,7 +1682,7 @@ fips_dev_self_test(uint8_t dev_id,
 	fips_dev_auto_test_uninit(dev_id, &env);
 
 	if (ret == 0) {
-		RTE_LOG(INFO, PMD, "PMD %u finished self-test successfully\n",
+		RTE_LOG(INFO, USER1, "PMD %u finished self-test successfully\n",
 				dev_id);
 	}
 
-- 
2.43.0


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

* [PATCH v4 17/17] log: mark PMD logtype as deprecated
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                     ` (15 preceding siblings ...)
  2023-12-18 19:22   ` [PATCH v4 16/17] examples/fips_validation: replace use of PMD logtype Stephen Hemminger
@ 2023-12-18 19:22   ` Stephen Hemminger
  16 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-18 19:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This is temporary patch to help find all misue use of PMD logtype
---
 lib/log/log.c     | 3 +++
 lib/log/rte_log.h | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/log/log.c b/lib/log/log.c
index ab06132a98a1..09a31a62c0fd 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -352,6 +352,9 @@ struct logtype {
 
 static const struct logtype logtype_strings[] = {
 	{RTE_LOGTYPE_EAL,        "lib.eal"},
+/* avoid deprecated warning */
+#undef RTE_LOGTYPE_PMD
+#define RTE_LOGTYPE_PMD        5
 	{RTE_LOGTYPE_PMD,        "pmd"},
 	{RTE_LOGTYPE_PORT,       "lib.port"},
 	{RTE_LOGTYPE_TABLE,      "lib.table"},
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 3394746103d4..4d207b8da2cd 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -31,7 +31,7 @@ extern "C" {
 				 /* was RTE_LOGTYPE_RING */
 				 /* was RTE_LOGTYPE_MEMPOOL */
 				 /* was RTE_LOGTYPE_TIMER */
-#define RTE_LOGTYPE_PMD        5 /**< Log related to poll mode driver. */
+#define RTE_LOGTYPE_PMD  RTE_DEPRECATED(RTE_LOGTYPE_PMD) 5
 				 /* was RTE_LOGTYPE_HASH */
 				 /* was RTE_LOGTYPE_LPM */
 				 /* was RTE_LOGTYPE_KNI */
-- 
2.43.0


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

* Re: [PATCH v4 10/17] crypto/caam_jr: use dedicated logtype
  2023-12-18 19:22   ` [PATCH v4 10/17] crypto/caam_jr: use dedicated logtype Stephen Hemminger
@ 2023-12-21  9:38     ` David Marchand
  0 siblings, 0 replies; 214+ messages in thread
From: David Marchand @ 2023-12-21  9:38 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Mon, Dec 18, 2023 at 8:28 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> The driver has macro and logtype but not used in a couple places.
>
> Fixes: af7c9b5e9ce7 ("crypto/caam_jr: introduce basic driver")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

CAAM_JR log macros add a \n, please remove them from the format
strings when converting.


-- 
David Marchand


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

* Re: [PATCH v4 11/17] crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
  2023-12-18 19:22   ` [PATCH v4 11/17] crypto/dpaa_sec, crypto/dpaa2_sec: " Stephen Hemminger
@ 2023-12-21  9:39     ` David Marchand
  0 siblings, 0 replies; 214+ messages in thread
From: David Marchand @ 2023-12-21  9:39 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Mon, Dec 18, 2023 at 8:28 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
> diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
> index a301e8edb2a4..3008ca4dc2f7 100644
> --- a/drivers/crypto/dpaa_sec/dpaa_sec.c
> +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
> @@ -3518,7 +3518,7 @@ dpaa_sec_eventq_detach(const struct rte_cryptodev *dev,
>         qman_oos_fq(&qp->outq);
>         ret = qman_init_fq(&qp->outq, 0, &opts);
>         if (ret)
> -               RTE_LOG(ERR, PMD, "Error in qman_init_fq: ret: %d\n", ret);
> +               DPAA_SEC_ERR("Error in qman_init_fq: ret: %d\n", ret);
>         qp->outq.cb.dqrr = NULL;
>
>         return ret;
> @@ -3709,7 +3709,7 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)
>
>         dpaa_sec_get_devargs(cryptodev->device->devargs, DRIVER_DUMP_MODE);
>
> -       RTE_LOG(INFO, PMD, "%s cryptodev init\n", cryptodev->data->name);
> +       DPAA_SEC_INFO("%s cryptodev init\n", cryptodev->data->name);
>         return 0;
>
>  init_error:

No \n please, DPAA_SEC* log macros add one.


-- 
David Marchand


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

* Re: [PATCH v4 08/17] crypto/scheduler: replace use of logtype PMD
  2023-12-18 19:22   ` [PATCH v4 08/17] crypto/scheduler: replace use of logtype PMD Stephen Hemminger
@ 2023-12-21  9:40     ` David Marchand
  0 siblings, 0 replies; 214+ messages in thread
From: David Marchand @ 2023-12-21  9:40 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Mon, Dec 18, 2023 at 8:28 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Driver has logging macro but not used everywhere.
>
> Fixes: 6760463c9f26 ("crypto/scheduler: add mode-specific threshold parameter")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/crypto/scheduler/scheduler_pmd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
> index 589d092d7457..aaf2dcdb57ec 100644
> --- a/drivers/crypto/scheduler/scheduler_pmd.c
> +++ b/drivers/crypto/scheduler/scheduler_pmd.c
> @@ -197,8 +197,8 @@ cryptodev_scheduler_create(const char *name,
>                                 return -EINVAL;
>                         }
>
> -                       RTE_LOG(INFO, PMD, "  Sched mode param (%s = %s)\n",
> -                                       param_name, param_val);
> +                       CR_SCHED_LOG(INFO, "  Sched mode param (%s = %s)\n",
> +                                    param_name, param_val);
>                 }
>         }

No \n please.


-- 
David Marchand


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

* Re: [PATCH v4 12/17] event/dlb2: use dedicated logtype
  2023-12-18 19:22   ` [PATCH v4 12/17] event/dlb2: " Stephen Hemminger
@ 2023-12-21  9:41     ` David Marchand
  0 siblings, 0 replies; 214+ messages in thread
From: David Marchand @ 2023-12-21  9:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Mon, Dec 18, 2023 at 8:28 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Driver was using RTE_LOGTYPE_PMD when it had its own logtype.
> Fixes: 5433956d5185 ("event/dlb2: add eventdev probe")
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/event/dlb2/dlb2.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
> index 050ace0904b4..5a16123f0af9 100644
> --- a/drivers/event/dlb2/dlb2.c
> +++ b/drivers/event/dlb2/dlb2.c
> @@ -4741,9 +4741,8 @@ dlb2_parse_params(const char *params,
>                 struct rte_kvargs *kvlist = rte_kvargs_parse(params, args);
>
>                 if (kvlist == NULL) {
> -                       RTE_LOG(INFO, PMD,
> -                               "Ignoring unsupported parameters when creating device '%s'\n",
> -                               name);
> +                       DLB2_LOG_INFO("Ignoring unsupported parameters when creating device '%s'\n",
> +                                     name);
>                 } else {
>                         int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG,
>                                                      set_numa_node,

No \n please.


-- 
David Marchand


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

* Re: [PATCH v4 14/17] event/skeleton: replace logtype PMD with dynamic type
  2023-12-18 19:22   ` [PATCH v4 14/17] event/skeleton: replace logtype PMD with dynamic type Stephen Hemminger
@ 2023-12-21  9:43     ` David Marchand
  0 siblings, 0 replies; 214+ messages in thread
From: David Marchand @ 2023-12-21  9:43 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Mon, Dec 18, 2023 at 8:28 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> The skeleton is supposed to match current best practices.
> Change it to use dynamic logtype.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/event/skeleton/skeleton_eventdev.c | 3 ++-
>  drivers/event/skeleton/skeleton_eventdev.h | 8 ++++++--
>  2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c
> index 7df032b7daa1..df50d2e4e4ff 100644
> --- a/drivers/event/skeleton/skeleton_eventdev.c
> +++ b/drivers/event/skeleton/skeleton_eventdev.c
> @@ -457,7 +457,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)
>         const char *name;
>
>         name = rte_vdev_device_name(vdev);
> -       RTE_LOG(INFO, PMD, "Initializing %s on NUMA node %d\n", name,
> +       PMD_DRV_LOG(INFO, "Initializing %s on NUMA node %d\n", name,
>                         rte_socket_id());
>         return skeleton_eventdev_create(name, rte_socket_id(), vdev);
>  }

No \n please.


-- 
David Marchand


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

* Re: [PATCH v4 07/17] raw/cnxk: replace PMD logtype with dynamic type
  2023-12-18 19:22   ` [PATCH v4 07/17] raw/cnxk: replace PMD logtype with dynamic type Stephen Hemminger
@ 2023-12-21  9:49     ` David Marchand
  0 siblings, 0 replies; 214+ messages in thread
From: David Marchand @ 2023-12-21  9:49 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Mon, Dec 18, 2023 at 8:27 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Driver should not be using PMD logtype, they should have their
> own logtype.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

[snip]
                                  \
> diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
> index 15dbc4c1a637..831f0d001adc 100644
> --- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
> +++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
> @@ -251,7 +251,7 @@ cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev,
>
>         /* get rid of last response if any */
>         if (qp->rsp) {
> -               RTE_LOG(WARNING, PMD, "Previous response got overwritten\n");
> +               CNXK_BPHY_LOG(ERR, "Previous response got overwritten");

This level change is unrelated to $SUBJECT.


>                 rte_free(qp->rsp);
>         }
>         qp->rsp = rsp;


-- 
David Marchand


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

* [PATCH v5 00/18] Replace uses of PMD logtype
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (28 preceding siblings ...)
  2023-12-18 19:22 ` [PATCH v4 00/17] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
@ 2023-12-21 16:46 ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 01/18] drivers: use dedicated logtypes Stephen Hemminger
                     ` (18 more replies)
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                   ` (2 subsequent siblings)
  32 siblings, 19 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a leftover and should be removed.
This replaces all uses in current tree. It leaves PMD logtype
as deprecated because there maybe other uses in external projects
leftover.

This version does not use Depends-on: because CI system can't
handle that and want to make sure no PMD left behind.

v5 - incorporate review feedback

David Marchand (1):
  drivers: use dedicated logtypes

Stephen Hemminger (17):
  common/sfc_efx: remove use of PMD logtype
  mempool/dpaa2: use driver logtype not PMD
  net/dpaa: use dedicated logtype not PMD
  net/dpaa2: used dedicated logtype not PMD
  net/mvpp2: use dedicated logtype
  net/vmxnet3: used dedicated logtype not PMD
  raw/cnxk: replace PMD logtype with dynamic type
  crypto/scheduler: replace use of logtype PMD
  crypto/ccp: do not use PMD logtype
  crypto/caam_jr: use dedicated logtype
  crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
  event/dlb2: use dedicated logtype
  event/dpaa, event/dpaa2: use dedicated logtype
  event/skeleton: replace logtype PMD with dynamic type
  net/nfb: use dynamic logtype
  examples/fips_validation: replace use of PMD logtype
  log: mark PMD logtype as deprecated

 .../baseband/la12xx/bbdev_la12xx_pmd_logs.h   |   3 +-
 drivers/bus/cdx/cdx_logs.h                    |   3 +-
 drivers/bus/fslmc/fslmc_logs.h                |   3 +-
 drivers/common/cnxk/roc_platform.h            |  16 +-
 drivers/common/cpt/cpt_pmd_logs.h             |   6 +-
 drivers/common/dpaax/caamflib/compat.h        |   4 +-
 drivers/common/dpaax/dpaax_logs.h             |   3 +-
 drivers/common/dpaax/version.map              |   1 +
 drivers/common/idpf/idpf_common_logs.h        |   5 +-
 drivers/common/sfc_efx/sfc_efx.c              |  11 +-
 drivers/common/sfc_efx/sfc_efx_log.h          |   2 +-
 drivers/crypto/caam_jr/caam_jr.c              |  46 ++-
 drivers/crypto/caam_jr/caam_jr_log.h          |  15 +-
 drivers/crypto/caam_jr/caam_jr_uio.c          |   4 +-
 drivers/crypto/ccp/rte_ccp_pmd.c              |  13 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |   6 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h     |   3 +-
 drivers/crypto/dpaa_sec/dpaa_sec.c            |  30 +-
 drivers/crypto/dpaa_sec/dpaa_sec_log.h        |   3 +-
 drivers/crypto/scheduler/scheduler_pmd.c      |   4 +-
 drivers/dma/dpaa/dpaa_qdma_logs.h             |   3 +-
 drivers/dma/dpaa2/dpaa2_qdma_logs.h           |   3 +-
 drivers/event/dlb2/dlb2.c                     | 275 +++++++++---------
 drivers/event/dlb2/dlb2_log.h                 |   3 +-
 drivers/event/dpaa/dpaa_eventdev.c            |   2 +-
 drivers/event/dpaa2/dpaa2_eventdev.c          |   4 +-
 drivers/event/dpaa2/dpaa2_eventdev_logs.h     |   3 +-
 drivers/event/dpaa2/dpaa2_eventdev_selftest.c |   6 +-
 drivers/event/skeleton/skeleton_eventdev.c    |   4 +-
 drivers/event/skeleton/skeleton_eventdev.h    |   8 +-
 drivers/mempool/dpaa/dpaa_mempool.c           |   1 +
 drivers/mempool/dpaa/dpaa_mempool.h           |   2 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c      |   4 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h |   3 +-
 drivers/net/atlantic/atl_logs.h               |   5 +-
 drivers/net/avp/avp_logs.h                    |   5 +-
 drivers/net/bnxt/bnxt.h                       |   1 +
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c         |   2 +-
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c          |   2 +-
 drivers/net/bnxt/bnxt_txr.c                   |   2 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   8 +-
 drivers/net/dpaa/dpaa_ethdev.h                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   2 +-
 drivers/net/dpaa2/dpaa2_pmd_logs.h            |   3 +-
 drivers/net/dpaa2/dpaa2_sparser.c             |   4 +-
 drivers/net/enetc/enetc_logs.h                |   3 +-
 drivers/net/enetfec/enet_pmd_logs.h           |   3 +-
 drivers/net/igc/igc_logs.h                    |   5 +-
 drivers/net/mana/mana.h                       |   3 +-
 drivers/net/mvpp2/mrvl_ethdev.c               |   4 +-
 drivers/net/nfb/nfb.h                         |   5 +
 drivers/net/nfb/nfb_ethdev.c                  |  24 +-
 drivers/net/nfb/nfb_rx.c                      |   9 +-
 drivers/net/nfb/nfb_rx.h                      |   2 +-
 drivers/net/nfb/nfb_tx.c                      |   9 +-
 drivers/net/nfb/nfb_tx.h                      |   2 +-
 drivers/net/octeon_ep/otx_ep_common.h         |   2 +
 drivers/net/octeon_ep/otx_ep_rxtx.c           |   2 +-
 drivers/net/octeontx/octeontx_logs.h          |   3 +-
 drivers/net/pfe/pfe_logs.h                    |   3 +-
 drivers/net/qede/qede_logs.h                  |   5 +-
 drivers/net/virtio/virtio_logs.h              |   5 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   2 +-
 drivers/net/vmxnet3/vmxnet3_logs.h            |   7 +-
 drivers/raw/cnxk_bphy/cnxk_bphy.c             |   3 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c         |   2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c    |  31 +-
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h          |   6 +
 drivers/raw/cnxk_gpio/cnxk_gpio.c             |  21 +-
 drivers/raw/cnxk_gpio/cnxk_gpio.h             |   5 +
 drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c    |  17 +-
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h    |   3 +-
 .../raw/ifpga/base/osdep_rte/osdep_generic.h  |   5 +-
 drivers/vdpa/ifc/base/ifcvf.c                 |  10 +-
 drivers/vdpa/ifc/base/ifcvf_osdep.h           |   7 +-
 examples/fips_validation/fips_dev_self_test.c |  44 +--
 lib/log/log.c                                 |   3 +
 lib/log/rte_log.h                             |   2 +-
 78 files changed, 420 insertions(+), 376 deletions(-)

-- 
2.43.0


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

* [PATCH v5 01/18] drivers: use dedicated logtypes
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 02/18] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
                     ` (17 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Gagandeep Singh, Hemant Agrawal, Nipun Gupta,
	Nikhil Agarwal, Sachin Saxena, Anoob Joseph, Jingjing Wu,
	Beilei Xing, Abdullah Sevincer, Igor Russkikh, Steven Webster,
	Matt Peters, Ajit Khaparde, Somnath Kotur, Ruifeng Wang,
	Bruce Richardson, Konstantin Ananyev, Apeksha Gupta, Junfeng Guo,
	Simei Su, Long Li, Vamsi Attunuru, Harman Kalra,
	Devendra Singh Rawat, Alok Prasad, Maxime Coquelin, Chenbo Xia,
	Jochen Behrens, Rosen Xu, Tianfei Zhang, Xiao Wang

From: David Marchand <david.marchand@redhat.com>

When a driver dedicated logtype exists, use it instead of the generic
PMD logtype.

This has been done partially automatically with:

$ for file in $(git grep -l RTE_LOG.*PMD.*fmt drivers/'**.h' \
  :^drivers/common/cnxk/roc_platform.h)
do
  tail=${file#drivers/*/*/}
  dir=${file%%$tail}
  ! git grep -q RTE_LOGTYPE_ $dir || \
    { echo $dir already done; continue; }
  git grep -hE '^extern int .*log.*;$' $file | \
  sed -ne 's/^extern int \([^ ;]*\);$/\1/p' | \
  while read logtype
  do
    git grep -q 'RTE_LOG_REGISTER\(_DEFAULT\|\)('$logtype',' || \
    [ "$logtype" != "${logtype%%driver}" ] || \
      { echo Skipped $logtype; continue; }
    abbrev=$(echo $logtype | sed -e 's/_logtype//' | tr '[a-z]' '[A-Z]')
    sed -i -e 's/^\(extern int '$logtype'.*\)$/\1\n#define RTE_LOGTYPE_' \
      $abbrev' '$logtype'/' $file
    sed -i -e 's/\(RTE_LOG.*, \)PMD,/\1'$abbrev',/' $file
    break
  done
done

Then a manual update for:
- common/cpt,
- common/dpaax,
- common/idpf,
- mempool/dpaa,
- net/bnxt,
- net/octeon_ep,
- raw/ifpga,
- vdpa/ifc,

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h  |  3 ++-
 drivers/bus/cdx/cdx_logs.h                       |  3 ++-
 drivers/bus/fslmc/fslmc_logs.h                   |  3 ++-
 drivers/common/cpt/cpt_pmd_logs.h                |  6 +++---
 drivers/common/dpaax/caamflib/compat.h           |  4 +++-
 drivers/common/dpaax/dpaax_logs.h                |  3 ++-
 drivers/common/dpaax/version.map                 |  1 +
 drivers/common/idpf/idpf_common_logs.h           |  5 +++--
 drivers/crypto/caam_jr/caam_jr_log.h             |  3 ++-
 drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h        |  3 ++-
 drivers/crypto/dpaa_sec/dpaa_sec_log.h           |  3 ++-
 drivers/dma/dpaa/dpaa_qdma_logs.h                |  3 ++-
 drivers/dma/dpaa2/dpaa2_qdma_logs.h              |  3 ++-
 drivers/event/dlb2/dlb2_log.h                    |  3 ++-
 drivers/event/dpaa2/dpaa2_eventdev_logs.h        |  3 ++-
 drivers/mempool/dpaa/dpaa_mempool.c              |  1 +
 drivers/mempool/dpaa/dpaa_mempool.h              |  2 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h    |  3 ++-
 drivers/net/atlantic/atl_logs.h                  |  5 +++--
 drivers/net/avp/avp_logs.h                       |  5 +++--
 drivers/net/bnxt/bnxt.h                          |  1 +
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c            |  2 +-
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c             |  2 +-
 drivers/net/bnxt/bnxt_txr.c                      |  2 +-
 drivers/net/dpaa/dpaa_ethdev.h                   |  3 ++-
 drivers/net/dpaa2/dpaa2_pmd_logs.h               |  3 ++-
 drivers/net/enetc/enetc_logs.h                   |  3 ++-
 drivers/net/enetfec/enet_pmd_logs.h              |  3 ++-
 drivers/net/igc/igc_logs.h                       |  5 +++--
 drivers/net/mana/mana.h                          |  3 ++-
 drivers/net/octeon_ep/otx_ep_common.h            |  2 ++
 drivers/net/octeon_ep/otx_ep_rxtx.c              |  2 +-
 drivers/net/octeontx/octeontx_logs.h             |  3 ++-
 drivers/net/pfe/pfe_logs.h                       |  3 ++-
 drivers/net/qede/qede_logs.h                     |  5 +++--
 drivers/net/virtio/virtio_logs.h                 |  5 +++--
 drivers/net/vmxnet3/vmxnet3_logs.h               |  7 ++++---
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h       |  3 ++-
 drivers/raw/ifpga/base/osdep_rte/osdep_generic.h |  5 ++++-
 drivers/vdpa/ifc/base/ifcvf.c                    | 10 +++++-----
 drivers/vdpa/ifc/base/ifcvf_osdep.h              |  7 +++++--
 41 files changed, 92 insertions(+), 52 deletions(-)

diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
index 452435ccb942..49c8d35d104d 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
+++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
@@ -6,6 +6,7 @@
 #define _BBDEV_LA12XX_PMD_LOGS_H_
 
 extern int bbdev_la12xx_logtype;
+#define RTE_LOGTYPE_BBDEV_LA12XX bbdev_la12xx_logtype
 
 #define rte_bbdev_log(level, fmt, ...) \
 	rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \
@@ -23,6 +24,6 @@ extern int bbdev_la12xx_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define rte_bbdev_dp_log(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, BBDEV_LA12XX, fmt, ## args)
 
 #endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
diff --git a/drivers/bus/cdx/cdx_logs.h b/drivers/bus/cdx/cdx_logs.h
index a1046ce544a6..3a56e814d0fd 100644
--- a/drivers/bus/cdx/cdx_logs.h
+++ b/drivers/bus/cdx/cdx_logs.h
@@ -6,6 +6,7 @@
 #define CDX_LOGS_H
 
 extern int cdx_logtype_bus;
+#define RTE_LOGTYPE_CDX_BUS cdx_logtype_bus
 
 #define CDX_BUS_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, cdx_logtype_bus, "cdx: " fmt "\n", \
@@ -25,7 +26,7 @@ extern int cdx_logtype_bus;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define CDX_BUS_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, CDX_BUS, fmt, ## args)
 
 #define CDX_BUS_DP_DEBUG(fmt, args...) \
 	CDX_BUS_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/bus/fslmc/fslmc_logs.h b/drivers/bus/fslmc/fslmc_logs.h
index a1e14dd84e9a..37c6852ddd72 100644
--- a/drivers/bus/fslmc/fslmc_logs.h
+++ b/drivers/bus/fslmc/fslmc_logs.h
@@ -8,6 +8,7 @@
 #define _FSLMC_LOGS_H_
 
 extern int dpaa2_logtype_bus;
+#define RTE_LOGTYPE_DPAA2_BUS dpaa2_logtype_bus
 
 #define DPAA2_BUS_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_logtype_bus, "fslmc: " fmt "\n", \
@@ -27,7 +28,7 @@ extern int dpaa2_logtype_bus;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_BUS_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA2_BUS, fmt, ## args)
 
 #define DPAA2_BUS_DP_DEBUG(fmt, args...) \
 	DPAA2_BUS_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/common/cpt/cpt_pmd_logs.h b/drivers/common/cpt/cpt_pmd_logs.h
index 174326c6ce38..3c109c1983ca 100644
--- a/drivers/common/cpt/cpt_pmd_logs.h
+++ b/drivers/common/cpt/cpt_pmd_logs.h
@@ -15,6 +15,8 @@
  * otx*_cryptodev.h file would define the CPT_LOGTYPE macro for the
  * platform.
  */
+#define RTE_LOGTYPE_CPT CPT_LOGTYPE
+
 #define CPT_PMD_DRV_LOG_RAW(level, fmt, args...) \
 		rte_log(RTE_LOG_ ## level, CPT_LOGTYPE, \
 			"cpt: %s(): " fmt "\n", __func__, ##args)
@@ -30,11 +32,9 @@
 
 /*
  * DP logs, toggled out at compile time if level lower than current level.
- * DP logs would be logged under 'PMD' type. So for dynamic logging, the
- * level of 'pmd' has to be used.
  */
 #define CPT_LOG_DP(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	RTE_LOG_DP(level, CPT, fmt "\n", ## args)
 
 #define CPT_LOG_DP_DEBUG(fmt, args...) \
 	CPT_LOG_DP(DEBUG, fmt, ## args)
diff --git a/drivers/common/dpaax/caamflib/compat.h b/drivers/common/dpaax/caamflib/compat.h
index 9776eed437ad..43da6a4fe32f 100644
--- a/drivers/common/dpaax/caamflib/compat.h
+++ b/drivers/common/dpaax/caamflib/compat.h
@@ -20,6 +20,8 @@
 #include <rte_byteorder.h>
 #include <rte_common.h>
 
+#include "dpaax_logs.h"
+
 #ifndef __BYTE_ORDER__
 #error "Undefined endianness"
 #endif
@@ -44,7 +46,7 @@
 #define pr_msg(l, fmt, ...) do { } while (0)
 #else
 #define pr_msg(l, fmt, ...) \
-	RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
+	RTE_LOG(l, DPAAX_LOGGER, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
 #endif
 
 #if !defined(pr_debug)
diff --git a/drivers/common/dpaax/dpaax_logs.h b/drivers/common/dpaax/dpaax_logs.h
index 180476f6757c..c405c60992c8 100644
--- a/drivers/common/dpaax/dpaax_logs.h
+++ b/drivers/common/dpaax/dpaax_logs.h
@@ -8,6 +8,7 @@
 #include <rte_log.h>
 
 extern int dpaax_logger;
+#define RTE_LOGTYPE_DPAAX_LOGGER dpaax_logger
 
 #ifdef RTE_LIBRTE_DPAAX_DEBUG
 #define DPAAX_HWWARN(cond, fmt, args...) \
@@ -37,7 +38,7 @@ extern int dpaax_logger;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAAX_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAAX_LOGGER, fmt, ## args)
 
 #define DPAAX_DP_DEBUG(fmt, args...) \
 	DPAAX_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/common/dpaax/version.map b/drivers/common/dpaax/version.map
index ee1ca6801c81..d48a6b6f37ee 100644
--- a/drivers/common/dpaax/version.map
+++ b/drivers/common/dpaax/version.map
@@ -6,6 +6,7 @@ INTERNAL {
 	dpaax_iova_table_p;
 	dpaax_iova_table_populate;
 	dpaax_iova_table_update;
+	dpaax_logger;
 	of_device_is_available;
 	of_device_is_compatible;
 	of_find_compatible_node;
diff --git a/drivers/common/idpf/idpf_common_logs.h b/drivers/common/idpf/idpf_common_logs.h
index f6be84ceb549..e638c616d8f5 100644
--- a/drivers/common/idpf/idpf_common_logs.h
+++ b/drivers/common/idpf/idpf_common_logs.h
@@ -8,6 +8,7 @@
 #include <rte_log.h>
 
 extern int idpf_common_logtype;
+#define RTE_LOGTYPE_IDPF_COMMON idpf_common_logtype
 
 #define DRV_LOG_RAW(level, ...)					\
 	rte_log(RTE_LOG_ ## level,				\
@@ -23,7 +24,7 @@ extern int idpf_common_logtype;
 #ifdef RTE_LIBRTE_IDPF_DEBUG_RX
 #define RX_LOG(level, ...) \
 	RTE_LOG(level, \
-		PMD, \
+		IDPF_COMMON, \
 		RTE_FMT("%s(): " \
 			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
 			__func__, \
@@ -35,7 +36,7 @@ extern int idpf_common_logtype;
 #ifdef RTE_LIBRTE_IDPF_DEBUG_TX
 #define TX_LOG(level, ...) \
 	RTE_LOG(level, \
-		PMD, \
+		IDPF_COMMON, \
 		RTE_FMT("%s(): " \
 			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
 			__func__, \
diff --git a/drivers/crypto/caam_jr/caam_jr_log.h b/drivers/crypto/caam_jr/caam_jr_log.h
index 106ff07a70fe..8f6aa50e2a4a 100644
--- a/drivers/crypto/caam_jr/caam_jr_log.h
+++ b/drivers/crypto/caam_jr/caam_jr_log.h
@@ -8,6 +8,7 @@
 #include <rte_log.h>
 
 extern int caam_jr_logtype;
+#define RTE_LOGTYPE_CAAM_JR caam_jr_logtype
 
 #define CAAM_JR_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \
@@ -28,7 +29,7 @@ extern int caam_jr_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define CAAM_JR_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	RTE_LOG_DP(level, CAAM_JR, fmt "\n", ## args)
 
 #define CAAM_JR_DP_DEBUG(fmt, args...) \
 	CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
index c2e11f9516f9..ee692095045a 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
@@ -9,6 +9,7 @@
 #define _DPAA2_SEC_LOGS_H_
 
 extern int dpaa2_logtype_sec;
+#define RTE_LOGTYPE_DPAA2_SEC dpaa2_logtype_sec
 
 #define DPAA2_SEC_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_logtype_sec, "dpaa2_sec: " \
@@ -29,7 +30,7 @@ extern int dpaa2_logtype_sec;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_SEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA2_SEC, fmt, ## args)
 
 #define DPAA2_SEC_DP_DEBUG(fmt, args...) \
 	DPAA2_SEC_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_log.h b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
index fb895a8bc67f..f8c85b6528a9 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec_log.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
@@ -9,6 +9,7 @@
 #define _DPAA_SEC_LOG_H_
 
 extern int dpaa_logtype_sec;
+#define RTE_LOGTYPE_DPAA_SEC dpaa_logtype_sec
 
 #define DPAA_SEC_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa_logtype_sec, "dpaa_sec: " \
@@ -29,7 +30,7 @@ extern int dpaa_logtype_sec;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_SEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA_SEC, fmt, ## args)
 
 #define DPAA_SEC_DP_DEBUG(fmt, args...) \
 	DPAA_SEC_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/dma/dpaa/dpaa_qdma_logs.h b/drivers/dma/dpaa/dpaa_qdma_logs.h
index 762598f8f72f..95753dcd89b0 100644
--- a/drivers/dma/dpaa/dpaa_qdma_logs.h
+++ b/drivers/dma/dpaa/dpaa_qdma_logs.h
@@ -6,6 +6,7 @@
 #define __DPAA_QDMA_LOGS_H__
 
 extern int dpaa_qdma_logtype;
+#define RTE_LOGTYPE_DPAA_QDMA dpaa_qdma_logtype
 
 #define DPAA_QDMA_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa_qdma_logtype, "dpaa_qdma: " \
@@ -26,7 +27,7 @@ extern int dpaa_qdma_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args)
+	RTE_LOG_DP(level, DPAA_QDMA, "dpaa_qdma: " fmt "\n", ## args)
 
 #define DPAA_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/dma/dpaa2/dpaa2_qdma_logs.h b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
index a46b8f24b5a7..37a5a5c6e974 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma_logs.h
+++ b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
@@ -10,6 +10,7 @@ extern "C" {
 #endif
 
 extern int dpaa2_qdma_logtype;
+#define RTE_LOGTYPE_DPAA2_QDMA dpaa2_qdma_logtype
 
 #define DPAA2_QDMA_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_qdma_logtype, "dpaa2_qdma: " \
@@ -30,7 +31,7 @@ extern int dpaa2_qdma_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa2_qdma: " fmt "\n", ## args)
+	RTE_LOG_DP(level, DPAA2_QDMA, "dpaa2_qdma: " fmt "\n", ## args)
 
 #define DPAA2_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/event/dlb2/dlb2_log.h b/drivers/event/dlb2/dlb2_log.h
index dc1481ef870c..54d6a3011f25 100644
--- a/drivers/event/dlb2/dlb2_log.h
+++ b/drivers/event/dlb2/dlb2_log.h
@@ -6,6 +6,7 @@
 #define _DLB2_EVDEV_LOG_H_
 
 extern int eventdev_dlb2_log_level;
+#define RTE_LOGTYPE_EVENTDEV_DLB2_LOG_LEVEL eventdev_dlb2_log_level
 
 /* Dynamic logging */
 #define DLB2_LOG_IMPL(level, fmt, args...) \
@@ -20,6 +21,6 @@ extern int eventdev_dlb2_log_level;
 
 /* remove debug logs at compile time unless actually debugging */
 #define DLB2_LOG_DBG(fmt, args...) \
-	RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
+	RTE_LOG_DP(DEBUG, EVENTDEV_DLB2_LOG_LEVEL, fmt, ## args)
 
 #endif /* _DLB2_EVDEV_LOG_H_ */
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
index 66c8c772740d..ae221e7e1524 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_logs.h
+++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
@@ -6,6 +6,7 @@
 #define _DPAA2_EVENTDEV_LOGS_H_
 
 extern int dpaa2_logtype_event;
+#define RTE_LOGTYPE_DPAA2_EVENT dpaa2_logtype_event
 
 #define DPAA2_EVENTDEV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_logtype_event, "dpaa2_event: " \
@@ -26,7 +27,7 @@ extern int dpaa2_logtype_event;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_EVENTDEV_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA2_EVENT, fmt, ## args)
 
 #define DPAA2_EVENTDEV_DP_DEBUG(fmt, args...) \
 	DPAA2_EVENTDEV_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index 32639a3bfdab..0b484b3d9c7d 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -38,6 +38,7 @@ struct dpaa_memseg_list rte_dpaa_memsegs
 struct dpaa_bp_info *rte_dpaa_bpid_info;
 
 RTE_LOG_REGISTER_DEFAULT(dpaa_logtype_mempool, NOTICE);
+#define RTE_LOGTYPE_DPAA_MEMPOOL dpaa_logtype_mempool
 
 static int
 dpaa_mbuf_create_pool(struct rte_mempool *mp)
diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 3f0eafa7dd7b..153fefd507f9 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -67,7 +67,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;
 #define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
 
 #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \
-	RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
+	RTE_LOG_DP(DEBUG, DPAA_MEMPOOL, fmt, ## args)
 #define DPAA_MEMPOOL_DEBUG(fmt, args...) \
 	DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args)
 #define DPAA_MEMPOOL_ERR(fmt, args...) \
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
index 986264319623..fbc8cb30a284 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
@@ -6,6 +6,7 @@
 #define _DPAA2_HW_MEMPOOL_LOGS_H_
 
 extern int dpaa2_logtype_mempool;
+#define RTE_LOGTYPE_DPAA2_MEMPOOL dpaa2_logtype_mempool
 
 #define DPAA2_MEMPOOL_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_logtype_mempool, \
@@ -25,7 +26,7 @@ extern int dpaa2_logtype_mempool;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA2_MEMPOOL, fmt, ## args)
 
 #define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \
 	DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/atlantic/atl_logs.h b/drivers/net/atlantic/atl_logs.h
index e3dba334fe92..14a7a1de1d5a 100644
--- a/drivers/net/atlantic/atl_logs.h
+++ b/drivers/net/atlantic/atl_logs.h
@@ -15,12 +15,13 @@ extern int atl_logtype_init;
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 
 extern int atl_logtype_driver;
+#define RTE_LOGTYPE_ATL_DRIVER atl_logtype_driver
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/avp/avp_logs.h b/drivers/net/avp/avp_logs.h
index 6e297c7a4a81..574b720b3050 100644
--- a/drivers/net/avp/avp_logs.h
+++ b/drivers/net/avp/avp_logs.h
@@ -9,19 +9,20 @@
 
 #ifdef RTE_LIBRTE_AVP_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() rx: " fmt, __func__, ## args)
+	RTE_LOG(level, AVP_DRIVER, "%s() rx: " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_AVP_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() tx: " fmt, __func__, ## args)
+	RTE_LOG(level, AVP_DRIVER, "%s() tx: " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 extern int avp_logtype_driver;
+#define RTE_LOGTYPE_AVP_DRIVER avp_logtype_driver
 
 #define PMD_DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 0e01b1d4baea..61cc34417631 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -1051,6 +1051,7 @@ extern const struct rte_flow_ops bnxt_flow_meter_ops;
 		((eth_dev)->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
 
 extern int bnxt_logtype_driver;
+#define RTE_LOGTYPE_BNXT bnxt_logtype_driver
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, bnxt_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
index aa1b1ab8bb7e..775400f21ced 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
@@ -357,7 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
+			RTE_LOG_DP(ERR, BNXT,
 				   "Unhandled CMP type %02x\n",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index e99a547f5857..8ef51ce79a71 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -326,7 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
+			RTE_LOG_DP(ERR, BNXT,
 				   "Unhandled CMP type %02x\n",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 899986764f93..04e74587cb06 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -542,7 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
 		if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
 			nb_tx_pkts += opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
+			RTE_LOG_DP(ERR, BNXT,
 					"Unhandled CMP type %02x\n",
 					CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 5b6802ece8f0..b6c61b8b6b08 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -214,6 +214,7 @@ dpaa_rx_cb_atomic(void *event,
 
 /* PMD related logs */
 extern int dpaa_logtype_pmd;
+#define RTE_LOGTYPE_DPAA_PMD dpaa_logtype_pmd
 
 #define DPAA_PMD_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa_logtype_pmd, "%s(): " fmt "\n", \
@@ -232,6 +233,6 @@ extern int dpaa_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA_PMD, fmt, ## args)
 
 #endif
diff --git a/drivers/net/dpaa2/dpaa2_pmd_logs.h b/drivers/net/dpaa2/dpaa2_pmd_logs.h
index c47ba8e10bfc..af895a6b6e7b 100644
--- a/drivers/net/dpaa2/dpaa2_pmd_logs.h
+++ b/drivers/net/dpaa2/dpaa2_pmd_logs.h
@@ -6,6 +6,7 @@
 #define _DPAA2_PMD_LOGS_H_
 
 extern int dpaa2_logtype_pmd;
+#define RTE_LOGTYPE_DPAA2_PMD dpaa2_logtype_pmd
 
 #define DPAA2_PMD_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_logtype_pmd, "dpaa2_net: " \
@@ -28,7 +29,7 @@ extern int dpaa2_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA2_PMD, fmt, ## args)
 
 #define DPAA2_PMD_DP_DEBUG(fmt, args...) \
 	DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/enetc/enetc_logs.h b/drivers/net/enetc/enetc_logs.h
index 0976d42debd7..63f6ca4cf48a 100644
--- a/drivers/net/enetc/enetc_logs.h
+++ b/drivers/net/enetc/enetc_logs.h
@@ -6,6 +6,7 @@
 #define _ENETC_LOGS_H_
 
 extern int enetc_logtype_pmd;
+#define RTE_LOGTYPE_ENETC_PMD enetc_logtype_pmd
 
 #define ENETC_PMD_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, enetc_logtype_pmd, "enetc_net: " \
@@ -30,7 +31,7 @@ extern int enetc_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETC_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, ENETC_PMD, fmt, ## args)
 
 #define ENETC_PMD_DP_DEBUG(fmt, args...) \
 	ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/enetfec/enet_pmd_logs.h b/drivers/net/enetfec/enet_pmd_logs.h
index 72d1cb61c598..270981373f53 100644
--- a/drivers/net/enetfec/enet_pmd_logs.h
+++ b/drivers/net/enetfec/enet_pmd_logs.h
@@ -8,6 +8,7 @@
 #include <rte_log.h>
 
 extern int enetfec_logtype_pmd;
+#define RTE_LOGTYPE_ENETFEC_PMD enetfec_logtype_pmd
 
 /* PMD related logs */
 #define ENETFEC_PMD_LOG(level, fmt, args...) \
@@ -28,6 +29,6 @@ extern int enetfec_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETFEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, ENETFEC_PMD, fmt, ## args)
 
 #endif /* _ENETFEC_LOGS_H_ */
diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 11071a32b542..cca5389eff8e 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -13,6 +13,7 @@ extern "C" {
 
 extern int igc_logtype_init;
 extern int igc_logtype_driver;
+#define RTE_LOGTYPE_IGC_DRIVER igc_logtype_driver
 
 #define PMD_INIT_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, igc_logtype_init, \
@@ -22,14 +23,14 @@ extern int igc_logtype_driver;
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index 6836872dc257..6d4770dc3e96 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -460,6 +460,7 @@ struct mana_rxq {
 };
 
 extern int mana_logtype_driver;
+#define RTE_LOGTYPE_MANA_DRIVER mana_logtype_driver
 extern int mana_logtype_init;
 
 #define DRV_LOG(level, fmt, args...) \
@@ -467,7 +468,7 @@ extern int mana_logtype_init;
 		__func__, ## args)
 
 #define DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	RTE_LOG_DP(level, MANA_DRIVER, fmt "\n", ## args)
 
 #define PMD_INIT_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
index 82e57520d38d..d5074b74e4ae 100644
--- a/drivers/net/octeon_ep/otx_ep_common.h
+++ b/drivers/net/octeon_ep/otx_ep_common.h
@@ -598,4 +598,6 @@ int otx_ep_delete_oqs(struct otx_ep_device *otx_ep, uint32_t oq_no);
 #define PCI_VENDOR_ID_CAVIUM			0x177D
 
 extern int otx_net_ep_logtype;
+#define RTE_LOGTYPE_OTX_NET_EP otx_net_ep_logtype
+
 #endif  /* _OTX_EP_COMMON_H_ */
diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c
index c421ef0a1c04..a6a71fdbfd47 100644
--- a/drivers/net/octeon_ep/otx_ep_rxtx.c
+++ b/drivers/net/octeon_ep/otx_ep_rxtx.c
@@ -884,7 +884,7 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		next_fetch = (pkts == new_pkts - 1) ? 0 : 1;
 		oq_pkt = otx_ep_droq_read_packet(otx_ep, droq, next_fetch);
 		if (!oq_pkt) {
-			RTE_LOG_DP(ERR, PMD,
+			RTE_LOG_DP(ERR, OTX_NET_EP,
 				   "DROQ read pkt failed pending %" PRIu64
 				    "last_pkt_count %" PRIu64 "new_pkts %d.\n",
 				   droq->pkts_pending, droq->last_pkt_count,
diff --git a/drivers/net/octeontx/octeontx_logs.h b/drivers/net/octeontx/octeontx_logs.h
index dec8042c67ba..b58f296478c9 100644
--- a/drivers/net/octeontx/octeontx_logs.h
+++ b/drivers/net/octeontx/octeontx_logs.h
@@ -20,7 +20,7 @@
 			"%s(): " fmt "\n", __func__, ## args)
 
 #define octeontx_log_info(fmt, args...)			\
-	RTE_LOG(INFO, PMD, fmt "\n", ## args)
+	RTE_LOG(INFO, OTX_NET_DRIVER, fmt "\n", ## args)
 
 #define octeontx_log_err(s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)
 #define octeontx_log_dbg(s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__)
@@ -31,6 +31,7 @@
 
 extern int otx_net_logtype_init;
 extern int otx_net_logtype_driver;
+#define RTE_LOGTYPE_OTX_NET_DRIVER otx_net_logtype_driver
 extern int otx_net_logtype_mbox;
 
 #endif /* __OCTEONTX_LOGS_H__*/
diff --git a/drivers/net/pfe/pfe_logs.h b/drivers/net/pfe/pfe_logs.h
index 58d5e8e7cff1..369a50bec567 100644
--- a/drivers/net/pfe/pfe_logs.h
+++ b/drivers/net/pfe/pfe_logs.h
@@ -6,6 +6,7 @@
 #define _PFE_LOGS_H_
 
 extern int pfe_logtype_pmd;
+#define RTE_LOGTYPE_PFE_PMD pfe_logtype_pmd
 
 /* PMD related logs */
 #define PFE_PMD_LOG(level, fmt, args...) \
@@ -26,6 +27,6 @@ extern int pfe_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define PFE_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, PFE_PMD, fmt, ## args)
 
 #endif /* _PFE_LOGS_H_ */
diff --git a/drivers/net/qede/qede_logs.h b/drivers/net/qede/qede_logs.h
index 3187d97bb7b0..f67052d10646 100644
--- a/drivers/net/qede/qede_logs.h
+++ b/drivers/net/qede/qede_logs.h
@@ -8,6 +8,7 @@
 #define _QEDE_LOGS_H_
 
 extern int qede_logtype_driver;
+#define RTE_LOGTYPE_QEDE_DRIVER qede_logtype_driver
 
 #define DP_ERR(p_dev, fmt, ...)				\
 	rte_log(RTE_LOG_ERR, qede_logtype_driver,	\
@@ -59,7 +60,7 @@ extern int qede_logtype_init;
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_TX
 #define PMD_TX_LOG(level, q, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \
+	RTE_LOG(level, QEDE_DRIVER, "%s(): port=%u queue=%u " fmt "\n", \
 		__func__, q->port_id, q->queue_id, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
@@ -67,7 +68,7 @@ extern int qede_logtype_init;
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_RX
 #define PMD_RX_LOG(level, q, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n",	\
+	RTE_LOG(level, QEDE_DRIVER, "%s(): port=%u queue=%u " fmt "\n",	\
 		__func__, q->port_id, q->queue_id, ## args)
 #else
 #define PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
diff --git a/drivers/net/virtio/virtio_logs.h b/drivers/net/virtio/virtio_logs.h
index 9b1b1defc5a6..01911514bd45 100644
--- a/drivers/net/virtio/virtio_logs.h
+++ b/drivers/net/virtio/virtio_logs.h
@@ -16,19 +16,20 @@ extern int virtio_logtype_init;
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args)
+	RTE_LOG(level, VIRTIO_DRIVER, "%s() rx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args)
+	RTE_LOG(level, VIRTIO_DRIVER, "%s() tx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 extern int virtio_logtype_driver;
+#define RTE_LOGTYPE_VIRTIO_DRIVER virtio_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
 		"%s(): " fmt "\n", __func__, ## args)
diff --git a/drivers/net/vmxnet3/vmxnet3_logs.h b/drivers/net/vmxnet3/vmxnet3_logs.h
index 74154e3a1a6d..e2127988f6fa 100644
--- a/drivers/net/vmxnet3/vmxnet3_logs.h
+++ b/drivers/net/vmxnet3/vmxnet3_logs.h
@@ -13,26 +13,27 @@ extern int vmxnet3_logtype_init;
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE
 #define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 extern int vmxnet3_logtype_driver;
+#define RTE_LOGTYPE_VMXNET3_DRIVER vmxnet3_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
 		"%s(): " fmt "\n", __func__, ## args)
diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
index 8991e8327d68..f5f2455413f0 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
@@ -10,6 +10,7 @@ extern "C" {
 #endif
 
 extern int dpaa2_cmdif_logtype;
+#define RTE_LOGTYPE_DPAA2_CMDIF dpaa2_cmdif_logtype
 
 #define DPAA2_CMDIF_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_cmdif_logtype, "dpaa2_cmdif: " \
@@ -30,7 +31,7 @@ extern int dpaa2_cmdif_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_CMDIF_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa2_cmdif: " fmt "\n", ## args)
+	RTE_LOG_DP(level, DPAA2_CMDIF, "dpaa2_cmdif: " fmt "\n", ## args)
 
 #define DPAA2_CMDIF_DP_DEBUG(fmt, args...) \
 	DPAA2_CMDIF_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h b/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
index 33041c907e19..62c5666ca948 100644
--- a/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
+++ b/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
@@ -16,8 +16,11 @@
 #include <rte_byteorder.h>
 #include <rte_memcpy.h>
 
+extern int ifpga_rawdev_logtype;
+#define RTE_LOGTYPE_IFPGA_RAWDEV ifpga_rawdev_logtype
+
 #define dev_printf(level, fmt, args...) \
-	RTE_LOG(level, PMD, "osdep_rte: " fmt, ## args)
+	RTE_LOG(level, IFPGA_RAWDEV, "osdep_rte: " fmt, ## args)
 
 #define osdep_panic(...) rte_panic(...)
 
diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c
index 53e982a52e9d..8479172bfa53 100644
--- a/drivers/vdpa/ifc/base/ifcvf.c
+++ b/drivers/vdpa/ifc/base/ifcvf.c
@@ -224,10 +224,10 @@ ifcvf_enable_mq(struct ifcvf_hw *hw)
 	if (mq_cfg) {
 		if (hw->device_type == IFCVF_BLK) {
 			*(u32 *)mq_cfg = nr_queue;
-			RTE_LOG(INFO, PMD, "%d queues are enabled\n", nr_queue);
+			RTE_LOG(INFO, IFCVF_VDPA, "%d queues are enabled\n", nr_queue);
 		} else {
 			*(u32 *)mq_cfg = nr_queue / 2;
-			RTE_LOG(INFO, PMD, "%d queue pairs are enabled\n",
+			RTE_LOG(INFO, IFCVF_VDPA, "%d queue pairs are enabled\n",
 				nr_queue / 2);
 		}
 	}
@@ -246,7 +246,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
 
 	cfg = hw->common_cfg;
 	if (!cfg) {
-		RTE_LOG(ERR, PMD, "common_cfg in HW is NULL.\n");
+		RTE_LOG(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.\n");
 		return -1;
 	}
 
@@ -258,7 +258,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
 		IFCVF_WRITE_REG16(i + 1, &cfg->queue_msix_vector);
 		msix_vector = IFCVF_READ_REG16(&cfg->queue_msix_vector);
 		if (msix_vector == IFCVF_MSI_NO_VECTOR) {
-			RTE_LOG(ERR, PMD, "queue %d, msix vec alloc failed\n",
+			RTE_LOG(ERR, IFCVF_VDPA, "queue %d, msix vec alloc failed\n",
 				i);
 			return -1;
 		}
@@ -307,7 +307,7 @@ ifcvf_disable_vring_hw(struct ifcvf_hw *hw, int i)
 
 	cfg = hw->common_cfg;
 	if (!cfg) {
-		RTE_LOG(ERR, PMD, "common_cfg in HW is NULL.\n");
+		RTE_LOG(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.\n");
 		return;
 	}
 
diff --git a/drivers/vdpa/ifc/base/ifcvf_osdep.h b/drivers/vdpa/ifc/base/ifcvf_osdep.h
index dd2ff08f77cc..ba7d684c25bc 100644
--- a/drivers/vdpa/ifc/base/ifcvf_osdep.h
+++ b/drivers/vdpa/ifc/base/ifcvf_osdep.h
@@ -13,8 +13,11 @@
 #include <rte_log.h>
 #include <rte_io.h>
 
-#define WARNINGOUT(S, args...)  RTE_LOG(WARNING, PMD, S, ##args)
-#define DEBUGOUT(S, args...)    RTE_LOG(DEBUG, PMD, S, ##args)
+extern int ifcvf_vdpa_logtype;
+#define RTE_LOGTYPE_IFCVF_VDPA ifcvf_vdpa_logtype
+
+#define WARNINGOUT(S, args...)  RTE_LOG(WARNING, IFCVF_VDPA, S, ##args)
+#define DEBUGOUT(S, args...)    RTE_LOG(DEBUG, IFCVF_VDPA, S, ##args)
 #define STATIC                  static
 
 #define msec_delay(x)	rte_delay_us_sleep(1000 * (x))
-- 
2.43.0


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

* [PATCH v5 02/18] common/sfc_efx: remove use of PMD logtype
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 01/18] drivers: use dedicated logtypes Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 03/18] mempool/dpaa2: use driver logtype not PMD Stephen Hemminger
                     ` (16 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Andrew Rybchenko

This code was implemented in a slightly different manner
than all the other logging code (for no good reason).
Make it the same and handle errors in same way as
other drivers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/sfc_efx/sfc_efx.c     | 11 ++---------
 drivers/common/sfc_efx/sfc_efx_log.h |  2 +-
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/common/sfc_efx/sfc_efx.c b/drivers/common/sfc_efx/sfc_efx.c
index 2dc5545760b8..5eeffb065b0d 100644
--- a/drivers/common/sfc_efx/sfc_efx.c
+++ b/drivers/common/sfc_efx/sfc_efx.c
@@ -15,7 +15,7 @@
 #include "sfc_efx_log.h"
 #include "sfc_efx.h"
 
-uint32_t sfc_efx_logtype;
+int sfc_efx_logtype;
 
 static int
 sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,
 	return rc;
 }
 
-RTE_INIT(sfc_efx_register_logtype)
-{
-	int ret;
-
-	ret = rte_log_register_type_and_pick_level("pmd.common.sfc_efx",
-						   RTE_LOG_NOTICE);
-	sfc_efx_logtype = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
-}
+RTE_LOG_REGISTER_DEFAULT(sfc_efx_logtype, NOTICE);
diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h
index 694455c1b14e..1519ebdc175f 100644
--- a/drivers/common/sfc_efx/sfc_efx_log.h
+++ b/drivers/common/sfc_efx/sfc_efx_log.h
@@ -11,7 +11,7 @@
 #define _SFC_EFX_LOG_H_
 
 /** Generic driver log type */
-extern uint32_t sfc_efx_logtype;
+extern int sfc_efx_logtype;
 
 /** Log message, add a prefix and a line break */
 #define SFC_EFX_LOG(level, ...) \
-- 
2.43.0


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

* [PATCH v5 03/18] mempool/dpaa2: use driver logtype not PMD
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 01/18] drivers: use dedicated logtypes Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 02/18] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 04/18] net/dpaa: use dedicated " Stephen Hemminger
                     ` (15 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena, Nipun Gupta,
	Shreyansh Jain

The driver already has macros for logging, use them.
Fixes: 7ed359909556 ("mempool/dpaa2: add functions for CMDIF")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 84371d5d1abb..4c9245cb814c 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_ERR("DPAA2 buffer pool not configured");
 		return -ENOMEM;
 	}
 
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_ERR("DPAA2 buffer pool not configured");
 		return NULL;
 	}
 
-- 
2.43.0


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

* [PATCH v5 04/18] net/dpaa: use dedicated logtype not PMD
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (2 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 03/18] mempool/dpaa2: use driver logtype not PMD Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 05/18] net/dpaa2: used " Stephen Hemminger
                     ` (14 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena, Nipun Gupta,
	Ferruh Yigit, Aman Singh

The driver already has a logtype, but was not used in couple
places.

Fixes: 6b10d1f7bdea ("net/dpaa: update process specific device info")
Fixes: c2c4f87b1259 ("net: add macro for MAC address print")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa/dpaa_ethdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index ef4c06db6a4d..2b497694cb02 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -2096,8 +2096,8 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 	/* copy the primary mac address */
 	rte_ether_addr_copy(&fman_intf->mac_addr, &eth_dev->data->mac_addrs[0]);
 
-	RTE_LOG(INFO, PMD, "net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n",
-		dpaa_device->name, RTE_ETHER_ADDR_BYTES(&fman_intf->mac_addr));
+	DPAA_PMD_INFO("net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT,
+		      dpaa_device->name, RTE_ETHER_ADDR_BYTES(&fman_intf->mac_addr));
 
 	if (!fman_intf->is_shared_mac) {
 		/* Configure error packet handling */
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 
 		ret = dpaa_dev_init_secondary(eth_dev);
 		if (ret != 0) {
-			RTE_LOG(ERR, PMD, "secondary dev init failed\n");
+			DPAA_PMD_ERR("secondary dev init failed");
 			return ret;
 		}
 
@@ -2182,7 +2182,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 
 		if (!(default_q || fmc_q)) {
 			if (dpaa_fm_init()) {
-				DPAA_PMD_ERR("FM init failed\n");
+				DPAA_PMD_ERR("FM init failed");
 				return -1;
 			}
 		}
-- 
2.43.0


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

* [PATCH v5 05/18] net/dpaa2: used dedicated logtype not PMD
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (3 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 04/18] net/dpaa: use dedicated " Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 06/18] net/mvpp2: use dedicated logtype Stephen Hemminger
                     ` (13 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena, Jun Yang

The driver has a logtype, but was not being used in one place.

Fixes: f023d059769f ("net/dpaa2: support recycle loopback port")
Fixes: 72ec7a678e70 ("net/dpaa2: add soft parser driver")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa2/dpaa2_ethdev.c  | 2 +-
 drivers/net/dpaa2/dpaa2_sparser.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 8e610b6bba30..91846fcd2f23 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 			return ret;
 		}
 	}
-	RTE_LOG(INFO, PMD, "%s: netdev created, connected to %s\n",
+	DPAA2_PMD_INFO("%s: netdev created, connected to %s",
 		eth_dev->data->name, dpaa2_dev->ep_name);
 
 	return 0;
diff --git a/drivers/net/dpaa2/dpaa2_sparser.c b/drivers/net/dpaa2/dpaa2_sparser.c
index 63463c4fbfd6..36a14526a5c5 100644
--- a/drivers/net/dpaa2/dpaa2_sparser.c
+++ b/drivers/net/dpaa2/dpaa2_sparser.c
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 
 	priv->ss_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(addr));
 	priv->ss_offset += sp_param.size;
-	RTE_LOG(INFO, PMD, "Soft parser loaded for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser loaded for dpni@%d", priv->hw_id);
 
 	rte_free(addr);
 	return 0;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 	}
 
 	rte_free(param_addr);
-	RTE_LOG(INFO, PMD, "Soft parser enabled for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser enabled for dpni@%d", priv->hw_id);
 	return 0;
 }
-- 
2.43.0


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

* [PATCH v5 06/18] net/mvpp2: use dedicated logtype
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (4 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 05/18] net/dpaa2: used " Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 07/18] net/vmxnet3: used dedicated logtype not PMD Stephen Hemminger
                     ` (12 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Liron Himi, Natalie Samsonov, Yelena Krivosheev

Always use the dedicated logtype, not PMD.

Fixes: 9e79d810911d ("net/mvpp2: support Tx scatter/gather")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index c12364941d62..9a9279a8783a 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)
 
 	/* Use a simple Tx queue (no offloads, no multi segs) if possible */
 	if (priv->multiseg) {
-		RTE_LOG(INFO, PMD, "Using multi-segment tx callback\n");
+		MRVL_LOG(INFO, "Using multi-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst;
 	} else {
-		RTE_LOG(INFO, PMD, "Using single-segment tx callback\n");
+		MRVL_LOG(INFO, "Using single-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_pkt_burst;
 	}
 }
-- 
2.43.0


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

* [PATCH v5 07/18] net/vmxnet3: used dedicated logtype not PMD
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (5 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 06/18] net/mvpp2: use dedicated logtype Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 08/18] raw/cnxk: replace PMD logtype with dynamic type Stephen Hemminger
                     ` (11 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Jochen Behrens, Yong Wang

The driver has log macros, just not used in one place.

Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index e49191718aea..4fd704045fc4 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)
 	if (events == 0)
 		goto done;
 
-	RTE_LOG(DEBUG, PMD, "Reading events: 0x%X", events);
+	PMD_DRV_LOG(DEBUG, "Reading events: 0x%X", events);
 	vmxnet3_process_events(dev);
 done:
 	vmxnet3_enable_intr(hw, *eventIntrIdx);
-- 
2.43.0


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

* [PATCH v5 08/18] raw/cnxk: replace PMD logtype with dynamic type
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (6 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 07/18] net/vmxnet3: used dedicated logtype not PMD Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 09/18] crypto/scheduler: replace use of logtype PMD Stephen Hemminger
                     ` (10 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao, Jakub Palider, Tomasz Duszynski

Driver should not be using PMD logtype, they should have their
own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/cnxk/roc_platform.h         | 16 ++++++-----
 drivers/raw/cnxk_bphy/cnxk_bphy.c          |  3 ++-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c      |  2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +++++++++++-----------
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h       |  6 +++++
 drivers/raw/cnxk_gpio/cnxk_gpio.c          | 21 ++++++++-------
 drivers/raw/cnxk_gpio/cnxk_gpio.h          |  5 ++++
 drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 17 ++++++------
 8 files changed, 57 insertions(+), 44 deletions(-)

diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index ba23b2e0d79e..9d2ea8f00965 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;
 extern int cnxk_logtype_ree;
 extern int cnxk_logtype_dpi;
 
+#define RTE_LOGTYPE_CNXK cnxk_logtype_base
+
 #define plt_err(fmt, args...)                                                  \
-	RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
-#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args)
-#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
+	RTE_LOG(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+#define plt_info(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)
+#define plt_warn(fmt, args...) RTE_LOG(WARNING, CNXK, fmt "\n", ##args)
+#define plt_print(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)
 #define plt_dump(fmt, ...)      fprintf(stderr, fmt "\n", ##__VA_ARGS__)
 #define plt_dump_no_nl(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
 
@@ -296,11 +298,11 @@ extern int cnxk_logtype_dpi;
 
 /* Datapath logs */
 #define plt_dp_err(fmt, args...)                                               \
-	RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
 #define plt_dp_info(fmt, args...)                                              \
-	RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP(INFO, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
 #define plt_dp_dbg(fmt, args...)                                              \
-	RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP(DEBUG, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
 
 #ifdef __cplusplus
 #define CNXK_PCI_ID(subsystem_dev, dev)                                        \
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
index 15dbc4c1a637..1dbab6fb3e12 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
@@ -251,7 +251,7 @@ cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev,
 
 	/* get rid of last response if any */
 	if (qp->rsp) {
-		RTE_LOG(WARNING, PMD, "Previous response got overwritten\n");
+		CNXK_BPHY_LOG(WARNING, "Previous response got overwritten");
 		rte_free(qp->rsp);
 	}
 	qp->rsp = rsp;
@@ -410,3 +410,4 @@ static struct rte_pci_driver cnxk_bphy_rawdev_pmd = {
 RTE_PMD_REGISTER_PCI(bphy_rawdev_pci_driver, cnxk_bphy_rawdev_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(bphy_rawdev_pci_driver, pci_bphy_map);
 RTE_PMD_REGISTER_KMOD_DEP(bphy_rawdev_pci_driver, "vfio-pci");
+RTE_LOG_REGISTER_SUFFIX(cnxk_logtype_bphy, bphy, INFO);
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
index 2d8466ef918b..4358aeecc3e5 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
@@ -189,7 +189,7 @@ cnxk_bphy_cgx_process_buf(struct cnxk_bphy_cgx *cgx, unsigned int queue,
 
 	/* get rid of last response if any */
 	if (qp->rsp) {
-		RTE_LOG(WARNING, PMD, "Previous response got overwritten\n");
+		CNXK_BPHY_LOG(WARNING, "Previous response got overwritten");
 		rte_free(qp->rsp);
 	}
 	qp->rsp = rsp;
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
index a3021b4bb7db..f01d958661ad 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
@@ -57,62 +57,61 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)
 		if (ret)
 			break;
 		if (descs != 1) {
-			RTE_LOG(ERR, PMD, "Wrong number of descs reported\n");
+			CNXK_BPHY_LOG(ERR, "Wrong number of descs reported");
 			ret = -ENODEV;
 			break;
 		}
 
-		RTE_LOG(INFO, PMD, "Testing queue %d\n", i);
+		CNXK_BPHY_LOG(INFO, "Testing queue %d", i);
 
 		ret = rte_pmd_bphy_cgx_stop_rxtx(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to stop rx/tx\n");
+			CNXK_BPHY_LOG(ERR, "Failed to stop rx/tx");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_start_rxtx(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to start rx/tx\n");
+			CNXK_BPHY_LOG(ERR, "Failed to start rx/tx");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_set_link_state(dev_id, i, false);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set link down\n");
+			CNXK_BPHY_LOG(ERR, "Failed to set link down");
 			break;
 		}
 
 		ret = cnxk_bphy_cgx_link_cond(dev_id, i, 0);
 		if (ret != 0)
-			RTE_LOG(ERR, PMD,
-				"Timed out waiting for a link down\n");
+			CNXK_BPHY_LOG(ERR, "Timed out waiting for a link down");
 
 		ret = rte_pmd_bphy_cgx_set_link_state(dev_id, i, true);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set link up\n");
+			CNXK_BPHY_LOG(ERR, "Failed to set link up");
 			break;
 		}
 
 		ret = cnxk_bphy_cgx_link_cond(dev_id, i, 1);
 		if (ret != 1)
-			RTE_LOG(ERR, PMD, "Timed out waiting for a link up\n");
+			CNXK_BPHY_LOG(ERR, "Timed out waiting for a link up");
 
 		ret = rte_pmd_bphy_cgx_intlbk_enable(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to enable internal lbk\n");
+			CNXK_BPHY_LOG(ERR, "Failed to enable internal lbk");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_intlbk_disable(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to disable internal lbk\n");
+			CNXK_BPHY_LOG(ERR, "Failed to disable internal lbk");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_ptp_rx_enable(dev_id, i);
 		/* ptp not available on RPM */
 		if (ret < 0 && ret != -ENOTSUP) {
-			RTE_LOG(ERR, PMD, "Failed to enable ptp\n");
+			CNXK_BPHY_LOG(ERR, "Failed to enable ptp");
 			break;
 		}
 		ret = 0;
@@ -120,27 +119,27 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)
 		ret = rte_pmd_bphy_cgx_ptp_rx_disable(dev_id, i);
 		/* ptp not available on RPM */
 		if (ret < 0 && ret != -ENOTSUP) {
-			RTE_LOG(ERR, PMD, "Failed to disable ptp\n");
+			CNXK_BPHY_LOG(ERR, "Failed to disable ptp");
 			break;
 		}
 		ret = 0;
 
 		ret = rte_pmd_bphy_cgx_get_supported_fec(dev_id, i, &fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to get supported FEC\n");
+			CNXK_BPHY_LOG(ERR, "Failed to get supported FEC");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_set_fec(dev_id, i, fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set FEC to %d\n", fec);
+			CNXK_BPHY_LOG(ERR, "Failed to set FEC to %d", fec);
 			break;
 		}
 
 		fec = CNXK_BPHY_CGX_ETH_LINK_FEC_NONE;
 		ret = rte_pmd_bphy_cgx_set_fec(dev_id, i, fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to disable FEC\n");
+			CNXK_BPHY_LOG(ERR, "Failed to disable FEC");
 			break;
 		}
 	}
diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
index 9d8d0285581b..7a7d9f6fa66f 100644
--- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
+++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
@@ -26,6 +26,12 @@
 extern "C" {
 #endif
 
+extern int cnxk_logtype_bphy;
+
+#define CNXK_BPHY_LOG(level, fmt, args...)	\
+	rte_log(RTE_LOG_ ## level, cnxk_logtype_bphy, \
+		"%s(): " fmt "\n", __func__, ## args)
+
 /** Available message types */
 enum cnxk_bphy_cgx_msg_type {
 	/** Type used to obtain link information */
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.c b/drivers/raw/cnxk_gpio/cnxk_gpio.c
index 3c4d79e4810e..329ac28a2736 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.c
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.c
@@ -215,13 +215,13 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)
 		errno = 0;
 		val = strtol(token, NULL, 10);
 		if (errno) {
-			RTE_LOG(ERR, PMD, "failed to parse %s\n", token);
+			CNXK_GPIO_LOG(ERR, "failed to parse %s", token);
 			ret = -errno;
 			goto out;
 		}
 
 		if (val < 0 || val >= gpiochip->num_gpios) {
-			RTE_LOG(ERR, PMD, "gpio%d out of 0-%d range\n", val,
+			CNXK_GPIO_LOG(ERR, "gpio%d out of 0-%d range", val,
 				gpiochip->num_gpios - 1);
 			ret = -EINVAL;
 			goto out;
@@ -231,7 +231,7 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)
 			if (list[i] != val)
 				continue;
 
-			RTE_LOG(WARNING, PMD, "gpio%d already allowed\n", val);
+			CNXK_GPIO_LOG(WARNING, "gpio%d already allowed", val);
 			break;
 		}
 		if (i == queue)
@@ -398,7 +398,7 @@ cnxk_gpio_queue_setup(struct rte_rawdev *dev, uint16_t queue_id,
 			return ret;
 		}
 	} else {
-		RTE_LOG(WARNING, PMD, "using existing gpio%d\n", gpio->num);
+		CNXK_GPIO_LOG(WARNING, "using existing gpio%d", gpio->num);
 	}
 
 	gpiochip->gpios[num] = gpio;
@@ -647,7 +647,7 @@ cnxk_gpio_process_buf(struct cnxk_gpio *gpio, struct rte_rawdev_buf *rbuf)
 
 	/* get rid of last response if any */
 	if (gpio->rsp) {
-		RTE_LOG(WARNING, PMD, "previous response got overwritten\n");
+		CNXK_GPIO_LOG(WARNING, "previous response got overwritten");
 		rte_free(gpio->rsp);
 	}
 	gpio->rsp = rsp;
@@ -741,7 +741,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	cnxk_gpio_format_name(name, sizeof(name));
 	rawdev = rte_rawdev_pmd_allocate(name, sizeof(*gpiochip), rte_socket_id());
 	if (!rawdev) {
-		RTE_LOG(ERR, PMD, "failed to allocate %s rawdev\n", name);
+		CNXK_GPIO_LOG(ERR, "failed to allocate %s rawdev", name);
 		return -ENOMEM;
 	}
 
@@ -770,7 +770,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	snprintf(buf, sizeof(buf), "%s/gpiochip%d/base", CNXK_GPIO_CLASS_PATH, gpiochip->num);
 	ret = cnxk_gpio_read_attr_int(buf, &gpiochip->base);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to read %s\n", buf);
+		CNXK_GPIO_LOG(ERR, "failed to read %s", buf);
 		goto out;
 	}
 
@@ -778,20 +778,20 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	snprintf(buf, sizeof(buf), "%s/gpiochip%d/ngpio", CNXK_GPIO_CLASS_PATH, gpiochip->num);
 	ret = cnxk_gpio_read_attr_int(buf, &gpiochip->num_gpios);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to read %s\n", buf);
+		CNXK_GPIO_LOG(ERR, "failed to read %s", buf);
 		goto out;
 	}
 	gpiochip->num_queues = gpiochip->num_gpios;
 
 	ret = cnxk_gpio_parse_allowlist(gpiochip, params->allowlist);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to parse allowed gpios\n");
+		CNXK_GPIO_LOG(ERR, "failed to parse allowed gpios");
 		goto out;
 	}
 
 	gpiochip->gpios = rte_calloc(NULL, gpiochip->num_gpios, sizeof(struct cnxk_gpio *), 0);
 	if (!gpiochip->gpios) {
-		RTE_LOG(ERR, PMD, "failed to allocate gpios memory\n");
+		CNXK_GPIO_LOG(ERR, "failed to allocate gpios memory");
 		ret = -ENOMEM;
 		goto out;
 	}
@@ -851,3 +851,4 @@ RTE_PMD_REGISTER_VDEV(cnxk_gpio, cnxk_gpio_drv);
 RTE_PMD_REGISTER_PARAM_STRING(cnxk_gpio,
 		"gpiochip=<int> "
 		"allowlist=<list>");
+RTE_LOG_REGISTER_SUFFIX(cnxk_logtype_gpio, gpio, INFO);
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.h b/drivers/raw/cnxk_gpio/cnxk_gpio.h
index e62f78a7604a..336d7ac373d7 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.h
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.h
@@ -5,6 +5,11 @@
 #ifndef _CNXK_GPIO_H_
 #define _CNXK_GPIO_H_
 
+extern int cnxk_logtype_gpio;
+
+#define CNXK_GPIO_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, cnxk_logtype_gpio, fmt "\n", ## args)
+
 struct cnxk_gpiochip;
 
 struct cnxk_gpio {
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c b/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
index 10742b5dc48a..2f3973a7b5e6 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
@@ -56,7 +56,7 @@ cnxk_gpio_read_attr(char *attr, char *val)
 
 #define CNXK_GPIO_ERR_STR(err, str, ...) do {                                  \
 	if (err) {                                                             \
-		RTE_LOG(ERR, PMD, "%s:%d: " str " (%d)\n", __func__, __LINE__, \
+		CNXK_GPIO_LOG(ERR, "%s:%d: " str " (%d)", __func__, __LINE__, \
 			##__VA_ARGS__, err);                                   \
 		goto out;                                                      \
 	}                                                                      \
@@ -330,30 +330,29 @@ cnxk_gpio_selftest(uint16_t dev_id)
 	for (i = 0; i < queues; i++) {
 		ret = rte_rawdev_queue_conf_get(dev_id, i, &conf, sizeof(conf));
 		if (ret) {
-			RTE_LOG(ERR, PMD,
-				"failed to read queue configuration (%d)\n",
+			CNXK_GPIO_LOG(ERR, "failed to read queue configuration (%d)",
 				ret);
 			goto out;
 		}
 
-		RTE_LOG(INFO, PMD, "testing queue%d (gpio%d)\n", i, conf.gpio);
+		CNXK_GPIO_LOG(INFO, "testing queue%d (gpio%d)", i, conf.gpio);
 
 		if (conf.size != 1) {
-			RTE_LOG(ERR, PMD, "wrong queue size received\n");
+			CNXK_GPIO_LOG(ERR, "wrong queue size received");
 			ret = -EIO;
 			goto out;
 		}
 
 		ret = rte_rawdev_queue_setup(dev_id, i, NULL, 0);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "failed to setup queue (%d)\n", ret);
+			CNXK_GPIO_LOG(ERR, "failed to setup queue (%d)", ret);
 			goto out;
 		}
 
 		gpio = gpiochip->gpios[conf.gpio];
 		snprintf(buf, sizeof(buf), CNXK_GPIO_PATH_FMT, gpio->num);
 		if (!cnxk_gpio_attr_exists(buf)) {
-			RTE_LOG(ERR, PMD, "%s does not exist\n", buf);
+			CNXK_GPIO_LOG(ERR, "%s does not exist", buf);
 			ret = -ENOENT;
 			goto release;
 		}
@@ -371,13 +370,13 @@ cnxk_gpio_selftest(uint16_t dev_id)
 		ret2 = ret;
 		ret = rte_rawdev_queue_release(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "failed to release queue (%d)\n",
+			CNXK_GPIO_LOG(ERR, "failed to release queue (%d)",
 				ret);
 			break;
 		}
 
 		if (cnxk_gpio_attr_exists(buf)) {
-			RTE_LOG(ERR, PMD, "%s still exists\n", buf);
+			CNXK_GPIO_LOG(ERR, "%s still exists", buf);
 			ret = -EIO;
 			break;
 		}
-- 
2.43.0


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

* [PATCH v5 09/18] crypto/scheduler: replace use of logtype PMD
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (7 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 08/18] raw/cnxk: replace PMD logtype with dynamic type Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 10/18] crypto/ccp: do not use PMD logtype Stephen Hemminger
                     ` (9 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Kai Ji, Fan Zhang

Driver has logging macro but not used everywhere.

Fixes: 6760463c9f26 ("crypto/scheduler: add mode-specific threshold parameter")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/scheduler/scheduler_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
index 589d092d7457..95ce893f0540 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -197,8 +197,8 @@ cryptodev_scheduler_create(const char *name,
 				return -EINVAL;
 			}
 
-			RTE_LOG(INFO, PMD, "  Sched mode param (%s = %s)\n",
-					param_name, param_val);
+			CR_SCHED_LOG(INFO, "  Sched mode param (%s = %s)",
+				     param_name, param_val);
 		}
 	}
 
-- 
2.43.0


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

* [PATCH v5 10/18] crypto/ccp: do not use PMD logtype
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (8 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 09/18] crypto/scheduler: replace use of logtype PMD Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 11/18] crypto/caam_jr: use dedicated logtype Stephen Hemminger
                     ` (8 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Sunil Uttarwar, Ravi Kumar

This driver has logging macros but not used consistently.

Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/ccp/rte_ccp_pmd.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index a5271d72273d..46a9275e3743 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -194,8 +194,7 @@ cryptodev_ccp_remove(struct rte_pci_device *pci_dev)
 
 	ccp_pmd_init_done = 0;
 
-	RTE_LOG(INFO, PMD, "Closing ccp device %s on numa socket %u\n",
-			name, rte_socket_id());
+	CCP_LOG_INFO("Closing ccp device %s on numa socket %u", name, rte_socket_id());
 
 	return rte_cryptodev_pmd_destroy(dev);
 }
@@ -228,7 +227,7 @@ cryptodev_ccp_create(const char *name,
 	}
 	cryptodev_cnt++;
 
-	CCP_LOG_DBG("CCP : Crypto device count = %d\n", cryptodev_cnt);
+	CCP_LOG_DBG("CCP : Crypto device count = %d", cryptodev_cnt);
 	dev->device = &pci_dev->device;
 	dev->device->driver = &pci_drv->driver;
 	dev->driver_id = ccp_cryptodev_driver_id;
@@ -279,7 +278,7 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	};
 
 	if (ccp_pmd_init_done) {
-		RTE_LOG(INFO, PMD, "CCP PMD already initialized\n");
+		CCP_LOG_INFO("CCP PMD already initialized");
 		return -EFAULT;
 	}
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
@@ -288,11 +287,11 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	init_params.def_p.max_nb_queue_pairs = CCP_PMD_MAX_QUEUE_PAIRS;
 
-	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
+	CCP_LOG_INFO("Initialising %s on NUMA node %d", name,
 		init_params.def_p.socket_id);
-	RTE_LOG(INFO, PMD, "Max number of queue pairs = %d\n",
+	CCP_LOG_INFO("Max number of queue pairs = %d",
 		init_params.def_p.max_nb_queue_pairs);
-	RTE_LOG(INFO, PMD, "Authentication offload to %s\n",
+	CCP_LOG_INFO("Authentication offload to %s",
 		((init_params.auth_opt == 0) ? "CCP" : "CPU"));
 
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
-- 
2.43.0


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

* [PATCH v5 11/18] crypto/caam_jr: use dedicated logtype
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (9 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 10/18] crypto/ccp: do not use PMD logtype Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 12/18] crypto/dpaa_sec, crypto/dpaa2_sec: " Stephen Hemminger
                     ` (7 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal, Akhil Goyal

The driver has macro and logtype but not used in a couple places.
Also, remove extraneous newlines.

Fixes: af7c9b5e9ce7 ("crypto/caam_jr: introduce basic driver")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/caam_jr/caam_jr.c     | 46 +++++++++++++---------------
 drivers/crypto/caam_jr/caam_jr_log.h | 12 ++++----
 drivers/crypto/caam_jr/caam_jr_uio.c |  4 +--
 3 files changed, 29 insertions(+), 33 deletions(-)

diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index b55258689b49..d3b42d8e1b91 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -123,10 +123,8 @@ void caam_jr_stats_get(struct rte_cryptodev *dev,
 		stats->dequeued_count += qp[i]->rx_pkts;
 		stats->enqueue_err_count += qp[i]->tx_errs;
 		stats->dequeue_err_count += qp[i]->rx_errs;
-		CAAM_JR_INFO("extra stats:\n\tRX Poll ERR = %" PRIu64
-			     "\n\tTX Ring Full = %" PRIu64,
-			     qp[i]->rx_poll_err,
-			     qp[i]->tx_ring_full);
+		CAAM_JR_INFO("extra stats: RX Poll ERR = %" PRIu64 "TX Ring Full = %" PRIu64,
+			     qp[i]->rx_poll_err, qp[i]->tx_ring_full);
 	}
 }
 
@@ -309,7 +307,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses)
 
 	cdb = caam_jr_dma_mem_alloc(L1_CACHE_BYTES, sizeof(struct sec_cdb));
 	if (!cdb) {
-		CAAM_JR_ERR("failed to allocate memory for cdb\n");
+		CAAM_JR_ERR("failed to allocate memory for cdb");
 		return -1;
 	}
 
@@ -606,7 +604,7 @@ hw_poll_job_ring(struct sec_job_ring_t *job_ring,
 		/*TODO for multiple ops, packets*/
 		ctx = container_of(current_desc, struct caam_jr_op_ctx, jobdes);
 		if (unlikely(sec_error_code)) {
-			CAAM_JR_ERR("desc at cidx %d generated error 0x%x\n",
+			CAAM_JR_ERR("desc at cidx %d generated error 0x%x",
 				job_ring->cidx, sec_error_code);
 			hw_handle_job_ring_error(job_ring, sec_error_code);
 			//todo improve with exact errors
@@ -1368,7 +1366,7 @@ caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp)
 	}
 
 	if (unlikely(!ses->qp || ses->qp != qp)) {
-		CAAM_JR_DP_DEBUG("Old:sess->qp=%p New qp = %p\n", ses->qp, qp);
+		CAAM_JR_DP_DEBUG("Old:sess->qp=%p New qp = %p", ses->qp, qp);
 		ses->qp = qp;
 		caam_jr_prep_cdb(ses);
 	}
@@ -1554,7 +1552,7 @@ caam_jr_cipher_init(struct rte_cryptodev *dev __rte_unused,
 	session->cipher_key.data = rte_zmalloc(NULL, xform->cipher.key.length,
 					       RTE_CACHE_LINE_SIZE);
 	if (session->cipher_key.data == NULL && xform->cipher.key.length > 0) {
-		CAAM_JR_ERR("No Memory for cipher key\n");
+		CAAM_JR_ERR("No Memory for cipher key");
 		return -ENOMEM;
 	}
 	session->cipher_key.length = xform->cipher.key.length;
@@ -1576,7 +1574,7 @@ caam_jr_auth_init(struct rte_cryptodev *dev __rte_unused,
 	session->auth_key.data = rte_zmalloc(NULL, xform->auth.key.length,
 					     RTE_CACHE_LINE_SIZE);
 	if (session->auth_key.data == NULL && xform->auth.key.length > 0) {
-		CAAM_JR_ERR("No Memory for auth key\n");
+		CAAM_JR_ERR("No Memory for auth key");
 		return -ENOMEM;
 	}
 	session->auth_key.length = xform->auth.key.length;
@@ -1602,7 +1600,7 @@ caam_jr_aead_init(struct rte_cryptodev *dev __rte_unused,
 	session->aead_key.data = rte_zmalloc(NULL, xform->aead.key.length,
 					     RTE_CACHE_LINE_SIZE);
 	if (session->aead_key.data == NULL && xform->aead.key.length > 0) {
-		CAAM_JR_ERR("No Memory for aead key\n");
+		CAAM_JR_ERR("No Memory for aead key");
 		return -ENOMEM;
 	}
 	session->aead_key.length = xform->aead.key.length;
@@ -1755,7 +1753,7 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 					       RTE_CACHE_LINE_SIZE);
 	if (session->cipher_key.data == NULL &&
 			cipher_xform->key.length > 0) {
-		CAAM_JR_ERR("No Memory for cipher key\n");
+		CAAM_JR_ERR("No Memory for cipher key");
 		return -ENOMEM;
 	}
 
@@ -1765,7 +1763,7 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 					RTE_CACHE_LINE_SIZE);
 	if (session->auth_key.data == NULL &&
 			auth_xform->key.length > 0) {
-		CAAM_JR_ERR("No Memory for auth key\n");
+		CAAM_JR_ERR("No Memory for auth key");
 		rte_free(session->cipher_key.data);
 		return -ENOMEM;
 	}
@@ -1810,11 +1808,11 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 	case RTE_CRYPTO_AUTH_KASUMI_F9:
 	case RTE_CRYPTO_AUTH_AES_CBC_MAC:
 	case RTE_CRYPTO_AUTH_ZUC_EIA3:
-		CAAM_JR_ERR("Crypto: Unsupported auth alg %u\n",
+		CAAM_JR_ERR("Crypto: Unsupported auth alg %u",
 			auth_xform->algo);
 		goto out;
 	default:
-		CAAM_JR_ERR("Crypto: Undefined Auth specified %u\n",
+		CAAM_JR_ERR("Crypto: Undefined Auth specified %u",
 			auth_xform->algo);
 		goto out;
 	}
@@ -1834,11 +1832,11 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_3DES_ECB:
 	case RTE_CRYPTO_CIPHER_AES_ECB:
 	case RTE_CRYPTO_CIPHER_KASUMI_F8:
-		CAAM_JR_ERR("Crypto: Unsupported Cipher alg %u\n",
+		CAAM_JR_ERR("Crypto: Unsupported Cipher alg %u",
 			cipher_xform->algo);
 		goto out;
 	default:
-		CAAM_JR_ERR("Crypto: Undefined Cipher specified %u\n",
+		CAAM_JR_ERR("Crypto: Undefined Cipher specified %u",
 			cipher_xform->algo);
 		goto out;
 	}
@@ -1962,7 +1960,7 @@ caam_jr_dev_configure(struct rte_cryptodev *dev,
 						NULL, NULL, NULL, NULL,
 						SOCKET_ID_ANY, 0);
 		if (!internals->ctx_pool) {
-			CAAM_JR_ERR("%s create failed\n", str);
+			CAAM_JR_ERR("%s create failed", str);
 			return -ENOMEM;
 		}
 	} else
@@ -2180,7 +2178,7 @@ init_job_ring(void *reg_base_addr, int irq_id)
 		}
 	}
 	if (job_ring == NULL) {
-		CAAM_JR_ERR("No free job ring\n");
+		CAAM_JR_ERR("No free job ring");
 		return NULL;
 	}
 
@@ -2301,7 +2299,7 @@ caam_jr_dev_init(const char *name,
 						job_ring->uio_fd);
 
 	if (!dev->data->dev_private) {
-		CAAM_JR_ERR("Ring memory allocation failed\n");
+		CAAM_JR_ERR("Ring memory allocation failed");
 		goto cleanup2;
 	}
 
@@ -2334,7 +2332,7 @@ caam_jr_dev_init(const char *name,
 	security_instance = rte_malloc("caam_jr",
 				sizeof(struct rte_security_ctx), 0);
 	if (security_instance == NULL) {
-		CAAM_JR_ERR("memory allocation failed\n");
+		CAAM_JR_ERR("memory allocation failed");
 		//todo error handling.
 		goto cleanup2;
 	}
@@ -2346,7 +2344,7 @@ caam_jr_dev_init(const char *name,
 
 	rte_cryptodev_pmd_probing_finish(dev);
 
-	RTE_LOG(INFO, PMD, "%s cryptodev init\n", dev->data->name);
+	CAAM_JR_INFO("%s cryptodev init", dev->data->name);
 
 	return 0;
 
@@ -2386,8 +2384,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev)
 
 	ret = of_init();
 	if (ret) {
-		RTE_LOG(ERR, PMD,
-		"of_init failed\n");
+		CAAM_JR_ERR("of_init failed");
 		return -EINVAL;
 	}
 	/* if sec device version is not configured */
@@ -2407,8 +2404,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev)
 	}
 #ifdef RTE_LIBRTE_PMD_CAAM_JR_BE
 	if (rta_get_sec_era() > RTA_SEC_ERA_8) {
-		RTE_LOG(ERR, PMD,
-		"CAAM is compiled in BE mode for device with sec era > 8???\n");
+		CAAM_JR_ERR("CAAM is compiled in BE mode for device with sec era > 8???");
 		return -EINVAL;
 	}
 #endif
diff --git a/drivers/crypto/caam_jr/caam_jr_log.h b/drivers/crypto/caam_jr/caam_jr_log.h
index 8f6aa50e2a4a..3d32b75e3a01 100644
--- a/drivers/crypto/caam_jr/caam_jr_log.h
+++ b/drivers/crypto/caam_jr/caam_jr_log.h
@@ -10,13 +10,13 @@
 extern int caam_jr_logtype;
 #define RTE_LOGTYPE_CAAM_JR caam_jr_logtype
 
-#define CAAM_JR_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \
-		fmt "\n", ##args)
+#define CAAM_JR_LOG(level, fmt, args...)		\
+	rte_log(RTE_LOG_ ## level, caam_jr_logtype,	\
+		"caam_jr: " fmt "\n", ##args)
 
-#define CAAM_JR_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, caam_jr_logtype, "caam_jr: %s(): " \
-		fmt "\n", __func__, ##args)
+#define CAAM_JR_DEBUG(fmt, args...)				\
+	rte_log(RTE_LOG_DEBUG, caam_jr_logtype,			\
+		"caam_jr: %s(): " fmt "\n", __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() CAAM_JR_DEBUG(" >>")
 
diff --git a/drivers/crypto/caam_jr/caam_jr_uio.c b/drivers/crypto/caam_jr/caam_jr_uio.c
index 583ba3b523af..4d9acfbe9196 100644
--- a/drivers/crypto/caam_jr/caam_jr_uio.c
+++ b/drivers/crypto/caam_jr/caam_jr_uio.c
@@ -338,7 +338,7 @@ free_job_ring(int uio_fd)
 	}
 
 	if (job_ring == NULL) {
-		CAAM_JR_ERR("JR not available for fd = %x\n", uio_fd);
+		CAAM_JR_ERR("JR not available for fd = %x", uio_fd);
 		return;
 	}
 
@@ -441,7 +441,7 @@ sec_configure(void)
 					dir->d_name, "name", uio_name);
 			CAAM_JR_INFO("sec device uio name: %s", uio_name);
 			if (ret != 0) {
-				CAAM_JR_ERR("file_read_first_line failed\n");
+				CAAM_JR_ERR("file_read_first_line failed");
 				closedir(d);
 				return -1;
 			}
-- 
2.43.0


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

* [PATCH v5 12/18] crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (10 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 11/18] crypto/caam_jr: use dedicated logtype Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 13/18] event/dlb2: " Stephen Hemminger
                     ` (6 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal, Akhil Goyal,
	Ashish Jain

A couple of messages were using RTE_LOGTYPE_PMD when dedicated
logtype was already available.

Fixes: fe3688ba7950 ("crypto/dpaa_sec: support event crypto adapter")
Fixes: bffc7d561c81 ("crypto/dpaa2_sec: support event crypto adapter")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c |  6 ++---
 drivers/crypto/dpaa_sec/dpaa_sec.c          | 30 ++++++++++-----------
 2 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index bb5a2c629e53..1cae6c45059e 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -4153,7 +4153,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 		ret = dpseci_set_opr(dpseci, CMD_PRI_LOW, priv->token,
 				   qp_id, OPR_OPT_CREATE, &ocfg);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Error setting opr: ret: %d\n", ret);
+			DPAA2_SEC_ERR("Error setting opr: ret: %d", ret);
 			return ret;
 		}
 		qp->tx_vq.cb_eqresp_free = dpaa2_sec_free_eqresp_buf;
@@ -4163,7 +4163,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 	ret = dpseci_set_rx_queue(dpseci, CMD_PRI_LOW, priv->token,
 				  qp_id, &cfg);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "Error in dpseci_set_queue: ret: %d\n", ret);
+		DPAA2_SEC_ERR("Error in dpseci_set_queue: ret: %d", ret);
 		return ret;
 	}
 
@@ -4188,7 +4188,7 @@ dpaa2_sec_eventq_detach(const struct rte_cryptodev *dev,
 	ret = dpseci_set_rx_queue(dpseci, CMD_PRI_LOW, priv->token,
 				  qp_id, &cfg);
 	if (ret)
-		RTE_LOG(ERR, PMD, "Error in dpseci_set_queue: ret: %d\n", ret);
+		DPAA2_SEC_ERR("Error in dpseci_set_queue: ret: %d", ret);
 
 	return ret;
 }
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index a301e8edb2a4..e7ebcbe2af22 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -102,7 +102,7 @@ ern_sec_fq_handler(struct qman_portal *qm __rte_unused,
 		   struct qman_fq *fq,
 		   const struct qm_mr_entry *msg)
 {
-	DPAA_SEC_DP_ERR("sec fq %d error, RC = %x, seqnum = %x\n",
+	DPAA_SEC_DP_ERR("sec fq %d error, RC = %x, seqnum = %x",
 			fq->fqid, msg->ern.rc, msg->ern.seqnum);
 }
 
@@ -849,7 +849,7 @@ dpaa_sec_deq(struct dpaa_sec_qp *qp, struct rte_crypto_op **ops, int nb_ops)
 			op->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
 		} else {
 			if (dpaa_sec_dp_dump > DPAA_SEC_DP_NO_DUMP) {
-				DPAA_SEC_DP_WARN("SEC return err:0x%x\n",
+				DPAA_SEC_DP_WARN("SEC return err:0x%x",
 						  ctx->fd_status);
 				if (dpaa_sec_dp_dump > DPAA_SEC_DP_ERR_DUMP)
 					dpaa_sec_dump(ctx, qp);
@@ -1943,8 +1943,7 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
 				}
 			} else if (unlikely(ses->qp[rte_lcore_id() %
 						MAX_DPAA_CORES] != qp)) {
-				DPAA_SEC_DP_ERR("Old:sess->qp = %p"
-					" New qp = %p\n",
+				DPAA_SEC_DP_ERR("Old: sess->qp = %p New qp = %p",
 					ses->qp[rte_lcore_id() %
 					MAX_DPAA_CORES], qp);
 				frames_to_send = loop;
@@ -2054,7 +2053,7 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
 				fd->cmd = 0x80000000 |
 					*((uint32_t *)((uint8_t *)op +
 					ses->pdcp.hfn_ovd_offset));
-				DPAA_SEC_DP_DEBUG("Per packet HFN: %x, ovd:%u\n",
+				DPAA_SEC_DP_DEBUG("Per packet HFN: %x, ovd:%u",
 					*((uint32_t *)((uint8_t *)op +
 					ses->pdcp.hfn_ovd_offset)),
 					ses->pdcp.hfn_ovd);
@@ -2095,7 +2094,7 @@ dpaa_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops,
 	dpaa_qp->rx_pkts += num_rx;
 	dpaa_qp->rx_errs += nb_ops - num_rx;
 
-	DPAA_SEC_DP_DEBUG("SEC Received %d Packets\n", num_rx);
+	DPAA_SEC_DP_DEBUG("SEC Received %d Packets", num_rx);
 
 	return num_rx;
 }
@@ -2158,7 +2157,7 @@ dpaa_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 							NULL, NULL, NULL, NULL,
 							SOCKET_ID_ANY, 0);
 		if (!qp->ctx_pool) {
-			DPAA_SEC_ERR("%s create failed\n", str);
+			DPAA_SEC_ERR("%s create failed", str);
 			return -ENOMEM;
 		}
 	} else
@@ -2459,7 +2458,7 @@ dpaa_sec_aead_init(struct rte_cryptodev *dev __rte_unused,
 	session->aead_key.data = rte_zmalloc(NULL, xform->aead.key.length,
 					     RTE_CACHE_LINE_SIZE);
 	if (session->aead_key.data == NULL && xform->aead.key.length > 0) {
-		DPAA_SEC_ERR("No Memory for aead key\n");
+		DPAA_SEC_ERR("No Memory for aead key");
 		return -ENOMEM;
 	}
 	session->aead_key.length = xform->aead.key.length;
@@ -2508,7 +2507,7 @@ dpaa_sec_detach_rxq(struct dpaa_sec_dev_private *qi, struct qman_fq *fq)
 	for (i = 0; i < RTE_DPAA_MAX_RX_QUEUE; i++) {
 		if (&qi->inq[i] == fq) {
 			if (qman_retire_fq(fq, NULL) != 0)
-				DPAA_SEC_DEBUG("Queue is not retired\n");
+				DPAA_SEC_DEBUG("Queue is not retired");
 			qman_oos_fq(fq);
 			qi->inq_attach[i] = 0;
 			return 0;
@@ -3483,7 +3482,7 @@ dpaa_sec_eventq_attach(const struct rte_cryptodev *dev,
 		qp->outq.cb.dqrr_dpdk_cb = dpaa_sec_process_atomic_event;
 		break;
 	case RTE_SCHED_TYPE_ORDERED:
-		DPAA_SEC_ERR("Ordered queue schedule type is not supported\n");
+		DPAA_SEC_ERR("Ordered queue schedule type is not supported");
 		return -ENOTSUP;
 	default:
 		opts.fqd.fq_ctrl |= QM_FQCTRL_AVOIDBLOCK;
@@ -3518,7 +3517,7 @@ dpaa_sec_eventq_detach(const struct rte_cryptodev *dev,
 	qman_oos_fq(&qp->outq);
 	ret = qman_init_fq(&qp->outq, 0, &opts);
 	if (ret)
-		RTE_LOG(ERR, PMD, "Error in qman_init_fq: ret: %d\n", ret);
+		DPAA_SEC_ERR("Error in qman_init_fq: ret: %d", ret);
 	qp->outq.cb.dqrr = NULL;
 
 	return ret;
@@ -3581,8 +3580,7 @@ check_devargs_handler(__rte_unused const char *key, const char *value,
 {
 	dpaa_sec_dp_dump = atoi(value);
 	if (dpaa_sec_dp_dump > DPAA_SEC_DP_FULL_DUMP) {
-		DPAA_SEC_WARN("WARN: DPAA_SEC_DP_DUMP_LEVEL is not "
-			      "supported, changing to FULL error prints\n");
+		DPAA_SEC_WARN("WARN: DPAA_SEC_DP_DUMP_LEVEL is not supported, changing to FULL error prints");
 		dpaa_sec_dp_dump = DPAA_SEC_DP_FULL_DUMP;
 	}
 
@@ -3645,7 +3643,7 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)
 
 	ret = munmap(internals->sec_hw, MAP_SIZE);
 	if (ret)
-		DPAA_SEC_WARN("munmap failed\n");
+		DPAA_SEC_WARN("munmap failed");
 
 	close(map_fd);
 	cryptodev->driver_id = dpaa_cryptodev_driver_id;
@@ -3709,11 +3707,11 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)
 
 	dpaa_sec_get_devargs(cryptodev->device->devargs, DRIVER_DUMP_MODE);
 
-	RTE_LOG(INFO, PMD, "%s cryptodev init\n", cryptodev->data->name);
+	DPAA_SEC_INFO("%s cryptodev init", cryptodev->data->name);
 	return 0;
 
 init_error:
-	DPAA_SEC_ERR("driver %s: create failed\n", cryptodev->data->name);
+	DPAA_SEC_ERR("driver %s: create failed", cryptodev->data->name);
 
 	rte_free(cryptodev->security_ctx);
 	return -EFAULT;
-- 
2.43.0


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

* [PATCH v5 13/18] event/dlb2: use dedicated logtype
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (11 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 12/18] crypto/dpaa_sec, crypto/dpaa2_sec: " Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 14/18] event/dpaa, event/dpaa2: " Stephen Hemminger
                     ` (5 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Abdullah Sevincer, Timothy McDaniel, Gage Eads

Driver was using RTE_LOGTYPE_PMD when it had its own logtype.
Fixes: 5433956d5185 ("event/dlb2: add eventdev probe")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/dlb2/dlb2.c | 275 +++++++++++++++++++-------------------
 1 file changed, 137 insertions(+), 138 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 050ace0904b4..419876490780 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -169,7 +169,7 @@ dlb2_hw_query_resources(struct dlb2_eventdev *dlb2)
 	ret = dlb2_iface_get_num_resources(handle,
 					   &dlb2->hw_rsrc_query_results);
 	if (ret) {
-		DLB2_LOG_ERR("ioctl get dlb2 num resources, err=%d\n", ret);
+		DLB2_LOG_ERR("ioctl get dlb2 num resources, err=%d", ret);
 		return ret;
 	}
 
@@ -259,7 +259,7 @@ set_producer_coremask(const char *key __rte_unused,
 	const char **mask_str = opaque;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -293,7 +293,7 @@ set_max_cq_depth(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -304,7 +304,7 @@ set_max_cq_depth(const char *key __rte_unused,
 	if (*max_cq_depth < DLB2_MIN_CQ_DEPTH_OVERRIDE ||
 	    *max_cq_depth > DLB2_MAX_CQ_DEPTH_OVERRIDE ||
 	    !rte_is_power_of_2(*max_cq_depth)) {
-		DLB2_LOG_ERR("dlb2: max_cq_depth %d and %d and a power of 2\n",
+		DLB2_LOG_ERR("dlb2: max_cq_depth %d and %d and a power of 2",
 			     DLB2_MIN_CQ_DEPTH_OVERRIDE,
 			     DLB2_MAX_CQ_DEPTH_OVERRIDE);
 		return -EINVAL;
@@ -322,7 +322,7 @@ set_max_enq_depth(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -333,7 +333,7 @@ set_max_enq_depth(const char *key __rte_unused,
 	if (*max_enq_depth < DLB2_MIN_ENQ_DEPTH_OVERRIDE ||
 	    *max_enq_depth > DLB2_MAX_ENQ_DEPTH_OVERRIDE ||
 	    !rte_is_power_of_2(*max_enq_depth)) {
-		DLB2_LOG_ERR("dlb2: max_enq_depth %d and %d and a power of 2\n",
+		DLB2_LOG_ERR("dlb2: max_enq_depth %d and %d and a power of 2",
 		DLB2_MIN_ENQ_DEPTH_OVERRIDE,
 		DLB2_MAX_ENQ_DEPTH_OVERRIDE);
 		return -EINVAL;
@@ -351,7 +351,7 @@ set_max_num_events(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -361,7 +361,7 @@ set_max_num_events(const char *key __rte_unused,
 
 	if (*max_num_events < 0 || *max_num_events >
 			DLB2_MAX_NUM_LDB_CREDITS) {
-		DLB2_LOG_ERR("dlb2: max_num_events must be between 0 and %d\n",
+		DLB2_LOG_ERR("dlb2: max_num_events must be between 0 and %d",
 			     DLB2_MAX_NUM_LDB_CREDITS);
 		return -EINVAL;
 	}
@@ -378,7 +378,7 @@ set_num_dir_credits(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -388,7 +388,7 @@ set_num_dir_credits(const char *key __rte_unused,
 
 	if (*num_dir_credits < 0 ||
 	    *num_dir_credits > DLB2_MAX_NUM_DIR_CREDITS(DLB2_HW_V2)) {
-		DLB2_LOG_ERR("dlb2: num_dir_credits must be between 0 and %d\n",
+		DLB2_LOG_ERR("dlb2: num_dir_credits must be between 0 and %d",
 			     DLB2_MAX_NUM_DIR_CREDITS(DLB2_HW_V2));
 		return -EINVAL;
 	}
@@ -405,7 +405,7 @@ set_dev_id(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -425,7 +425,7 @@ set_poll_interval(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -445,7 +445,7 @@ set_port_cos(const char *key __rte_unused,
 	int first, last, cos_id, i;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -458,18 +458,18 @@ set_port_cos(const char *key __rte_unused,
 	} else if (sscanf(value, "%d:%d", &first, &cos_id) == 2) {
 		last = first;
 	} else {
-		DLB2_LOG_ERR("Error parsing ldb port port_cos devarg. Should be port-port:val, or port:val\n");
+		DLB2_LOG_ERR("Error parsing ldb port port_cos devarg. Should be port-port:val, or port:val");
 		return -EINVAL;
 	}
 
 	if (first > last || first < 0 ||
 		last >= DLB2_MAX_NUM_LDB_PORTS) {
-		DLB2_LOG_ERR("Error parsing ldb port cos_id arg, invalid port value\n");
+		DLB2_LOG_ERR("Error parsing ldb port cos_id arg, invalid port value");
 		return -EINVAL;
 	}
 
 	if (cos_id < DLB2_COS_0 || cos_id > DLB2_COS_3) {
-		DLB2_LOG_ERR("Error parsing ldb port cos_id devarg, must be between 0 and 4\n");
+		DLB2_LOG_ERR("Error parsing ldb port cos_id devarg, must be between 0 and 4");
 		return -EINVAL;
 	}
 
@@ -487,7 +487,7 @@ set_cos_bw(const char *key __rte_unused,
 	struct dlb2_cos_bw *cos_bw = opaque;
 
 	if (opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -495,11 +495,11 @@ set_cos_bw(const char *key __rte_unused,
 
 	if (sscanf(value, "%d:%d:%d:%d", &cos_bw->val[0], &cos_bw->val[1],
 		   &cos_bw->val[2], &cos_bw->val[3]) != 4) {
-		DLB2_LOG_ERR("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3 where all values combined are <= 100\n");
+		DLB2_LOG_ERR("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3 where all values combined are <= 100");
 		return -EINVAL;
 	}
 	if (cos_bw->val[0] + cos_bw->val[1] + cos_bw->val[2] + cos_bw->val[3] > 100) {
-		DLB2_LOG_ERR("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3  where all values combined are <= 100\n");
+		DLB2_LOG_ERR("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3  where all values combined are <= 100");
 		return -EINVAL;
 	}
 
@@ -515,7 +515,7 @@ set_sw_credit_quanta(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -524,7 +524,7 @@ set_sw_credit_quanta(const char *key __rte_unused,
 		return ret;
 
 	if (*sw_credit_quanta <= 0) {
-		DLB2_LOG_ERR("sw_credit_quanta must be > 0\n");
+		DLB2_LOG_ERR("sw_credit_quanta must be > 0");
 		return -EINVAL;
 	}
 
@@ -540,7 +540,7 @@ set_hw_credit_quanta(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -560,7 +560,7 @@ set_default_depth_thresh(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -579,7 +579,7 @@ set_vector_opts_enab(const char *key __rte_unused,
 	bool *dlb2_vector_opts_enabled = opaque;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -599,7 +599,7 @@ set_default_ldb_port_allocation(const char *key __rte_unused,
 	bool *default_ldb_port_allocation = opaque;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -619,7 +619,7 @@ set_enable_cq_weight(const char *key __rte_unused,
 	bool *enable_cq_weight = opaque;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -640,7 +640,7 @@ set_qid_depth_thresh(const char *key __rte_unused,
 	int first, last, thresh, i;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -657,18 +657,18 @@ set_qid_depth_thresh(const char *key __rte_unused,
 	} else if (sscanf(value, "%d:%d", &first, &thresh) == 2) {
 		last = first;
 	} else {
-		DLB2_LOG_ERR("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val\n");
+		DLB2_LOG_ERR("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val");
 		return -EINVAL;
 	}
 
 	if (first > last || first < 0 ||
 		last >= DLB2_MAX_NUM_QUEUES(DLB2_HW_V2)) {
-		DLB2_LOG_ERR("Error parsing qid depth devarg, invalid qid value\n");
+		DLB2_LOG_ERR("Error parsing qid depth devarg, invalid qid value");
 		return -EINVAL;
 	}
 
 	if (thresh < 0 || thresh > DLB2_MAX_QUEUE_DEPTH_THRESHOLD) {
-		DLB2_LOG_ERR("Error parsing qid depth devarg, threshold > %d\n",
+		DLB2_LOG_ERR("Error parsing qid depth devarg, threshold > %d",
 			     DLB2_MAX_QUEUE_DEPTH_THRESHOLD);
 		return -EINVAL;
 	}
@@ -688,7 +688,7 @@ set_qid_depth_thresh_v2_5(const char *key __rte_unused,
 	int first, last, thresh, i;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -705,18 +705,18 @@ set_qid_depth_thresh_v2_5(const char *key __rte_unused,
 	} else if (sscanf(value, "%d:%d", &first, &thresh) == 2) {
 		last = first;
 	} else {
-		DLB2_LOG_ERR("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val\n");
+		DLB2_LOG_ERR("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val");
 		return -EINVAL;
 	}
 
 	if (first > last || first < 0 ||
 		last >= DLB2_MAX_NUM_QUEUES(DLB2_HW_V2_5)) {
-		DLB2_LOG_ERR("Error parsing qid depth devarg, invalid qid value\n");
+		DLB2_LOG_ERR("Error parsing qid depth devarg, invalid qid value");
 		return -EINVAL;
 	}
 
 	if (thresh < 0 || thresh > DLB2_MAX_QUEUE_DEPTH_THRESHOLD) {
-		DLB2_LOG_ERR("Error parsing qid depth devarg, threshold > %d\n",
+		DLB2_LOG_ERR("Error parsing qid depth devarg, threshold > %d",
 			     DLB2_MAX_QUEUE_DEPTH_THRESHOLD);
 		return -EINVAL;
 	}
@@ -738,7 +738,7 @@ dlb2_eventdev_info_get(struct rte_eventdev *dev,
 	if (ret) {
 		const struct rte_eventdev_data *data = dev->data;
 
-		DLB2_LOG_ERR("get resources err=%d, devid=%d\n",
+		DLB2_LOG_ERR("get resources err=%d, devid=%d",
 			     ret, data->dev_id);
 		/* fn is void, so fall through and return values set up in
 		 * probe
@@ -781,7 +781,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,
 	struct dlb2_create_sched_domain_args *cfg;
 
 	if (resources_asked == NULL) {
-		DLB2_LOG_ERR("dlb2: dlb2_create NULL parameter\n");
+		DLB2_LOG_ERR("dlb2: dlb2_create NULL parameter");
 		ret = EINVAL;
 		goto error_exit;
 	}
@@ -809,7 +809,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,
 
 	if (cos_ports > resources_asked->num_ldb_ports ||
 	    (cos_ports && dlb2->max_cos_port >= resources_asked->num_ldb_ports)) {
-		DLB2_LOG_ERR("dlb2: num_ldb_ports < cos_ports\n");
+		DLB2_LOG_ERR("dlb2: num_ldb_ports < cos_ports");
 		ret = EINVAL;
 		goto error_exit;
 	}
@@ -832,7 +832,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,
 		evdev_dlb2_default_info.max_event_port_dequeue_depth;
 
 	if (device_version == DLB2_HW_V2_5) {
-		DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, credits=%d\n",
+		DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, credits=%d",
 			     cfg->num_ldb_queues,
 			     resources_asked->num_ldb_ports,
 			     cfg->num_dir_ports,
@@ -840,7 +840,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,
 			     cfg->num_hist_list_entries,
 			     cfg->num_credits);
 	} else {
-		DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, ldb_credits=%d, dir_credits=%d\n",
+		DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, ldb_credits=%d, dir_credits=%d",
 			     cfg->num_ldb_queues,
 			     resources_asked->num_ldb_ports,
 			     cfg->num_dir_ports,
@@ -854,7 +854,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,
 
 	ret = dlb2_iface_sched_domain_create(handle, cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: domain create failed, ret = %d, extra status: %s\n",
+		DLB2_LOG_ERR("dlb2: domain create failed, ret = %d, extra status: %s",
 			     ret,
 			     dlb2_error_strings[cfg->response.status]);
 
@@ -930,27 +930,27 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev)
 		dlb2_hw_reset_sched_domain(dev, true);
 		ret = dlb2_hw_query_resources(dlb2);
 		if (ret) {
-			DLB2_LOG_ERR("get resources err=%d, devid=%d\n",
+			DLB2_LOG_ERR("get resources err=%d, devid=%d",
 				     ret, data->dev_id);
 			return ret;
 		}
 	}
 
 	if (config->nb_event_queues > rsrcs->num_queues) {
-		DLB2_LOG_ERR("nb_event_queues parameter (%d) exceeds the QM device's capabilities (%d).\n",
+		DLB2_LOG_ERR("nb_event_queues parameter (%d) exceeds the QM device's capabilities (%d).",
 			     config->nb_event_queues,
 			     rsrcs->num_queues);
 		return -EINVAL;
 	}
 	if (config->nb_event_ports > (rsrcs->num_ldb_ports
 			+ rsrcs->num_dir_ports)) {
-		DLB2_LOG_ERR("nb_event_ports parameter (%d) exceeds the QM device's capabilities (%d).\n",
+		DLB2_LOG_ERR("nb_event_ports parameter (%d) exceeds the QM device's capabilities (%d).",
 			     config->nb_event_ports,
 			     (rsrcs->num_ldb_ports + rsrcs->num_dir_ports));
 		return -EINVAL;
 	}
 	if (config->nb_events_limit > rsrcs->nb_events_limit) {
-		DLB2_LOG_ERR("nb_events_limit parameter (%d) exceeds the QM device's capabilities (%d).\n",
+		DLB2_LOG_ERR("nb_events_limit parameter (%d) exceeds the QM device's capabilities (%d).",
 			     config->nb_events_limit,
 			     rsrcs->nb_events_limit);
 		return -EINVAL;
@@ -1000,7 +1000,7 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev)
 
 	if (dlb2_hw_create_sched_domain(dlb2, handle, rsrcs,
 					dlb2->version) < 0) {
-		DLB2_LOG_ERR("dlb2_hw_create_sched_domain failed\n");
+		DLB2_LOG_ERR("dlb2_hw_create_sched_domain failed");
 		return -ENODEV;
 	}
 
@@ -1068,7 +1068,7 @@ dlb2_get_sn_allocation(struct dlb2_eventdev *dlb2, int group)
 
 	ret = dlb2_iface_get_sn_allocation(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: get_sn_allocation ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: get_sn_allocation ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return ret;
 	}
@@ -1088,7 +1088,7 @@ dlb2_set_sn_allocation(struct dlb2_eventdev *dlb2, int group, int num)
 
 	ret = dlb2_iface_set_sn_allocation(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: set_sn_allocation ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: set_sn_allocation ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return ret;
 	}
@@ -1107,7 +1107,7 @@ dlb2_get_sn_occupancy(struct dlb2_eventdev *dlb2, int group)
 
 	ret = dlb2_iface_get_sn_occupancy(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: get_sn_occupancy ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: get_sn_occupancy ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return ret;
 	}
@@ -1161,7 +1161,7 @@ dlb2_program_sn_allocation(struct dlb2_eventdev *dlb2,
 	}
 
 	if (i == DLB2_NUM_SN_GROUPS) {
-		DLB2_LOG_ERR("[%s()] No groups with %d sequence_numbers are available or have free slots\n",
+		DLB2_LOG_ERR("[%s()] No groups with %d sequence_numbers are available or have free slots",
 		       __func__, sequence_numbers);
 		return;
 	}
@@ -1236,7 +1236,7 @@ dlb2_hw_create_ldb_queue(struct dlb2_eventdev *dlb2,
 
 	ret = dlb2_iface_ldb_queue_create(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: create LB event queue error, ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: create LB event queue error, ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return -EINVAL;
 	}
@@ -1250,7 +1250,7 @@ dlb2_hw_create_ldb_queue(struct dlb2_eventdev *dlb2,
 	queue->sched_type = sched_type;
 	queue->config_state = DLB2_CONFIGURED;
 
-	DLB2_LOG_DBG("Created LB event queue %d, nb_inflights=%d, nb_seq=%d, qid inflights=%d\n",
+	DLB2_LOG_DBG("Created LB event queue %d, nb_inflights=%d, nb_seq=%d, qid inflights=%d",
 		     qm_qid,
 		     cfg.num_atomic_inflights,
 		     cfg.num_sequence_numbers,
@@ -1272,7 +1272,7 @@ dlb2_eventdev_ldb_queue_setup(struct rte_eventdev *dev,
 
 	qm_qid = dlb2_hw_create_ldb_queue(dlb2, ev_queue, queue_conf);
 	if (qm_qid < 0) {
-		DLB2_LOG_ERR("Failed to create the load-balanced queue\n");
+		DLB2_LOG_ERR("Failed to create the load-balanced queue");
 
 		return qm_qid;
 	}
@@ -1380,7 +1380,7 @@ dlb2_init_consume_qe(struct dlb2_port *qm_port, char *mz_name)
 			RTE_CACHE_LINE_SIZE);
 
 	if (qe == NULL)	{
-		DLB2_LOG_ERR("dlb2: no memory for consume_qe\n");
+		DLB2_LOG_ERR("dlb2: no memory for consume_qe");
 		return -ENOMEM;
 	}
 	qm_port->consume_qe = qe;
@@ -1412,7 +1412,7 @@ dlb2_init_int_arm_qe(struct dlb2_port *qm_port, char *mz_name)
 			RTE_CACHE_LINE_SIZE);
 
 	if (qe == NULL) {
-		DLB2_LOG_ERR("dlb2: no memory for complete_qe\n");
+		DLB2_LOG_ERR("dlb2: no memory for complete_qe");
 		return -ENOMEM;
 	}
 	qm_port->int_arm_qe = qe;
@@ -1440,20 +1440,20 @@ dlb2_init_qe_mem(struct dlb2_port *qm_port, char *mz_name)
 	qm_port->qe4 = rte_zmalloc(mz_name, sz, RTE_CACHE_LINE_SIZE);
 
 	if (qm_port->qe4 == NULL) {
-		DLB2_LOG_ERR("dlb2: no qe4 memory\n");
+		DLB2_LOG_ERR("dlb2: no qe4 memory");
 		ret = -ENOMEM;
 		goto error_exit;
 	}
 
 	ret = dlb2_init_int_arm_qe(qm_port, mz_name);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: dlb2_init_int_arm_qe ret=%d\n", ret);
+		DLB2_LOG_ERR("dlb2: dlb2_init_int_arm_qe ret=%d", ret);
 		goto error_exit;
 	}
 
 	ret = dlb2_init_consume_qe(qm_port, mz_name);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: dlb2_init_consume_qe ret=%d\n", ret);
+		DLB2_LOG_ERR("dlb2: dlb2_init_consume_qe ret=%d", ret);
 		goto error_exit;
 	}
 
@@ -1536,14 +1536,14 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
 		return -EINVAL;
 
 	if (dequeue_depth < DLB2_MIN_CQ_DEPTH) {
-		DLB2_LOG_ERR("dlb2: invalid cq depth, must be at least %d\n",
+		DLB2_LOG_ERR("dlb2: invalid cq depth, must be at least %d",
 			     DLB2_MIN_CQ_DEPTH);
 		return -EINVAL;
 	}
 
 	if (dlb2->version == DLB2_HW_V2 && ev_port->cq_weight != 0 &&
 	    ev_port->cq_weight > dequeue_depth) {
-		DLB2_LOG_ERR("dlb2: invalid cq dequeue depth %d, must be >= cq weight %d\n",
+		DLB2_LOG_ERR("dlb2: invalid cq dequeue depth %d, must be >= cq weight %d",
 			     dequeue_depth, ev_port->cq_weight);
 		return -EINVAL;
 	}
@@ -1579,14 +1579,14 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
 
 	ret = dlb2_iface_ldb_port_create(handle, &cfg,  dlb2->poll_mode);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: dlb2_ldb_port_create error, ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: dlb2_ldb_port_create error, ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		goto error_exit;
 	}
 
 	qm_port_id = cfg.response.id;
 
-	DLB2_LOG_DBG("dlb2: ev_port %d uses qm LB port %d <<<<<\n",
+	DLB2_LOG_DBG("dlb2: ev_port %d uses qm LB port %d <<<<<",
 		     ev_port->id, qm_port_id);
 
 	qm_port = &ev_port->qm_port;
@@ -1602,7 +1602,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
 
 	ret = dlb2_init_qe_mem(qm_port, mz_name);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: init_qe_mem failed, ret=%d\n", ret);
+		DLB2_LOG_ERR("dlb2: init_qe_mem failed, ret=%d", ret);
 		goto error_exit;
 	}
 
@@ -1615,7 +1615,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
 		ret = dlb2_iface_enable_cq_weight(handle, &cq_weight_args);
 
 		if (ret < 0) {
-			DLB2_LOG_ERR("dlb2: dlb2_dir_port_create error, ret=%d (driver status: %s)\n",
+			DLB2_LOG_ERR("dlb2: dlb2_dir_port_create error, ret=%d (driver status: %s)",
 					ret,
 					dlb2_error_strings[cfg.response.  status]);
 			goto error_exit;
@@ -1680,7 +1680,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
 		qm_port->credit_pool[DLB2_DIR_QUEUE] = &dlb2->dir_credit_pool;
 		qm_port->credit_pool[DLB2_LDB_QUEUE] = &dlb2->ldb_credit_pool;
 
-		DLB2_LOG_DBG("dlb2: created ldb port %d, depth = %d, ldb credits=%d, dir credits=%d\n",
+		DLB2_LOG_DBG("dlb2: created ldb port %d, depth = %d, ldb credits=%d, dir credits=%d",
 			     qm_port_id,
 			     dequeue_depth,
 			     qm_port->ldb_credits,
@@ -1689,7 +1689,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
 		qm_port->credits = credit_high_watermark;
 		qm_port->credit_pool[DLB2_COMBINED_POOL] = &dlb2->credit_pool;
 
-		DLB2_LOG_DBG("dlb2: created ldb port %d, depth = %d, credits=%d\n",
+		DLB2_LOG_DBG("dlb2: created ldb port %d, depth = %d, credits=%d",
 			     qm_port_id,
 			     dequeue_depth,
 			     qm_port->credits);
@@ -1717,7 +1717,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
 
 	rte_spinlock_unlock(&handle->resource_lock);
 
-	DLB2_LOG_ERR("dlb2: create ldb port failed!\n");
+	DLB2_LOG_ERR("dlb2: create ldb port failed!");
 
 	return ret;
 }
@@ -1761,13 +1761,13 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,
 		return -EINVAL;
 
 	if (dequeue_depth < DLB2_MIN_CQ_DEPTH) {
-		DLB2_LOG_ERR("dlb2: invalid dequeue_depth, must be %d-%d\n",
+		DLB2_LOG_ERR("dlb2: invalid dequeue_depth, must be %d-%d",
 			     DLB2_MIN_CQ_DEPTH, DLB2_MAX_INPUT_QUEUE_DEPTH);
 		return -EINVAL;
 	}
 
 	if (enqueue_depth < DLB2_MIN_ENQUEUE_DEPTH) {
-		DLB2_LOG_ERR("dlb2: invalid enqueue_depth, must be at least %d\n",
+		DLB2_LOG_ERR("dlb2: invalid enqueue_depth, must be at least %d",
 			     DLB2_MIN_ENQUEUE_DEPTH);
 		return -EINVAL;
 	}
@@ -1802,14 +1802,14 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,
 
 	ret = dlb2_iface_dir_port_create(handle, &cfg,  dlb2->poll_mode);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: dlb2_dir_port_create error, ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: dlb2_dir_port_create error, ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		goto error_exit;
 	}
 
 	qm_port_id = cfg.response.id;
 
-	DLB2_LOG_DBG("dlb2: ev_port %d uses qm DIR port %d <<<<<\n",
+	DLB2_LOG_DBG("dlb2: ev_port %d uses qm DIR port %d <<<<<",
 		     ev_port->id, qm_port_id);
 
 	qm_port = &ev_port->qm_port;
@@ -1827,7 +1827,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,
 	ret = dlb2_init_qe_mem(qm_port, mz_name);
 
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: init_qe_mem failed, ret=%d\n", ret);
+		DLB2_LOG_ERR("dlb2: init_qe_mem failed, ret=%d", ret);
 		goto error_exit;
 	}
 
@@ -1881,7 +1881,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,
 		qm_port->credit_pool[DLB2_DIR_QUEUE] = &dlb2->dir_credit_pool;
 		qm_port->credit_pool[DLB2_LDB_QUEUE] = &dlb2->ldb_credit_pool;
 
-		DLB2_LOG_DBG("dlb2: created dir port %d, depth = %d cr=%d,%d\n",
+		DLB2_LOG_DBG("dlb2: created dir port %d, depth = %d cr=%d,%d",
 			     qm_port_id,
 			     dequeue_depth,
 			     dir_credit_high_watermark,
@@ -1890,7 +1890,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,
 		qm_port->credits = credit_high_watermark;
 		qm_port->credit_pool[DLB2_COMBINED_POOL] = &dlb2->credit_pool;
 
-		DLB2_LOG_DBG("dlb2: created dir port %d, depth = %d cr=%d\n",
+		DLB2_LOG_DBG("dlb2: created dir port %d, depth = %d cr=%d",
 			     qm_port_id,
 			     dequeue_depth,
 			     credit_high_watermark);
@@ -1916,7 +1916,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,
 
 	rte_spinlock_unlock(&handle->resource_lock);
 
-	DLB2_LOG_ERR("dlb2: create dir port failed!\n");
+	DLB2_LOG_ERR("dlb2: create dir port failed!");
 
 	return ret;
 }
@@ -1932,7 +1932,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev,
 	int ret;
 
 	if (dev == NULL || port_conf == NULL) {
-		DLB2_LOG_ERR("Null parameter\n");
+		DLB2_LOG_ERR("Null parameter");
 		return -EINVAL;
 	}
 
@@ -1950,7 +1950,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev,
 	ev_port = &dlb2->ev_ports[ev_port_id];
 	/* configured? */
 	if (ev_port->setup_done) {
-		DLB2_LOG_ERR("evport %d is already configured\n", ev_port_id);
+		DLB2_LOG_ERR("evport %d is already configured", ev_port_id);
 		return -EINVAL;
 	}
 
@@ -1982,7 +1982,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev,
 
 	if (port_conf->enqueue_depth > sw_credit_quanta ||
 	    port_conf->enqueue_depth > hw_credit_quanta) {
-		DLB2_LOG_ERR("Invalid port config. Enqueue depth %d must be <= credit quanta %d and batch size %d\n",
+		DLB2_LOG_ERR("Invalid port config. Enqueue depth %d must be <= credit quanta %d and batch size %d",
 			     port_conf->enqueue_depth,
 			     sw_credit_quanta,
 			     hw_credit_quanta);
@@ -2004,7 +2004,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev,
 					      port_conf->dequeue_depth,
 					      port_conf->enqueue_depth);
 		if (ret < 0) {
-			DLB2_LOG_ERR("Failed to create the lB port ve portId=%d\n",
+			DLB2_LOG_ERR("Failed to create the lB port ve portId=%d",
 				     ev_port_id);
 
 			return ret;
@@ -2015,7 +2015,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev,
 					      port_conf->dequeue_depth,
 					      port_conf->enqueue_depth);
 		if (ret < 0) {
-			DLB2_LOG_ERR("Failed to create the DIR port\n");
+			DLB2_LOG_ERR("Failed to create the DIR port");
 			return ret;
 		}
 	}
@@ -2082,14 +2082,14 @@ dlb2_hw_map_ldb_qid_to_port(struct dlb2_hw_dev *handle,
 
 	ret = dlb2_iface_map_qid(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: map qid error, ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: map qid error, ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
-		DLB2_LOG_ERR("dlb2: grp=%d, qm_port=%d, qm_qid=%d prio=%d\n",
+		DLB2_LOG_ERR("dlb2: grp=%d, qm_port=%d, qm_qid=%d prio=%d",
 			     handle->domain_id, cfg.port_id,
 			     cfg.qid,
 			     cfg.priority);
 	} else {
-		DLB2_LOG_DBG("dlb2: mapped queue %d to qm_port %d\n",
+		DLB2_LOG_DBG("dlb2: mapped queue %d to qm_port %d",
 			     qm_qid, qm_port_id);
 	}
 
@@ -2117,7 +2117,7 @@ dlb2_event_queue_join_ldb(struct dlb2_eventdev *dlb2,
 			first_avail = i;
 	}
 	if (first_avail == -1) {
-		DLB2_LOG_ERR("dlb2: qm_port %d has no available QID slots.\n",
+		DLB2_LOG_ERR("dlb2: qm_port %d has no available QID slots.",
 			     ev_port->qm_port.id);
 		return -EINVAL;
 	}
@@ -2154,7 +2154,7 @@ dlb2_hw_create_dir_queue(struct dlb2_eventdev *dlb2,
 
 	ret = dlb2_iface_dir_queue_create(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: create DIR event queue error, ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: create DIR event queue error, ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return -EINVAL;
 	}
@@ -2172,7 +2172,7 @@ dlb2_eventdev_dir_queue_setup(struct dlb2_eventdev *dlb2,
 	qm_qid = dlb2_hw_create_dir_queue(dlb2, ev_queue, ev_port->qm_port.id);
 
 	if (qm_qid < 0) {
-		DLB2_LOG_ERR("Failed to create the DIR queue\n");
+		DLB2_LOG_ERR("Failed to create the DIR queue");
 		return qm_qid;
 	}
 
@@ -2202,7 +2202,7 @@ dlb2_do_port_link(struct rte_eventdev *dev,
 		err = dlb2_event_queue_join_ldb(dlb2, ev_port, ev_queue, prio);
 
 	if (err) {
-		DLB2_LOG_ERR("port link failure for %s ev_q %d, ev_port %d\n",
+		DLB2_LOG_ERR("port link failure for %s ev_q %d, ev_port %d",
 			     ev_queue->qm_queue.is_directed ? "DIR" : "LDB",
 			     ev_queue->id, ev_port->id);
 
@@ -2240,7 +2240,7 @@ dlb2_validate_port_link(struct dlb2_eventdev_port *ev_port,
 	queue_is_dir = ev_queue->qm_queue.is_directed;
 
 	if (port_is_dir != queue_is_dir) {
-		DLB2_LOG_ERR("%s queue %u can't link to %s port %u\n",
+		DLB2_LOG_ERR("%s queue %u can't link to %s port %u",
 			     queue_is_dir ? "DIR" : "LDB", ev_queue->id,
 			     port_is_dir ? "DIR" : "LDB", ev_port->id);
 
@@ -2250,7 +2250,7 @@ dlb2_validate_port_link(struct dlb2_eventdev_port *ev_port,
 
 	/* Check if there is space for the requested link */
 	if (!link_exists && index == -1) {
-		DLB2_LOG_ERR("no space for new link\n");
+		DLB2_LOG_ERR("no space for new link");
 		rte_errno = -ENOSPC;
 		return -1;
 	}
@@ -2258,7 +2258,7 @@ dlb2_validate_port_link(struct dlb2_eventdev_port *ev_port,
 	/* Check if the directed port is already linked */
 	if (ev_port->qm_port.is_directed && ev_port->num_links > 0 &&
 	    !link_exists) {
-		DLB2_LOG_ERR("Can't link DIR port %d to >1 queues\n",
+		DLB2_LOG_ERR("Can't link DIR port %d to >1 queues",
 			     ev_port->id);
 		rte_errno = -EINVAL;
 		return -1;
@@ -2267,7 +2267,7 @@ dlb2_validate_port_link(struct dlb2_eventdev_port *ev_port,
 	/* Check if the directed queue is already linked */
 	if (ev_queue->qm_queue.is_directed && ev_queue->num_links > 0 &&
 	    !link_exists) {
-		DLB2_LOG_ERR("Can't link DIR queue %d to >1 ports\n",
+		DLB2_LOG_ERR("Can't link DIR queue %d to >1 ports",
 			     ev_queue->id);
 		rte_errno = -EINVAL;
 		return -1;
@@ -2289,14 +2289,14 @@ dlb2_eventdev_port_link(struct rte_eventdev *dev, void *event_port,
 	RTE_SET_USED(dev);
 
 	if (ev_port == NULL) {
-		DLB2_LOG_ERR("dlb2: evport not setup\n");
+		DLB2_LOG_ERR("dlb2: evport not setup");
 		rte_errno = -EINVAL;
 		return 0;
 	}
 
 	if (!ev_port->setup_done &&
 	    ev_port->qm_port.config_state != DLB2_PREV_CONFIGURED) {
-		DLB2_LOG_ERR("dlb2: evport not setup\n");
+		DLB2_LOG_ERR("dlb2: evport not setup");
 		rte_errno = -EINVAL;
 		return 0;
 	}
@@ -2305,13 +2305,13 @@ dlb2_eventdev_port_link(struct rte_eventdev *dev, void *event_port,
 	 * queues pointer.
 	 */
 	if (nb_links == 0) {
-		DLB2_LOG_DBG("dlb2: nb_links is 0\n");
+		DLB2_LOG_DBG("dlb2: nb_links is 0");
 		return 0; /* Ignore and return success */
 	}
 
 	dlb2 = ev_port->dlb2;
 
-	DLB2_LOG_DBG("Linking %u queues to %s port %d\n",
+	DLB2_LOG_DBG("Linking %u queues to %s port %d",
 		     nb_links,
 		     ev_port->qm_port.is_directed ? "DIR" : "LDB",
 		     ev_port->id);
@@ -2381,7 +2381,7 @@ dlb2_hw_unmap_ldb_qid_from_port(struct dlb2_hw_dev *handle,
 
 	ret = dlb2_iface_unmap_qid(handle, &cfg);
 	if (ret < 0)
-		DLB2_LOG_ERR("dlb2: unmap qid error, ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: unmap qid error, ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 
 	return ret;
@@ -2408,7 +2408,7 @@ dlb2_event_queue_detach_ldb(struct dlb2_eventdev *dlb2,
 	 * It blindly attempts to unmap all queues.
 	 */
 	if (i == DLB2_MAX_NUM_QIDS_PER_LDB_CQ) {
-		DLB2_LOG_DBG("dlb2: ignoring LB QID %d not mapped for qm_port %d.\n",
+		DLB2_LOG_DBG("dlb2: ignoring LB QID %d not mapped for qm_port %d.",
 			     ev_queue->qm_queue.id,
 			     ev_port->qm_port.id);
 		return 0;
@@ -2434,19 +2434,19 @@ dlb2_eventdev_port_unlink(struct rte_eventdev *dev, void *event_port,
 	RTE_SET_USED(dev);
 
 	if (!ev_port->setup_done) {
-		DLB2_LOG_ERR("dlb2: evport %d is not configured\n",
+		DLB2_LOG_ERR("dlb2: evport %d is not configured",
 			     ev_port->id);
 		rte_errno = -EINVAL;
 		return 0;
 	}
 
 	if (queues == NULL || nb_unlinks == 0) {
-		DLB2_LOG_DBG("dlb2: queues is NULL or nb_unlinks is 0\n");
+		DLB2_LOG_DBG("dlb2: queues is NULL or nb_unlinks is 0");
 		return 0; /* Ignore and return success */
 	}
 
 	if (ev_port->qm_port.is_directed) {
-		DLB2_LOG_DBG("dlb2: ignore unlink from dir port %d\n",
+		DLB2_LOG_DBG("dlb2: ignore unlink from dir port %d",
 			     ev_port->id);
 		rte_errno = 0;
 		return nb_unlinks; /* as if success */
@@ -2459,7 +2459,7 @@ dlb2_eventdev_port_unlink(struct rte_eventdev *dev, void *event_port,
 		int ret, j;
 
 		if (queues[i] >= dlb2->num_queues) {
-			DLB2_LOG_ERR("dlb2: invalid queue id %d\n", queues[i]);
+			DLB2_LOG_ERR("dlb2: invalid queue id %d", queues[i]);
 			rte_errno = -EINVAL;
 			return i; /* return index of offending queue */
 		}
@@ -2477,7 +2477,7 @@ dlb2_eventdev_port_unlink(struct rte_eventdev *dev, void *event_port,
 
 		ret = dlb2_event_queue_detach_ldb(dlb2, ev_port, ev_queue);
 		if (ret) {
-			DLB2_LOG_ERR("unlink err=%d for port %d queue %d\n",
+			DLB2_LOG_ERR("unlink err=%d for port %d queue %d",
 				     ret, ev_port->id, queues[i]);
 			rte_errno = -ENOENT;
 			return i; /* return index of offending queue */
@@ -2504,7 +2504,7 @@ dlb2_eventdev_port_unlinks_in_progress(struct rte_eventdev *dev,
 	RTE_SET_USED(dev);
 
 	if (!ev_port->setup_done) {
-		DLB2_LOG_ERR("dlb2: evport %d is not configured\n",
+		DLB2_LOG_ERR("dlb2: evport %d is not configured",
 			     ev_port->id);
 		rte_errno = -EINVAL;
 		return 0;
@@ -2516,7 +2516,7 @@ dlb2_eventdev_port_unlinks_in_progress(struct rte_eventdev *dev,
 	ret = dlb2_iface_pending_port_unmaps(handle, &cfg);
 
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: num_unlinks_in_progress ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: num_unlinks_in_progress ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return ret;
 	}
@@ -2609,7 +2609,7 @@ dlb2_eventdev_start(struct rte_eventdev *dev)
 
 	rte_spinlock_lock(&dlb2->qm_instance.resource_lock);
 	if (dlb2->run_state != DLB2_RUN_STATE_STOPPED) {
-		DLB2_LOG_ERR("bad state %d for dev_start\n",
+		DLB2_LOG_ERR("bad state %d for dev_start",
 			     (int)dlb2->run_state);
 		rte_spinlock_unlock(&dlb2->qm_instance.resource_lock);
 		return -EINVAL;
@@ -2645,13 +2645,13 @@ dlb2_eventdev_start(struct rte_eventdev *dev)
 
 	ret = dlb2_iface_sched_domain_start(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: sched_domain_start ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: sched_domain_start ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return ret;
 	}
 
 	dlb2->run_state = DLB2_RUN_STATE_STARTED;
-	DLB2_LOG_DBG("dlb2: sched_domain_start completed OK\n");
+	DLB2_LOG_DBG("dlb2: sched_domain_start completed OK");
 
 	return 0;
 }
@@ -2746,7 +2746,7 @@ dlb2_check_enqueue_hw_ldb_credits(struct dlb2_port *qm_port)
 			DLB2_INC_STAT(
 			qm_port->ev_port->stats.traffic.tx_nospc_ldb_hw_credits,
 			1);
-			DLB2_LOG_DBG("ldb credits exhausted\n");
+			DLB2_LOG_DBG("ldb credits exhausted");
 			return 1; /* credits exhausted */
 		}
 	}
@@ -2765,7 +2765,7 @@ dlb2_check_enqueue_hw_dir_credits(struct dlb2_port *qm_port)
 			DLB2_INC_STAT(
 			qm_port->ev_port->stats.traffic.tx_nospc_dir_hw_credits,
 			1);
-			DLB2_LOG_DBG("dir credits exhausted\n");
+			DLB2_LOG_DBG("dir credits exhausted");
 			return 1; /* credits exhausted */
 		}
 	}
@@ -2783,7 +2783,7 @@ dlb2_check_enqueue_hw_credits(struct dlb2_port *qm_port)
 		if (unlikely(qm_port->cached_credits == 0)) {
 			DLB2_INC_STAT(
 			qm_port->ev_port->stats.traffic.tx_nospc_hw_credits, 1);
-			DLB2_LOG_DBG("credits exhausted\n");
+			DLB2_LOG_DBG("credits exhausted");
 			return 1; /* credits exhausted */
 		}
 	}
@@ -2817,7 +2817,7 @@ dlb2_consume_qe_immediate(struct dlb2_port *qm_port, int num)
 
 	dlb2_movntdq_single(port_data->pp_addr, qe);
 
-	DLB2_LOG_DBG("dlb2: consume immediate - %d QEs\n", num);
+	DLB2_LOG_DBG("dlb2: consume immediate - %d QEs", num);
 
 	qm_port->owed_tokens = 0;
 
@@ -2888,9 +2888,9 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port,
 		}
 		switch (ev->sched_type) {
 		case RTE_SCHED_TYPE_ORDERED:
-			DLB2_LOG_DBG("dlb2: put_qe: RTE_SCHED_TYPE_ORDERED\n");
+			DLB2_LOG_DBG("dlb2: put_qe: RTE_SCHED_TYPE_ORDERED");
 			if (qm_queue->sched_type != RTE_SCHED_TYPE_ORDERED) {
-				DLB2_LOG_ERR("dlb2: tried to send ordered event to unordered queue %d\n",
+				DLB2_LOG_ERR("dlb2: tried to send ordered event to unordered queue %d",
 					     *queue_id);
 				rte_errno = -EINVAL;
 				return 1;
@@ -2898,18 +2898,18 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port,
 			*sched_type = DLB2_SCHED_ORDERED;
 			break;
 		case RTE_SCHED_TYPE_ATOMIC:
-			DLB2_LOG_DBG("dlb2: put_qe: RTE_SCHED_TYPE_ATOMIC\n");
+			DLB2_LOG_DBG("dlb2: put_qe: RTE_SCHED_TYPE_ATOMIC");
 			*sched_type = DLB2_SCHED_ATOMIC;
 			break;
 		case RTE_SCHED_TYPE_PARALLEL:
-			DLB2_LOG_DBG("dlb2: put_qe: RTE_SCHED_TYPE_PARALLEL\n");
+			DLB2_LOG_DBG("dlb2: put_qe: RTE_SCHED_TYPE_PARALLEL");
 			if (qm_queue->sched_type == RTE_SCHED_TYPE_ORDERED)
 				*sched_type = DLB2_SCHED_ORDERED;
 			else
 				*sched_type = DLB2_SCHED_UNORDERED;
 			break;
 		default:
-			DLB2_LOG_ERR("Unsupported LDB sched type in put_qe\n");
+			DLB2_LOG_ERR("Unsupported LDB sched type in put_qe");
 			DLB2_INC_STAT(ev_port->stats.tx_invalid, 1);
 			rte_errno = -EINVAL;
 			return 1;
@@ -2930,7 +2930,7 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port,
 			}
 			cached_credits = &qm_port->cached_credits;
 		}
-		DLB2_LOG_DBG("dlb2: put_qe: RTE_SCHED_TYPE_DIRECTED\n");
+		DLB2_LOG_DBG("dlb2: put_qe: RTE_SCHED_TYPE_DIRECTED");
 
 		*sched_type = DLB2_SCHED_DIRECTED;
 	}
@@ -3156,7 +3156,7 @@ dlb2_event_release(struct dlb2_eventdev *dlb2,
 	int i;
 
 	if (port_id > dlb2->num_ports) {
-		DLB2_LOG_ERR("Invalid port id %d in dlb2-event_release\n",
+		DLB2_LOG_ERR("Invalid port id %d in dlb2-event_release",
 			     port_id);
 		rte_errno = -EINVAL;
 		return;
@@ -3213,7 +3213,7 @@ dlb2_event_release(struct dlb2_eventdev *dlb2,
 sw_credit_update:
 	/* each release returns one credit */
 	if (unlikely(!ev_port->outstanding_releases)) {
-		DLB2_LOG_ERR("%s: Outstanding releases underflowed.\n",
+		DLB2_LOG_ERR("%s: Outstanding releases underflowed.",
 			     __func__);
 		return;
 	}
@@ -3367,7 +3367,7 @@ dlb2_process_dequeue_qes(struct dlb2_eventdev_port *ev_port,
 		 * buffer is a mbuf.
 		 */
 		if (unlikely(qe->error)) {
-			DLB2_LOG_ERR("QE error bit ON\n");
+			DLB2_LOG_ERR("QE error bit ON");
 			DLB2_INC_STAT(ev_port->stats.traffic.rx_drop, 1);
 			dlb2_consume_qe_immediate(qm_port, 1);
 			continue; /* Ignore */
@@ -4281,7 +4281,7 @@ dlb2_get_ldb_queue_depth(struct dlb2_eventdev *dlb2,
 
 	ret = dlb2_iface_get_ldb_queue_depth(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: get_ldb_queue_depth ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: get_ldb_queue_depth ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return ret;
 	}
@@ -4301,7 +4301,7 @@ dlb2_get_dir_queue_depth(struct dlb2_eventdev *dlb2,
 
 	ret = dlb2_iface_get_dir_queue_depth(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: get_dir_queue_depth ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: get_dir_queue_depth ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return ret;
 	}
@@ -4392,7 +4392,7 @@ dlb2_drain(struct rte_eventdev *dev)
 	}
 
 	if (i == dlb2->num_ports) {
-		DLB2_LOG_ERR("internal error: no LDB ev_ports\n");
+		DLB2_LOG_ERR("internal error: no LDB ev_ports");
 		return;
 	}
 
@@ -4400,7 +4400,7 @@ dlb2_drain(struct rte_eventdev *dev)
 	rte_event_port_unlink(dev_id, ev_port->id, NULL, 0);
 
 	if (rte_errno) {
-		DLB2_LOG_ERR("internal error: failed to unlink ev_port %d\n",
+		DLB2_LOG_ERR("internal error: failed to unlink ev_port %d",
 			     ev_port->id);
 		return;
 	}
@@ -4418,7 +4418,7 @@ dlb2_drain(struct rte_eventdev *dev)
 		/* Link the ev_port to the queue */
 		ret = rte_event_port_link(dev_id, ev_port->id, &qid, &prio, 1);
 		if (ret != 1) {
-			DLB2_LOG_ERR("internal error: failed to link ev_port %d to queue %d\n",
+			DLB2_LOG_ERR("internal error: failed to link ev_port %d to queue %d",
 				     ev_port->id, qid);
 			return;
 		}
@@ -4433,7 +4433,7 @@ dlb2_drain(struct rte_eventdev *dev)
 		/* Unlink the ev_port from the queue */
 		ret = rte_event_port_unlink(dev_id, ev_port->id, &qid, 1);
 		if (ret != 1) {
-			DLB2_LOG_ERR("internal error: failed to unlink ev_port %d to queue %d\n",
+			DLB2_LOG_ERR("internal error: failed to unlink ev_port %d to queue %d",
 				     ev_port->id, qid);
 			return;
 		}
@@ -4448,11 +4448,11 @@ dlb2_eventdev_stop(struct rte_eventdev *dev)
 	rte_spinlock_lock(&dlb2->qm_instance.resource_lock);
 
 	if (dlb2->run_state == DLB2_RUN_STATE_STOPPED) {
-		DLB2_LOG_DBG("Internal error: already stopped\n");
+		DLB2_LOG_DBG("Internal error: already stopped");
 		rte_spinlock_unlock(&dlb2->qm_instance.resource_lock);
 		return;
 	} else if (dlb2->run_state != DLB2_RUN_STATE_STARTED) {
-		DLB2_LOG_ERR("Internal error: bad state %d for dev_stop\n",
+		DLB2_LOG_ERR("Internal error: bad state %d for dev_stop",
 			     (int)dlb2->run_state);
 		rte_spinlock_unlock(&dlb2->qm_instance.resource_lock);
 		return;
@@ -4608,7 +4608,7 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev,
 
 	err = dlb2_iface_open(&dlb2->qm_instance, name);
 	if (err < 0) {
-		DLB2_LOG_ERR("could not open event hardware device, err=%d\n",
+		DLB2_LOG_ERR("could not open event hardware device, err=%d",
 			     err);
 		return err;
 	}
@@ -4616,14 +4616,14 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev,
 	err = dlb2_iface_get_device_version(&dlb2->qm_instance,
 					    &dlb2->revision);
 	if (err < 0) {
-		DLB2_LOG_ERR("dlb2: failed to get the device version, err=%d\n",
+		DLB2_LOG_ERR("dlb2: failed to get the device version, err=%d",
 			     err);
 		return err;
 	}
 
 	err = dlb2_hw_query_resources(dlb2);
 	if (err) {
-		DLB2_LOG_ERR("get resources err=%d for %s\n",
+		DLB2_LOG_ERR("get resources err=%d for %s",
 			     err, name);
 		return err;
 	}
@@ -4646,7 +4646,7 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev,
 				break;
 		}
 		if (ret) {
-			DLB2_LOG_ERR("dlb2: failed to configure class of service, err=%d\n",
+			DLB2_LOG_ERR("dlb2: failed to configure class of service, err=%d",
 				     err);
 			return err;
 		}
@@ -4654,7 +4654,7 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev,
 
 	err = dlb2_iface_get_cq_poll_mode(&dlb2->qm_instance, &dlb2->poll_mode);
 	if (err < 0) {
-		DLB2_LOG_ERR("dlb2: failed to get the poll mode, err=%d\n",
+		DLB2_LOG_ERR("dlb2: failed to get the poll mode, err=%d",
 			     err);
 		return err;
 	}
@@ -4662,7 +4662,7 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev,
 	/* Complete xtstats runtime initialization */
 	err = dlb2_xstats_init(dlb2);
 	if (err) {
-		DLB2_LOG_ERR("dlb2: failed to init xstats, err=%d\n", err);
+		DLB2_LOG_ERR("dlb2: failed to init xstats, err=%d", err);
 		return err;
 	}
 
@@ -4692,14 +4692,14 @@ dlb2_secondary_eventdev_probe(struct rte_eventdev *dev,
 
 	err = dlb2_iface_open(&dlb2->qm_instance, name);
 	if (err < 0) {
-		DLB2_LOG_ERR("could not open event hardware device, err=%d\n",
+		DLB2_LOG_ERR("could not open event hardware device, err=%d",
 			     err);
 		return err;
 	}
 
 	err = dlb2_hw_query_resources(dlb2);
 	if (err) {
-		DLB2_LOG_ERR("get resources err=%d for %s\n",
+		DLB2_LOG_ERR("get resources err=%d for %s",
 			     err, name);
 		return err;
 	}
@@ -4741,9 +4741,8 @@ dlb2_parse_params(const char *params,
 		struct rte_kvargs *kvlist = rte_kvargs_parse(params, args);
 
 		if (kvlist == NULL) {
-			RTE_LOG(INFO, PMD,
-				"Ignoring unsupported parameters when creating device '%s'\n",
-				name);
+			DLB2_LOG_INFO("Ignoring unsupported parameters when creating device '%s'",
+				      name);
 		} else {
 			int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG,
 						     set_numa_node,
-- 
2.43.0


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

* [PATCH v5 14/18] event/dpaa, event/dpaa2: use dedicated logtype
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (12 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 13/18] event/dlb2: " Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 15/18] event/skeleton: replace logtype PMD with dynamic type Stephen Hemminger
                     ` (4 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena, Akhil Goyal

Do not use RTE_LOGTYPE_PMD.

Fixes: b0f66a68ca74 ("event/dpaa: support crypto adapter")
Fixes: 4ab57b042e7c ("event/dpaa2: affine portal at runtime during I/O")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/dpaa/dpaa_eventdev.c            | 2 +-
 drivers/event/dpaa2/dpaa2_eventdev.c          | 4 ++--
 drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
index 46a9b88c73ae..a8e5c3421df1 100644
--- a/drivers/event/dpaa/dpaa_eventdev.c
+++ b/drivers/event/dpaa/dpaa_eventdev.c
@@ -1025,7 +1025,7 @@ dpaa_event_dev_create(const char *name, const char *params, struct rte_vdev_devi
 	eventdev->txa_enqueue = dpaa_eventdev_txa_enqueue;
 	eventdev->txa_enqueue_same_dest	= dpaa_eventdev_txa_enqueue_same_dest;
 
-	RTE_LOG(INFO, PMD, "%s eventdev added", name);
+	DPAA_EVENTDEV_INFO("%s eventdev added", name);
 
 	/* For secondary processes, the primary has done all the work */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index dd4e64395fe5..85c2dbd998dd 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -1141,7 +1141,7 @@ dpaa2_eventdev_create(const char *name, struct rte_vdev_device *vdev)
 		priv->max_event_queues++;
 	} while (dpcon_dev && dpci_dev);
 
-	RTE_LOG(INFO, PMD, "%s eventdev created\n", name);
+	DPAA2_EVENTDEV_INFO("%s eventdev created", name);
 
 done:
 	event_dev_probing_finish(eventdev);
@@ -1178,7 +1178,7 @@ dpaa2_eventdev_destroy(const char *name)
 	}
 	priv->max_event_queues = 0;
 
-	RTE_LOG(INFO, PMD, "%s eventdev cleaned\n", name);
+	DPAA2_EVENTDEV_INFO("%s eventdev cleaned", name);
 	return 0;
 }
 
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
index 427aff4b1111..9d4938efe6aa 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
@@ -774,15 +774,15 @@ static void dpaa2_test_run(int (*setup)(void), void (*tdown)(void),
 		int (*test)(void), const char *name)
 {
 	if (setup() < 0) {
-		RTE_LOG(INFO, PMD, "Error setting up test %s", name);
+		DPAA2_EVENTDEV_INFO("Error setting up test %s", name);
 		unsupported++;
 	} else {
 		if (test() < 0) {
 			failed++;
-			RTE_LOG(INFO, PMD, "%s Failed\n", name);
+			DPAA2_EVENTDEV_INFO("%s Failed", name);
 		} else {
 			passed++;
-			RTE_LOG(INFO, PMD, "%s Passed", name);
+			DPAA2_EVENTDEV_INFO("%s Passed", name);
 		}
 	}
 
-- 
2.43.0


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

* [PATCH v5 15/18] event/skeleton: replace logtype PMD with dynamic type
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (13 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 14/18] event/dpaa, event/dpaa2: " Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 16/18] net/nfb: use dynamic logtype Stephen Hemminger
                     ` (3 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Jerin Jacob

The skeleton is supposed to match current best practices.
Change it to use dynamic logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/skeleton/skeleton_eventdev.c | 4 ++--
 drivers/event/skeleton/skeleton_eventdev.h | 8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c
index 7df032b7daa1..848b3be82c40 100644
--- a/drivers/event/skeleton/skeleton_eventdev.c
+++ b/drivers/event/skeleton/skeleton_eventdev.c
@@ -457,8 +457,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)
 	const char *name;
 
 	name = rte_vdev_device_name(vdev);
-	RTE_LOG(INFO, PMD, "Initializing %s on NUMA node %d\n", name,
-			rte_socket_id());
+	PMD_DRV_LOG(INFO, "Initializing %s on NUMA node %d", name, rte_socket_id());
 	return skeleton_eventdev_create(name, rte_socket_id(), vdev);
 }
 
@@ -479,3 +478,4 @@ static struct rte_vdev_driver vdev_eventdev_skeleton_pmd = {
 };
 
 RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_SKELETON_PMD, vdev_eventdev_skeleton_pmd);
+RTE_LOG_REGISTER_DEFAULT(skeleton_eventdev_logtype, INFO);
diff --git a/drivers/event/skeleton/skeleton_eventdev.h b/drivers/event/skeleton/skeleton_eventdev.h
index 9193f45f4782..9c1ed4ec5755 100644
--- a/drivers/event/skeleton/skeleton_eventdev.h
+++ b/drivers/event/skeleton/skeleton_eventdev.h
@@ -8,9 +8,12 @@
 #include <eventdev_pmd_pci.h>
 #include <eventdev_pmd_vdev.h>
 
+extern int skeleton_eventdev_logtype;
+
 #ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG
 #define PMD_DRV_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ ## level, skeleton_eventdev_logtype, \
+		"%s(): " fmt "\n", __func__, ## args)
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
 #else
 #define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
@@ -18,7 +21,8 @@
 #endif
 
 #define PMD_DRV_ERR(fmt, args...) \
-	RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args)
+	rte_log(RTE_LOG_ERR, skeleton_eventdev_logtype, \
+		"%s(): " fmt "\n", __func__, ## args)
 
 struct skeleton_eventdev {
 	uintptr_t reg_base;
-- 
2.43.0


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

* [PATCH v5 16/18] net/nfb: use dynamic logtype
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (14 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 15/18] event/skeleton: replace logtype PMD with dynamic type Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 17/18] examples/fips_validation: replace use of PMD logtype Stephen Hemminger
                     ` (2 subsequent siblings)
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Martin Spinler, Rastislav Cernay

All drivers should be using dynamic logtype.

Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/nfb/nfb.h        |  5 +++++
 drivers/net/nfb/nfb_ethdev.c | 24 ++++++++++--------------
 drivers/net/nfb/nfb_rx.c     |  9 ++++-----
 drivers/net/nfb/nfb_rx.h     |  2 +-
 drivers/net/nfb/nfb_tx.c     |  9 ++++-----
 drivers/net/nfb/nfb_tx.h     |  2 +-
 6 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/net/nfb/nfb.h b/drivers/net/nfb/nfb.h
index 7dc5bd29e44c..45226ee3d938 100644
--- a/drivers/net/nfb/nfb.h
+++ b/drivers/net/nfb/nfb.h
@@ -12,6 +12,11 @@
 #include <netcope/rxmac.h>
 #include <netcope/txmac.h>
 
+extern int nfb_logtype;
+#define NFB_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, nfb_logtype, "%s(): " fmt "\n", \
+		__func__, ## args)
+
 #include "nfb_rx.h"
 #include "nfb_tx.h"
 
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index defd118bd0ee..e533144efe5d 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -12,11 +12,9 @@
 #include <ethdev_pci.h>
 #include <rte_kvargs.h>
 
+#include "nfb.h"
 #include "nfb_stats.h"
-#include "nfb_rx.h"
-#include "nfb_tx.h"
 #include "nfb_rxmode.h"
-#include "nfb.h"
 
 /**
  * Default MAC addr
@@ -192,8 +190,7 @@ nfb_eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
 				(&nfb_timestamp_dynfield_offset,
 				&nfb_timestamp_rx_dynflag);
 		if (ret != 0) {
-			RTE_LOG(ERR, PMD, "Cannot register Rx timestamp"
-					" field/flag %d\n", ret);
+			NFB_LOG(ERR, "Cannot register Rx timestamp field/flag %d", ret);
 			nfb_close(internals->nfb);
 			return -rte_errno;
 		}
@@ -520,7 +517,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 	struct rte_ether_addr eth_addr_init;
 	struct rte_kvargs *kvlist;
 
-	RTE_LOG(INFO, PMD, "Initializing NFB device (" PCI_PRI_FMT ")\n",
+	NFB_LOG(INFO, "Initializing NFB device (" PCI_PRI_FMT ")",
 		pci_addr->domain, pci_addr->bus, pci_addr->devid,
 		pci_addr->function);
 
@@ -536,7 +533,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 		kvlist = rte_kvargs_parse(dev->device->devargs->args,
 						VALID_KEYS);
 		if (kvlist == NULL) {
-			RTE_LOG(ERR, PMD, "Failed to parse device arguments %s",
+			NFB_LOG(ERR, "Failed to parse device arguments %s",
 				dev->device->devargs->args);
 			rte_kvargs_free(kvlist);
 			return -EINVAL;
@@ -551,14 +548,14 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 	 */
 	internals->nfb = nfb_open(internals->nfb_dev);
 	if (internals->nfb == NULL) {
-		RTE_LOG(ERR, PMD, "nfb_open(): failed to open %s",
+		NFB_LOG(ERR, "nfb_open(): failed to open %s",
 			internals->nfb_dev);
 		return -EINVAL;
 	}
 	data->nb_rx_queues = ndp_get_rx_queue_available_count(internals->nfb);
 	data->nb_tx_queues = ndp_get_tx_queue_available_count(internals->nfb);
 
-	RTE_LOG(INFO, PMD, "Available NDP queues RX: %u TX: %u\n",
+	NFB_LOG(INFO, "Available NDP queues RX: %u TX: %u\n",
 		data->nb_rx_queues, data->nb_tx_queues);
 
 	nfb_nc_rxmac_init(internals->nfb,
@@ -583,7 +580,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 	data->mac_addrs = rte_zmalloc(data->name,
 		sizeof(struct rte_ether_addr) * mac_count, RTE_CACHE_LINE_SIZE);
 	if (data->mac_addrs == NULL) {
-		RTE_LOG(ERR, PMD, "Could not alloc space for MAC address!\n");
+		NFB_LOG(ERR, "Could not alloc space for MAC address");
 		nfb_close(internals->nfb);
 		return -EINVAL;
 	}
@@ -601,8 +598,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 
 	dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 
-	RTE_LOG(INFO, PMD, "NFB device ("
-		PCI_PRI_FMT ") successfully initialized\n",
+	NFB_LOG(INFO, "NFB device (" PCI_PRI_FMT ") successfully initialized",
 		pci_addr->domain, pci_addr->bus, pci_addr->devid,
 		pci_addr->function);
 
@@ -626,8 +622,7 @@ nfb_eth_dev_uninit(struct rte_eth_dev *dev)
 
 	nfb_eth_dev_close(dev);
 
-	RTE_LOG(INFO, PMD, "NFB device ("
-		PCI_PRI_FMT ") successfully uninitialized\n",
+	NFB_LOG(INFO, "NFB device (" PCI_PRI_FMT ") successfully uninitialized",
 		pci_addr->domain, pci_addr->bus, pci_addr->devid,
 		pci_addr->function);
 
@@ -690,3 +685,4 @@ static struct rte_pci_driver nfb_eth_driver = {
 RTE_PMD_REGISTER_PCI(RTE_NFB_DRIVER_NAME, nfb_eth_driver);
 RTE_PMD_REGISTER_PCI_TABLE(RTE_NFB_DRIVER_NAME, nfb_pci_id_table);
 RTE_PMD_REGISTER_KMOD_DEP(RTE_NFB_DRIVER_NAME, "* nfb");
+RTE_LOG_REGISTER_DEFAULT(nfb_logtype, NOTICE);
diff --git a/drivers/net/nfb/nfb_rx.c b/drivers/net/nfb/nfb_rx.c
index 8a9b232305f2..a20f7b9b4b41 100644
--- a/drivers/net/nfb/nfb_rx.c
+++ b/drivers/net/nfb/nfb_rx.c
@@ -6,7 +6,6 @@
 
 #include <rte_kvargs.h>
 
-#include "nfb_rx.h"
 #include "nfb.h"
 
 uint64_t nfb_timestamp_rx_dynflag;
@@ -19,7 +18,7 @@ nfb_eth_rx_queue_start(struct rte_eth_dev *dev, uint16_t rxq_id)
 	int ret;
 
 	if (rxq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "RX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -40,7 +39,7 @@ nfb_eth_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rxq_id)
 	int ret;
 
 	if (rxq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "RX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -70,8 +69,8 @@ nfb_eth_rx_queue_setup(struct rte_eth_dev *dev,
 			RTE_CACHE_LINE_SIZE, socket_id);
 
 	if (rxq == NULL) {
-		RTE_LOG(ERR, PMD, "rte_zmalloc_socket() failed for rx queue id "
-				"%" PRIu16 "!\n", rx_queue_id);
+		NFB_LOG(ERR, "rte_zmalloc_socket() failed for rx queue id %" PRIu16,
+			rx_queue_id);
 		return -ENOMEM;
 	}
 
diff --git a/drivers/net/nfb/nfb_rx.h b/drivers/net/nfb/nfb_rx.h
index b618682e1393..2802f17091a0 100644
--- a/drivers/net/nfb/nfb_rx.h
+++ b/drivers/net/nfb/nfb_rx.h
@@ -156,7 +156,7 @@ nfb_eth_ndp_rx(void *queue,
 	struct rte_mbuf *mbufs[nb_pkts];
 
 	if (unlikely(ndp->queue == NULL || nb_pkts == 0)) {
-		RTE_LOG(ERR, PMD, "RX invalid arguments!\n");
+		NFB_LOG(ERR, "RX invalid arguments");
 		return 0;
 	}
 
diff --git a/drivers/net/nfb/nfb_tx.c b/drivers/net/nfb/nfb_tx.c
index d49fc324e76b..0cc2f596301a 100644
--- a/drivers/net/nfb/nfb_tx.c
+++ b/drivers/net/nfb/nfb_tx.c
@@ -4,7 +4,6 @@
  * All rights reserved.
  */
 
-#include "nfb_tx.h"
 #include "nfb.h"
 
 int
@@ -14,7 +13,7 @@ nfb_eth_tx_queue_start(struct rte_eth_dev *dev, uint16_t txq_id)
 	int ret;
 
 	if (txq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "RX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -35,7 +34,7 @@ nfb_eth_tx_queue_stop(struct rte_eth_dev *dev, uint16_t txq_id)
 	int ret;
 
 	if (txq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "TX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "TX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -62,8 +61,8 @@ nfb_eth_tx_queue_setup(struct rte_eth_dev *dev,
 		RTE_CACHE_LINE_SIZE, socket_id);
 
 	if (txq == NULL) {
-		RTE_LOG(ERR, PMD, "rte_zmalloc_socket() failed for tx queue id "
-			"%" PRIu16 "!\n", tx_queue_id);
+		NFB_LOG(ERR, "rte_zmalloc_socket() failed for tx queue id %" PRIu16,
+			tx_queue_id);
 		return -ENOMEM;
 	}
 
diff --git a/drivers/net/nfb/nfb_tx.h b/drivers/net/nfb/nfb_tx.h
index 910020e9e96f..f107cf914bbd 100644
--- a/drivers/net/nfb/nfb_tx.h
+++ b/drivers/net/nfb/nfb_tx.h
@@ -140,7 +140,7 @@ nfb_eth_ndp_tx(void *queue,
 		return 0;
 
 	if (unlikely(ndp->queue == NULL)) {
-		RTE_LOG(ERR, PMD, "TX invalid arguments!\n");
+		NFB_LOG(ERR, "TX invalid arguments");
 		return 0;
 	}
 
-- 
2.43.0


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

* [PATCH v5 17/18] examples/fips_validation: replace use of PMD logtype
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (15 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 16/18] net/nfb: use dynamic logtype Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-21 16:46   ` [PATCH v5 18/18] log: mark PMD logtype as deprecated Stephen Hemminger
  2023-12-22 12:50   ` [PATCH v5 00/18] Replace uses of PMD logtype David Marchand
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Brian Dooley, Gowrishankar Muthukrishnan,
	Damian Nowak, Fan Zhang

Replace PMD with USER1 since that is already used in main

Fixes: 41d561cbdd24 ("examples/fips_validation: add power on self test")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/fips_validation/fips_dev_self_test.c | 44 +++++++++----------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/examples/fips_validation/fips_dev_self_test.c b/examples/fips_validation/fips_dev_self_test.c
index b17f664a5eda..667f5da4e7d9 100644
--- a/examples/fips_validation/fips_dev_self_test.c
+++ b/examples/fips_validation/fips_dev_self_test.c
@@ -1032,7 +1032,7 @@ prepare_cipher_xform(uint8_t dev_id,
 
 	cap = rte_cryptodev_sym_capability_get(dev_id, &cap_idx);
 	if (!cap) {
-		RTE_LOG(ERR, PMD, "Failed to get capability for cdev %u\n",
+		RTE_LOG(ERR, USER1, "Failed to get capability for cdev %u\n",
 				dev_id);
 		return -EACCES;
 	}
@@ -1040,7 +1040,7 @@ prepare_cipher_xform(uint8_t dev_id,
 	if (rte_cryptodev_sym_capability_check_cipher(cap,
 			cipher_xform->key.length,
 			cipher_xform->iv.length) != 0) {
-		RTE_LOG(ERR, PMD, "PMD %s key length %u IV length %u\n",
+		RTE_LOG(ERR, USER1, "PMD %s key length %u IV length %u\n",
 				rte_cryptodev_name_get(dev_id),
 				cipher_xform->key.length,
 				cipher_xform->iv.length);
@@ -1088,7 +1088,7 @@ prepare_auth_xform(uint8_t dev_id,
 
 	cap = rte_cryptodev_sym_capability_get(dev_id, &cap_idx);
 	if (!cap) {
-		RTE_LOG(ERR, PMD, "Failed to get capability for cdev %u\n",
+		RTE_LOG(ERR, USER1, "Failed to get capability for cdev %u\n",
 				dev_id);
 		return -EACCES;
 	}
@@ -1096,7 +1096,7 @@ prepare_auth_xform(uint8_t dev_id,
 	if (rte_cryptodev_sym_capability_check_auth(cap,
 			auth_xform->key.length,
 			auth_xform->digest_length, 0) != 0) {
-		RTE_LOG(ERR, PMD, "PMD %s key length %u Digest length %u\n",
+		RTE_LOG(ERR, USER1, "PMD %s key length %u Digest length %u\n",
 				rte_cryptodev_name_get(dev_id),
 				auth_xform->key.length,
 				auth_xform->digest_length);
@@ -1147,7 +1147,7 @@ prepare_aead_xform(uint8_t dev_id,
 
 	cap = rte_cryptodev_sym_capability_get(dev_id, &cap_idx);
 	if (!cap) {
-		RTE_LOG(ERR, PMD, "Failed to get capability for cdev %u\n",
+		RTE_LOG(ERR, USER1, "Failed to get capability for cdev %u\n",
 				dev_id);
 		return -EACCES;
 	}
@@ -1156,7 +1156,7 @@ prepare_aead_xform(uint8_t dev_id,
 			aead_xform->key.length,
 			aead_xform->digest_length, aead_xform->aad_length,
 			aead_xform->iv.length) != 0) {
-		RTE_LOG(ERR, PMD,
+		RTE_LOG(ERR, USER1,
 			"PMD %s key_len %u tag_len %u aad_len %u iv_len %u\n",
 				rte_cryptodev_name_get(dev_id),
 				aead_xform->key.length,
@@ -1195,7 +1195,7 @@ prepare_cipher_op(struct rte_crypto_op *op,
 
 	dst = (uint8_t *)rte_pktmbuf_append(mbuf, len);
 	if (!dst) {
-		RTE_LOG(ERR, PMD, "Error %i: MBUF too small\n", -ENOMEM);
+		RTE_LOG(ERR, USER1, "Error %i: MBUF too small\n", -ENOMEM);
 		return -ENOMEM;
 	}
 
@@ -1219,7 +1219,7 @@ prepare_auth_op(struct rte_crypto_op *op,
 	uint8_t *dst;
 
 	if (vec->input.len + vec->digest.len > RTE_MBUF_MAX_NB_SEGS) {
-		RTE_LOG(ERR, PMD, "Error %i: Test data too long (%u).\n",
+		RTE_LOG(ERR, USER1, "Error %i: Test data too long (%u).\n",
 				-ENOMEM, vec->input.len + vec->digest.len);
 		return -ENOMEM;
 	}
@@ -1229,7 +1229,7 @@ prepare_auth_op(struct rte_crypto_op *op,
 	dst = (uint8_t *)rte_pktmbuf_append(mbuf, vec->input.len +
 			vec->digest.len);
 	if (!dst) {
-		RTE_LOG(ERR, PMD, "Error %i: MBUF too small\n", -ENOMEM);
+		RTE_LOG(ERR, USER1, "Error %i: MBUF too small\n", -ENOMEM);
 		return -ENOMEM;
 	}
 
@@ -1274,7 +1274,7 @@ prepare_aead_op(struct rte_crypto_op *op,
 		memcpy(iv, vec->iv.data, vec->iv.len);
 
 	if (len + vec->digest.len > RTE_MBUF_MAX_NB_SEGS) {
-		RTE_LOG(ERR, PMD, "Error %i: Test data too long (%u).\n",
+		RTE_LOG(ERR, USER1, "Error %i: Test data too long (%u).\n",
 				-ENOMEM, len + vec->digest.len);
 		return -ENOMEM;
 	}
@@ -1282,7 +1282,7 @@ prepare_aead_op(struct rte_crypto_op *op,
 	dst = (uint8_t *)rte_pktmbuf_append(mbuf, RTE_ALIGN_CEIL(len +
 			vec->digest.len, 16));
 	if (!dst) {
-		RTE_LOG(ERR, PMD, "Error %i: MBUF too small\n", -ENOMEM);
+		RTE_LOG(ERR, USER1, "Error %i: MBUF too small\n", -ENOMEM);
 		return -ENOMEM;
 	}
 
@@ -1303,7 +1303,7 @@ prepare_aead_op(struct rte_crypto_op *op,
 
 	dst = rte_malloc(NULL, len, 16);
 	if (!dst) {
-		RTE_LOG(ERR, PMD, "Error %i: Not enough memory\n", -ENOMEM);
+		RTE_LOG(ERR, USER1, "Error %i: Not enough memory\n", -ENOMEM);
 		return -ENOMEM;
 	}
 
@@ -1474,24 +1474,24 @@ run_single_test(uint8_t dev_id,
 	ret = test_ops->prepare_xform(dev_id, &xform, vec, dir, key,
 			negative_test);
 	if (ret < 0) {
-		RTE_LOG(ERR, PMD, "Error %i: Prepare Xform\n", ret);
+		RTE_LOG(ERR, USER1, "Error %i: Prepare Xform\n", ret);
 		return ret;
 	}
 
 	sess = rte_cryptodev_sym_session_create(dev_id, &xform, env->sess_pool);
 	if (!sess) {
-		RTE_LOG(ERR, PMD, "Error %i: Init session\n", ret);
+		RTE_LOG(ERR, USER1, "Error %i: Init session\n", ret);
 		return ret;
 	}
 
 	ret = test_ops->prepare_op(env->op, env->mbuf, sess, dir, vec);
 	if (ret < 0) {
-		RTE_LOG(ERR, PMD, "Error %i: Prepare op\n", ret);
+		RTE_LOG(ERR, USER1, "Error %i: Prepare op\n", ret);
 		return ret;
 	}
 
 	if (rte_cryptodev_enqueue_burst(dev_id, 0, &env->op, 1) < 1) {
-		RTE_LOG(ERR, PMD, "Error: Failed enqueue\n");
+		RTE_LOG(ERR, USER1, "Error: Failed enqueue\n");
 		return ret;
 	}
 
@@ -1622,7 +1622,7 @@ fips_dev_self_test(uint8_t dev_id,
 
 	ret = fips_dev_auto_test_init(dev_id, &env);
 	if (ret < 0) {
-		RTE_LOG(ERR, PMD, "Failed to init self-test for PMD %u\n",
+		RTE_LOG(ERR, USER1, "Failed to init self-test for PMD %u\n",
 				dev_id);
 		return ret;
 	}
@@ -1644,7 +1644,7 @@ fips_dev_self_test(uint8_t dev_id,
 					negative_test = 0;
 			}
 
-			RTE_LOG(INFO, PMD, "Testing (ID %u) %s %s%s...\n",
+			RTE_LOG(INFO, USER1, "Testing (ID %u) %s %s%s...\n",
 					i,
 					vec->name,
 					j == self_test_dir_enc_auth_gen ?
@@ -1658,18 +1658,18 @@ fips_dev_self_test(uint8_t dev_id,
 				if (!negative_test)
 					break;
 				ret = -1;
-				RTE_LOG(ERR, PMD, "PMD %u Failed test %s %s\n",
+				RTE_LOG(ERR, USER1, "PMD %u Failed test %s %s\n",
 					dev_id, vec->name,
 					j == self_test_dir_enc_auth_gen ?
 					"Encrypt" : "Decrypt");
 				goto error_exit;
 			case -EACCES:
-				RTE_LOG(ERR, PMD, "Not supported by %s. Skip\n",
+				RTE_LOG(ERR, USER1, "Not supported by %s. Skip\n",
 					rte_cryptodev_name_get(dev_id));
 				ret = 0;
 				break;
 			default:
-				RTE_LOG(ERR, PMD, "PMD %u Failed test %s %s\n",
+				RTE_LOG(ERR, USER1, "PMD %u Failed test %s %s\n",
 					dev_id, vec->name,
 					j == self_test_dir_enc_auth_gen ?
 					"Encrypt" : "Decrypt");
@@ -1682,7 +1682,7 @@ fips_dev_self_test(uint8_t dev_id,
 	fips_dev_auto_test_uninit(dev_id, &env);
 
 	if (ret == 0) {
-		RTE_LOG(INFO, PMD, "PMD %u finished self-test successfully\n",
+		RTE_LOG(INFO, USER1, "PMD %u finished self-test successfully\n",
 				dev_id);
 	}
 
-- 
2.43.0


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

* [PATCH v5 18/18] log: mark PMD logtype as deprecated
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (16 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 17/18] examples/fips_validation: replace use of PMD logtype Stephen Hemminger
@ 2023-12-21 16:46   ` Stephen Hemminger
  2023-12-22 12:50   ` [PATCH v5 00/18] Replace uses of PMD logtype David Marchand
  18 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-21 16:46 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This is temporary patch to help find all misuse use of PMD logtype
---
 lib/log/log.c     | 3 +++
 lib/log/rte_log.h | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/log/log.c b/lib/log/log.c
index ab06132a98a1..09a31a62c0fd 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -352,6 +352,9 @@ struct logtype {
 
 static const struct logtype logtype_strings[] = {
 	{RTE_LOGTYPE_EAL,        "lib.eal"},
+/* avoid deprecated warning */
+#undef RTE_LOGTYPE_PMD
+#define RTE_LOGTYPE_PMD        5
 	{RTE_LOGTYPE_PMD,        "pmd"},
 	{RTE_LOGTYPE_PORT,       "lib.port"},
 	{RTE_LOGTYPE_TABLE,      "lib.table"},
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 5ba198ba2484..1ac7e26f56ba 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -32,7 +32,7 @@ extern "C" {
 				 /* was RTE_LOGTYPE_RING */
 				 /* was RTE_LOGTYPE_MEMPOOL */
 				 /* was RTE_LOGTYPE_TIMER */
-#define RTE_LOGTYPE_PMD        5 /**< Log related to poll mode driver. */
+#define RTE_LOGTYPE_PMD  RTE_DEPRECATED(RTE_LOGTYPE_PMD) 5
 				 /* was RTE_LOGTYPE_HASH */
 				 /* was RTE_LOGTYPE_LPM */
 				 /* was RTE_LOGTYPE_KNI */
-- 
2.43.0


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

* Re: [PATCH v5 00/18] Replace uses of PMD logtype
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
                     ` (17 preceding siblings ...)
  2023-12-21 16:46   ` [PATCH v5 18/18] log: mark PMD logtype as deprecated Stephen Hemminger
@ 2023-12-22 12:50   ` David Marchand
  18 siblings, 0 replies; 214+ messages in thread
From: David Marchand @ 2023-12-22 12:50 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Thu, Dec 21, 2023 at 5:49 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> The generic RTE_LOGTYPE_PMD is a leftover and should be removed.
> This replaces all uses in current tree. It leaves PMD logtype
> as deprecated because there maybe other uses in external projects
> leftover.
>
> This version does not use Depends-on: because CI system can't
> handle that and want to make sure no PMD left behind.
>
> v5 - incorporate review feedback
>
> David Marchand (1):
>   drivers: use dedicated logtypes
>
> Stephen Hemminger (17):
>   common/sfc_efx: remove use of PMD logtype
>   mempool/dpaa2: use driver logtype not PMD
>   net/dpaa: use dedicated logtype not PMD
>   net/dpaa2: used dedicated logtype not PMD
>   net/mvpp2: use dedicated logtype
>   net/vmxnet3: used dedicated logtype not PMD
>   raw/cnxk: replace PMD logtype with dynamic type
>   crypto/scheduler: replace use of logtype PMD
>   crypto/ccp: do not use PMD logtype
>   crypto/caam_jr: use dedicated logtype
>   crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
>   event/dlb2: use dedicated logtype
>   event/dpaa, event/dpaa2: use dedicated logtype
>   event/skeleton: replace logtype PMD with dynamic type
>   net/nfb: use dynamic logtype
>   examples/fips_validation: replace use of PMD logtype
>   log: mark PMD logtype as deprecated

It seems our CI has some gaps.

I found some PMD use in two drivers:
drivers/crypto/armv8/rte_armv8_pmd.c:   RTE_LOG(INFO, PMD,
drivers/net/mvpp2/mrvl_ethdev.c:                        RTE_LOG(ERR, PMD,



-- 
David Marchand


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

* [PATCH v6 00/20] Remove uses of PMD logtype
  2023-12-13  1:42 [PATCH 00/26] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
                   ` (29 preceding siblings ...)
  2023-12-21 16:46 ` [PATCH v5 00/18] Replace uses of PMD logtype Stephen Hemminger
@ 2023-12-22 17:11 ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 01/20] drivers: use dedicated logtypes Stephen Hemminger
                     ` (20 more replies)
  2024-02-03  4:10 ` [PATCH v7 00/19] Replace use " Stephen Hemminger
  2024-02-03  4:11 ` [PATCH v7 00/19] Replace uses of RTE_LOGTYPE_PMD Stephen Hemminger
  32 siblings, 21 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a leftover and should be removed.
This replaces all uses in current tree. It leaves PMD logtype
as deprecated because there maybe other uses in external projects
leftover.

This version does not use Depends-on: because CI system can't
handle that and want to make sure no PMD left behind

v6 - add a couple of more places
     remove PMD logtype in last patch

David Marchand (1):
  drivers: use dedicated logtypes

Stephen Hemminger (19):
  common/sfc_efx: remove use of PMD logtype
  mempool/dpaa2: use driver logtype not PMD
  net/dpaa: use dedicated logtype not PMD
  net/dpaa2: used dedicated logtype not PMD
  net/mrvl: do not use PMD logtype
  net/mvpp2: use dedicated logtype
  net/nfb: use dynamic logtype
  net/vmxnet3: used dedicated logtype not PMD
  raw/cnxk: replace PMD logtype with dynamic type
  crypto/scheduler: replace use of logtype PMD
  crypto/armv8: do not use PMD logtype
  crypto/ccp: do not use PMD logtype
  crypto/caam_jr: use dedicated logtype
  crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
  event/dlb2: use dedicated logtype
  event/dpaa, event/dpaa2: use dedicated logtype
  event/skeleton: replace logtype PMD with dynamic type
  examples/fips_validation: replace use of PMD logtype
  log: remove PMD log type

 .../baseband/la12xx/bbdev_la12xx_pmd_logs.h   |   3 +-
 drivers/bus/cdx/cdx_logs.h                    |   3 +-
 drivers/bus/fslmc/fslmc_logs.h                |   3 +-
 drivers/common/cnxk/roc_platform.h            |  16 +-
 drivers/common/cpt/cpt_pmd_logs.h             |   6 +-
 drivers/common/dpaax/caamflib/compat.h        |   4 +-
 drivers/common/dpaax/dpaax_logs.h             |   3 +-
 drivers/common/dpaax/version.map              |   1 +
 drivers/common/idpf/idpf_common_logs.h        |   5 +-
 drivers/common/sfc_efx/sfc_efx.c              |  11 +-
 drivers/common/sfc_efx/sfc_efx_log.h          |   2 +-
 drivers/crypto/armv8/rte_armv8_pmd.c          |   4 +-
 drivers/crypto/caam_jr/caam_jr.c              |  46 ++-
 drivers/crypto/caam_jr/caam_jr_log.h          |  15 +-
 drivers/crypto/caam_jr/caam_jr_uio.c          |   4 +-
 drivers/crypto/ccp/rte_ccp_pmd.c              |  13 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |   6 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h     |   3 +-
 drivers/crypto/dpaa_sec/dpaa_sec.c            |  30 +-
 drivers/crypto/dpaa_sec/dpaa_sec_log.h        |   3 +-
 drivers/crypto/scheduler/scheduler_pmd.c      |   4 +-
 drivers/dma/dpaa/dpaa_qdma_logs.h             |   3 +-
 drivers/dma/dpaa2/dpaa2_qdma_logs.h           |   3 +-
 drivers/event/dlb2/dlb2.c                     | 275 +++++++++---------
 drivers/event/dlb2/dlb2_log.h                 |   3 +-
 drivers/event/dpaa/dpaa_eventdev.c            |   2 +-
 drivers/event/dpaa2/dpaa2_eventdev.c          |   4 +-
 drivers/event/dpaa2/dpaa2_eventdev_logs.h     |   3 +-
 drivers/event/dpaa2/dpaa2_eventdev_selftest.c |   6 +-
 drivers/event/skeleton/skeleton_eventdev.c    |   4 +-
 drivers/event/skeleton/skeleton_eventdev.h    |   8 +-
 drivers/mempool/dpaa/dpaa_mempool.c           |   1 +
 drivers/mempool/dpaa/dpaa_mempool.h           |   2 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c      |   4 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h |   3 +-
 drivers/net/atlantic/atl_logs.h               |   5 +-
 drivers/net/avp/avp_logs.h                    |   5 +-
 drivers/net/bnxt/bnxt.h                       |   1 +
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c         |   2 +-
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c          |   2 +-
 drivers/net/bnxt/bnxt_txr.c                   |   2 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   8 +-
 drivers/net/dpaa/dpaa_ethdev.h                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   2 +-
 drivers/net/dpaa2/dpaa2_pmd_logs.h            |   3 +-
 drivers/net/dpaa2/dpaa2_sparser.c             |   4 +-
 drivers/net/enetc/enetc_logs.h                |   3 +-
 drivers/net/enetfec/enet_pmd_logs.h           |   3 +-
 drivers/net/igc/igc_logs.h                    |   5 +-
 drivers/net/mana/mana.h                       |   3 +-
 drivers/net/mvpp2/mrvl_ethdev.c               |   7 +-
 drivers/net/nfb/nfb.h                         |   5 +
 drivers/net/nfb/nfb_ethdev.c                  |  24 +-
 drivers/net/nfb/nfb_rx.c                      |   9 +-
 drivers/net/nfb/nfb_rx.h                      |   2 +-
 drivers/net/nfb/nfb_tx.c                      |   9 +-
 drivers/net/nfb/nfb_tx.h                      |   2 +-
 drivers/net/octeon_ep/otx_ep_common.h         |   2 +
 drivers/net/octeon_ep/otx_ep_rxtx.c           |   2 +-
 drivers/net/octeontx/octeontx_logs.h          |   3 +-
 drivers/net/pfe/pfe_logs.h                    |   3 +-
 drivers/net/qede/qede_logs.h                  |   5 +-
 drivers/net/virtio/virtio_logs.h              |   5 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   2 +-
 drivers/net/vmxnet3/vmxnet3_logs.h            |   7 +-
 drivers/raw/cnxk_bphy/cnxk_bphy.c             |   3 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c         |   2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c    |  31 +-
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h          |   6 +
 drivers/raw/cnxk_gpio/cnxk_gpio.c             |  21 +-
 drivers/raw/cnxk_gpio/cnxk_gpio.h             |   5 +
 drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c    |  17 +-
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h    |   3 +-
 .../raw/ifpga/base/osdep_rte/osdep_generic.h  |   5 +-
 drivers/vdpa/ifc/base/ifcvf.c                 |  10 +-
 drivers/vdpa/ifc/base/ifcvf_osdep.h           |   7 +-
 examples/fips_validation/fips_dev_self_test.c |  44 +--
 lib/log/log.c                                 |   1 -
 lib/log/rte_log.h                             |   2 +-
 79 files changed, 420 insertions(+), 381 deletions(-)

-- 
2.43.0


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

* [PATCH v6 01/20] drivers: use dedicated logtypes
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 02/20] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
                     ` (19 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Gagandeep Singh, Hemant Agrawal, Nipun Gupta,
	Nikhil Agarwal, Sachin Saxena, Anoob Joseph, Jingjing Wu,
	Beilei Xing, Abdullah Sevincer, Igor Russkikh, Steven Webster,
	Matt Peters, Ajit Khaparde, Somnath Kotur, Ruifeng Wang,
	Bruce Richardson, Konstantin Ananyev, Apeksha Gupta, Junfeng Guo,
	Simei Su, Long Li, Vamsi Attunuru, Harman Kalra,
	Devendra Singh Rawat, Alok Prasad, Maxime Coquelin, Chenbo Xia,
	Jochen Behrens, Rosen Xu, Tianfei Zhang, Xiao Wang

From: David Marchand <david.marchand@redhat.com>

When a driver dedicated logtype exists, use it instead of the generic
PMD logtype.

This has been done partially automatically with:

$ for file in $(git grep -l RTE_LOG.*PMD.*fmt drivers/'**.h' \
  :^drivers/common/cnxk/roc_platform.h)
do
  tail=${file#drivers/*/*/}
  dir=${file%%$tail}
  ! git grep -q RTE_LOGTYPE_ $dir || \
    { echo $dir already done; continue; }
  git grep -hE '^extern int .*log.*;$' $file | \
  sed -ne 's/^extern int \([^ ;]*\);$/\1/p' | \
  while read logtype
  do
    git grep -q 'RTE_LOG_REGISTER\(_DEFAULT\|\)('$logtype',' || \
    [ "$logtype" != "${logtype%%driver}" ] || \
      { echo Skipped $logtype; continue; }
    abbrev=$(echo $logtype | sed -e 's/_logtype//' | tr '[a-z]' '[A-Z]')
    sed -i -e 's/^\(extern int '$logtype'.*\)$/\1\n#define RTE_LOGTYPE_' \
      $abbrev' '$logtype'/' $file
    sed -i -e 's/\(RTE_LOG.*, \)PMD,/\1'$abbrev',/' $file
    break
  done
done

Then a manual update for:
- common/cpt,
- common/dpaax,
- common/idpf,
- mempool/dpaa,
- net/bnxt,
- net/octeon_ep,
- raw/ifpga,
- vdpa/ifc,

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h  |  3 ++-
 drivers/bus/cdx/cdx_logs.h                       |  3 ++-
 drivers/bus/fslmc/fslmc_logs.h                   |  3 ++-
 drivers/common/cpt/cpt_pmd_logs.h                |  6 +++---
 drivers/common/dpaax/caamflib/compat.h           |  4 +++-
 drivers/common/dpaax/dpaax_logs.h                |  3 ++-
 drivers/common/dpaax/version.map                 |  1 +
 drivers/common/idpf/idpf_common_logs.h           |  5 +++--
 drivers/crypto/caam_jr/caam_jr_log.h             |  3 ++-
 drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h        |  3 ++-
 drivers/crypto/dpaa_sec/dpaa_sec_log.h           |  3 ++-
 drivers/dma/dpaa/dpaa_qdma_logs.h                |  3 ++-
 drivers/dma/dpaa2/dpaa2_qdma_logs.h              |  3 ++-
 drivers/event/dlb2/dlb2_log.h                    |  3 ++-
 drivers/event/dpaa2/dpaa2_eventdev_logs.h        |  3 ++-
 drivers/mempool/dpaa/dpaa_mempool.c              |  1 +
 drivers/mempool/dpaa/dpaa_mempool.h              |  2 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h    |  3 ++-
 drivers/net/atlantic/atl_logs.h                  |  5 +++--
 drivers/net/avp/avp_logs.h                       |  5 +++--
 drivers/net/bnxt/bnxt.h                          |  1 +
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c            |  2 +-
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c             |  2 +-
 drivers/net/bnxt/bnxt_txr.c                      |  2 +-
 drivers/net/dpaa/dpaa_ethdev.h                   |  3 ++-
 drivers/net/dpaa2/dpaa2_pmd_logs.h               |  3 ++-
 drivers/net/enetc/enetc_logs.h                   |  3 ++-
 drivers/net/enetfec/enet_pmd_logs.h              |  3 ++-
 drivers/net/igc/igc_logs.h                       |  5 +++--
 drivers/net/mana/mana.h                          |  3 ++-
 drivers/net/octeon_ep/otx_ep_common.h            |  2 ++
 drivers/net/octeon_ep/otx_ep_rxtx.c              |  2 +-
 drivers/net/octeontx/octeontx_logs.h             |  3 ++-
 drivers/net/pfe/pfe_logs.h                       |  3 ++-
 drivers/net/qede/qede_logs.h                     |  5 +++--
 drivers/net/virtio/virtio_logs.h                 |  5 +++--
 drivers/net/vmxnet3/vmxnet3_logs.h               |  7 ++++---
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h       |  3 ++-
 drivers/raw/ifpga/base/osdep_rte/osdep_generic.h |  5 ++++-
 drivers/vdpa/ifc/base/ifcvf.c                    | 10 +++++-----
 drivers/vdpa/ifc/base/ifcvf_osdep.h              |  7 +++++--
 41 files changed, 92 insertions(+), 52 deletions(-)

diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
index 452435ccb942..49c8d35d104d 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
+++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
@@ -6,6 +6,7 @@
 #define _BBDEV_LA12XX_PMD_LOGS_H_
 
 extern int bbdev_la12xx_logtype;
+#define RTE_LOGTYPE_BBDEV_LA12XX bbdev_la12xx_logtype
 
 #define rte_bbdev_log(level, fmt, ...) \
 	rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \
@@ -23,6 +24,6 @@ extern int bbdev_la12xx_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define rte_bbdev_dp_log(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, BBDEV_LA12XX, fmt, ## args)
 
 #endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
diff --git a/drivers/bus/cdx/cdx_logs.h b/drivers/bus/cdx/cdx_logs.h
index a1046ce544a6..3a56e814d0fd 100644
--- a/drivers/bus/cdx/cdx_logs.h
+++ b/drivers/bus/cdx/cdx_logs.h
@@ -6,6 +6,7 @@
 #define CDX_LOGS_H
 
 extern int cdx_logtype_bus;
+#define RTE_LOGTYPE_CDX_BUS cdx_logtype_bus
 
 #define CDX_BUS_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, cdx_logtype_bus, "cdx: " fmt "\n", \
@@ -25,7 +26,7 @@ extern int cdx_logtype_bus;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define CDX_BUS_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, CDX_BUS, fmt, ## args)
 
 #define CDX_BUS_DP_DEBUG(fmt, args...) \
 	CDX_BUS_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/bus/fslmc/fslmc_logs.h b/drivers/bus/fslmc/fslmc_logs.h
index a1e14dd84e9a..37c6852ddd72 100644
--- a/drivers/bus/fslmc/fslmc_logs.h
+++ b/drivers/bus/fslmc/fslmc_logs.h
@@ -8,6 +8,7 @@
 #define _FSLMC_LOGS_H_
 
 extern int dpaa2_logtype_bus;
+#define RTE_LOGTYPE_DPAA2_BUS dpaa2_logtype_bus
 
 #define DPAA2_BUS_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_logtype_bus, "fslmc: " fmt "\n", \
@@ -27,7 +28,7 @@ extern int dpaa2_logtype_bus;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_BUS_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA2_BUS, fmt, ## args)
 
 #define DPAA2_BUS_DP_DEBUG(fmt, args...) \
 	DPAA2_BUS_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/common/cpt/cpt_pmd_logs.h b/drivers/common/cpt/cpt_pmd_logs.h
index 174326c6ce38..3c109c1983ca 100644
--- a/drivers/common/cpt/cpt_pmd_logs.h
+++ b/drivers/common/cpt/cpt_pmd_logs.h
@@ -15,6 +15,8 @@
  * otx*_cryptodev.h file would define the CPT_LOGTYPE macro for the
  * platform.
  */
+#define RTE_LOGTYPE_CPT CPT_LOGTYPE
+
 #define CPT_PMD_DRV_LOG_RAW(level, fmt, args...) \
 		rte_log(RTE_LOG_ ## level, CPT_LOGTYPE, \
 			"cpt: %s(): " fmt "\n", __func__, ##args)
@@ -30,11 +32,9 @@
 
 /*
  * DP logs, toggled out at compile time if level lower than current level.
- * DP logs would be logged under 'PMD' type. So for dynamic logging, the
- * level of 'pmd' has to be used.
  */
 #define CPT_LOG_DP(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	RTE_LOG_DP(level, CPT, fmt "\n", ## args)
 
 #define CPT_LOG_DP_DEBUG(fmt, args...) \
 	CPT_LOG_DP(DEBUG, fmt, ## args)
diff --git a/drivers/common/dpaax/caamflib/compat.h b/drivers/common/dpaax/caamflib/compat.h
index 9776eed437ad..43da6a4fe32f 100644
--- a/drivers/common/dpaax/caamflib/compat.h
+++ b/drivers/common/dpaax/caamflib/compat.h
@@ -20,6 +20,8 @@
 #include <rte_byteorder.h>
 #include <rte_common.h>
 
+#include "dpaax_logs.h"
+
 #ifndef __BYTE_ORDER__
 #error "Undefined endianness"
 #endif
@@ -44,7 +46,7 @@
 #define pr_msg(l, fmt, ...) do { } while (0)
 #else
 #define pr_msg(l, fmt, ...) \
-	RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
+	RTE_LOG(l, DPAAX_LOGGER, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
 #endif
 
 #if !defined(pr_debug)
diff --git a/drivers/common/dpaax/dpaax_logs.h b/drivers/common/dpaax/dpaax_logs.h
index 180476f6757c..c405c60992c8 100644
--- a/drivers/common/dpaax/dpaax_logs.h
+++ b/drivers/common/dpaax/dpaax_logs.h
@@ -8,6 +8,7 @@
 #include <rte_log.h>
 
 extern int dpaax_logger;
+#define RTE_LOGTYPE_DPAAX_LOGGER dpaax_logger
 
 #ifdef RTE_LIBRTE_DPAAX_DEBUG
 #define DPAAX_HWWARN(cond, fmt, args...) \
@@ -37,7 +38,7 @@ extern int dpaax_logger;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAAX_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAAX_LOGGER, fmt, ## args)
 
 #define DPAAX_DP_DEBUG(fmt, args...) \
 	DPAAX_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/common/dpaax/version.map b/drivers/common/dpaax/version.map
index ee1ca6801c81..d48a6b6f37ee 100644
--- a/drivers/common/dpaax/version.map
+++ b/drivers/common/dpaax/version.map
@@ -6,6 +6,7 @@ INTERNAL {
 	dpaax_iova_table_p;
 	dpaax_iova_table_populate;
 	dpaax_iova_table_update;
+	dpaax_logger;
 	of_device_is_available;
 	of_device_is_compatible;
 	of_find_compatible_node;
diff --git a/drivers/common/idpf/idpf_common_logs.h b/drivers/common/idpf/idpf_common_logs.h
index f6be84ceb549..e638c616d8f5 100644
--- a/drivers/common/idpf/idpf_common_logs.h
+++ b/drivers/common/idpf/idpf_common_logs.h
@@ -8,6 +8,7 @@
 #include <rte_log.h>
 
 extern int idpf_common_logtype;
+#define RTE_LOGTYPE_IDPF_COMMON idpf_common_logtype
 
 #define DRV_LOG_RAW(level, ...)					\
 	rte_log(RTE_LOG_ ## level,				\
@@ -23,7 +24,7 @@ extern int idpf_common_logtype;
 #ifdef RTE_LIBRTE_IDPF_DEBUG_RX
 #define RX_LOG(level, ...) \
 	RTE_LOG(level, \
-		PMD, \
+		IDPF_COMMON, \
 		RTE_FMT("%s(): " \
 			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
 			__func__, \
@@ -35,7 +36,7 @@ extern int idpf_common_logtype;
 #ifdef RTE_LIBRTE_IDPF_DEBUG_TX
 #define TX_LOG(level, ...) \
 	RTE_LOG(level, \
-		PMD, \
+		IDPF_COMMON, \
 		RTE_FMT("%s(): " \
 			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
 			__func__, \
diff --git a/drivers/crypto/caam_jr/caam_jr_log.h b/drivers/crypto/caam_jr/caam_jr_log.h
index 106ff07a70fe..8f6aa50e2a4a 100644
--- a/drivers/crypto/caam_jr/caam_jr_log.h
+++ b/drivers/crypto/caam_jr/caam_jr_log.h
@@ -8,6 +8,7 @@
 #include <rte_log.h>
 
 extern int caam_jr_logtype;
+#define RTE_LOGTYPE_CAAM_JR caam_jr_logtype
 
 #define CAAM_JR_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \
@@ -28,7 +29,7 @@ extern int caam_jr_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define CAAM_JR_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	RTE_LOG_DP(level, CAAM_JR, fmt "\n", ## args)
 
 #define CAAM_JR_DP_DEBUG(fmt, args...) \
 	CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
index c2e11f9516f9..ee692095045a 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
@@ -9,6 +9,7 @@
 #define _DPAA2_SEC_LOGS_H_
 
 extern int dpaa2_logtype_sec;
+#define RTE_LOGTYPE_DPAA2_SEC dpaa2_logtype_sec
 
 #define DPAA2_SEC_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_logtype_sec, "dpaa2_sec: " \
@@ -29,7 +30,7 @@ extern int dpaa2_logtype_sec;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_SEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA2_SEC, fmt, ## args)
 
 #define DPAA2_SEC_DP_DEBUG(fmt, args...) \
 	DPAA2_SEC_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_log.h b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
index fb895a8bc67f..f8c85b6528a9 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec_log.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
@@ -9,6 +9,7 @@
 #define _DPAA_SEC_LOG_H_
 
 extern int dpaa_logtype_sec;
+#define RTE_LOGTYPE_DPAA_SEC dpaa_logtype_sec
 
 #define DPAA_SEC_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa_logtype_sec, "dpaa_sec: " \
@@ -29,7 +30,7 @@ extern int dpaa_logtype_sec;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_SEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA_SEC, fmt, ## args)
 
 #define DPAA_SEC_DP_DEBUG(fmt, args...) \
 	DPAA_SEC_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/dma/dpaa/dpaa_qdma_logs.h b/drivers/dma/dpaa/dpaa_qdma_logs.h
index 762598f8f72f..95753dcd89b0 100644
--- a/drivers/dma/dpaa/dpaa_qdma_logs.h
+++ b/drivers/dma/dpaa/dpaa_qdma_logs.h
@@ -6,6 +6,7 @@
 #define __DPAA_QDMA_LOGS_H__
 
 extern int dpaa_qdma_logtype;
+#define RTE_LOGTYPE_DPAA_QDMA dpaa_qdma_logtype
 
 #define DPAA_QDMA_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa_qdma_logtype, "dpaa_qdma: " \
@@ -26,7 +27,7 @@ extern int dpaa_qdma_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args)
+	RTE_LOG_DP(level, DPAA_QDMA, "dpaa_qdma: " fmt "\n", ## args)
 
 #define DPAA_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/dma/dpaa2/dpaa2_qdma_logs.h b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
index a46b8f24b5a7..37a5a5c6e974 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma_logs.h
+++ b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
@@ -10,6 +10,7 @@ extern "C" {
 #endif
 
 extern int dpaa2_qdma_logtype;
+#define RTE_LOGTYPE_DPAA2_QDMA dpaa2_qdma_logtype
 
 #define DPAA2_QDMA_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_qdma_logtype, "dpaa2_qdma: " \
@@ -30,7 +31,7 @@ extern int dpaa2_qdma_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa2_qdma: " fmt "\n", ## args)
+	RTE_LOG_DP(level, DPAA2_QDMA, "dpaa2_qdma: " fmt "\n", ## args)
 
 #define DPAA2_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/event/dlb2/dlb2_log.h b/drivers/event/dlb2/dlb2_log.h
index dc1481ef870c..54d6a3011f25 100644
--- a/drivers/event/dlb2/dlb2_log.h
+++ b/drivers/event/dlb2/dlb2_log.h
@@ -6,6 +6,7 @@
 #define _DLB2_EVDEV_LOG_H_
 
 extern int eventdev_dlb2_log_level;
+#define RTE_LOGTYPE_EVENTDEV_DLB2_LOG_LEVEL eventdev_dlb2_log_level
 
 /* Dynamic logging */
 #define DLB2_LOG_IMPL(level, fmt, args...) \
@@ -20,6 +21,6 @@ extern int eventdev_dlb2_log_level;
 
 /* remove debug logs at compile time unless actually debugging */
 #define DLB2_LOG_DBG(fmt, args...) \
-	RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
+	RTE_LOG_DP(DEBUG, EVENTDEV_DLB2_LOG_LEVEL, fmt, ## args)
 
 #endif /* _DLB2_EVDEV_LOG_H_ */
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
index 66c8c772740d..ae221e7e1524 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_logs.h
+++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
@@ -6,6 +6,7 @@
 #define _DPAA2_EVENTDEV_LOGS_H_
 
 extern int dpaa2_logtype_event;
+#define RTE_LOGTYPE_DPAA2_EVENT dpaa2_logtype_event
 
 #define DPAA2_EVENTDEV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_logtype_event, "dpaa2_event: " \
@@ -26,7 +27,7 @@ extern int dpaa2_logtype_event;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_EVENTDEV_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA2_EVENT, fmt, ## args)
 
 #define DPAA2_EVENTDEV_DP_DEBUG(fmt, args...) \
 	DPAA2_EVENTDEV_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index 32639a3bfdab..0b484b3d9c7d 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -38,6 +38,7 @@ struct dpaa_memseg_list rte_dpaa_memsegs
 struct dpaa_bp_info *rte_dpaa_bpid_info;
 
 RTE_LOG_REGISTER_DEFAULT(dpaa_logtype_mempool, NOTICE);
+#define RTE_LOGTYPE_DPAA_MEMPOOL dpaa_logtype_mempool
 
 static int
 dpaa_mbuf_create_pool(struct rte_mempool *mp)
diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 3f0eafa7dd7b..153fefd507f9 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -67,7 +67,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;
 #define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
 
 #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \
-	RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
+	RTE_LOG_DP(DEBUG, DPAA_MEMPOOL, fmt, ## args)
 #define DPAA_MEMPOOL_DEBUG(fmt, args...) \
 	DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args)
 #define DPAA_MEMPOOL_ERR(fmt, args...) \
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
index 986264319623..fbc8cb30a284 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
@@ -6,6 +6,7 @@
 #define _DPAA2_HW_MEMPOOL_LOGS_H_
 
 extern int dpaa2_logtype_mempool;
+#define RTE_LOGTYPE_DPAA2_MEMPOOL dpaa2_logtype_mempool
 
 #define DPAA2_MEMPOOL_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_logtype_mempool, \
@@ -25,7 +26,7 @@ extern int dpaa2_logtype_mempool;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA2_MEMPOOL, fmt, ## args)
 
 #define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \
 	DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/atlantic/atl_logs.h b/drivers/net/atlantic/atl_logs.h
index e3dba334fe92..14a7a1de1d5a 100644
--- a/drivers/net/atlantic/atl_logs.h
+++ b/drivers/net/atlantic/atl_logs.h
@@ -15,12 +15,13 @@ extern int atl_logtype_init;
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 
 extern int atl_logtype_driver;
+#define RTE_LOGTYPE_ATL_DRIVER atl_logtype_driver
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/avp/avp_logs.h b/drivers/net/avp/avp_logs.h
index 6e297c7a4a81..574b720b3050 100644
--- a/drivers/net/avp/avp_logs.h
+++ b/drivers/net/avp/avp_logs.h
@@ -9,19 +9,20 @@
 
 #ifdef RTE_LIBRTE_AVP_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() rx: " fmt, __func__, ## args)
+	RTE_LOG(level, AVP_DRIVER, "%s() rx: " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_AVP_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() tx: " fmt, __func__, ## args)
+	RTE_LOG(level, AVP_DRIVER, "%s() tx: " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 extern int avp_logtype_driver;
+#define RTE_LOGTYPE_AVP_DRIVER avp_logtype_driver
 
 #define PMD_DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 0e01b1d4baea..61cc34417631 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -1051,6 +1051,7 @@ extern const struct rte_flow_ops bnxt_flow_meter_ops;
 		((eth_dev)->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
 
 extern int bnxt_logtype_driver;
+#define RTE_LOGTYPE_BNXT bnxt_logtype_driver
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, bnxt_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
index aa1b1ab8bb7e..775400f21ced 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
@@ -357,7 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
+			RTE_LOG_DP(ERR, BNXT,
 				   "Unhandled CMP type %02x\n",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index e99a547f5857..8ef51ce79a71 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -326,7 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
+			RTE_LOG_DP(ERR, BNXT,
 				   "Unhandled CMP type %02x\n",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 899986764f93..04e74587cb06 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -542,7 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
 		if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
 			nb_tx_pkts += opaque;
 		else
-			RTE_LOG_DP(ERR, PMD,
+			RTE_LOG_DP(ERR, BNXT,
 					"Unhandled CMP type %02x\n",
 					CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 5b6802ece8f0..b6c61b8b6b08 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -214,6 +214,7 @@ dpaa_rx_cb_atomic(void *event,
 
 /* PMD related logs */
 extern int dpaa_logtype_pmd;
+#define RTE_LOGTYPE_DPAA_PMD dpaa_logtype_pmd
 
 #define DPAA_PMD_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa_logtype_pmd, "%s(): " fmt "\n", \
@@ -232,6 +233,6 @@ extern int dpaa_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA_PMD, fmt, ## args)
 
 #endif
diff --git a/drivers/net/dpaa2/dpaa2_pmd_logs.h b/drivers/net/dpaa2/dpaa2_pmd_logs.h
index c47ba8e10bfc..af895a6b6e7b 100644
--- a/drivers/net/dpaa2/dpaa2_pmd_logs.h
+++ b/drivers/net/dpaa2/dpaa2_pmd_logs.h
@@ -6,6 +6,7 @@
 #define _DPAA2_PMD_LOGS_H_
 
 extern int dpaa2_logtype_pmd;
+#define RTE_LOGTYPE_DPAA2_PMD dpaa2_logtype_pmd
 
 #define DPAA2_PMD_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_logtype_pmd, "dpaa2_net: " \
@@ -28,7 +29,7 @@ extern int dpaa2_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, DPAA2_PMD, fmt, ## args)
 
 #define DPAA2_PMD_DP_DEBUG(fmt, args...) \
 	DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/enetc/enetc_logs.h b/drivers/net/enetc/enetc_logs.h
index 0976d42debd7..63f6ca4cf48a 100644
--- a/drivers/net/enetc/enetc_logs.h
+++ b/drivers/net/enetc/enetc_logs.h
@@ -6,6 +6,7 @@
 #define _ENETC_LOGS_H_
 
 extern int enetc_logtype_pmd;
+#define RTE_LOGTYPE_ENETC_PMD enetc_logtype_pmd
 
 #define ENETC_PMD_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, enetc_logtype_pmd, "enetc_net: " \
@@ -30,7 +31,7 @@ extern int enetc_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETC_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, ENETC_PMD, fmt, ## args)
 
 #define ENETC_PMD_DP_DEBUG(fmt, args...) \
 	ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/enetfec/enet_pmd_logs.h b/drivers/net/enetfec/enet_pmd_logs.h
index 72d1cb61c598..270981373f53 100644
--- a/drivers/net/enetfec/enet_pmd_logs.h
+++ b/drivers/net/enetfec/enet_pmd_logs.h
@@ -8,6 +8,7 @@
 #include <rte_log.h>
 
 extern int enetfec_logtype_pmd;
+#define RTE_LOGTYPE_ENETFEC_PMD enetfec_logtype_pmd
 
 /* PMD related logs */
 #define ENETFEC_PMD_LOG(level, fmt, args...) \
@@ -28,6 +29,6 @@ extern int enetfec_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETFEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, ENETFEC_PMD, fmt, ## args)
 
 #endif /* _ENETFEC_LOGS_H_ */
diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 11071a32b542..cca5389eff8e 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -13,6 +13,7 @@ extern "C" {
 
 extern int igc_logtype_init;
 extern int igc_logtype_driver;
+#define RTE_LOGTYPE_IGC_DRIVER igc_logtype_driver
 
 #define PMD_INIT_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, igc_logtype_init, \
@@ -22,14 +23,14 @@ extern int igc_logtype_driver;
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index 6836872dc257..6d4770dc3e96 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -460,6 +460,7 @@ struct mana_rxq {
 };
 
 extern int mana_logtype_driver;
+#define RTE_LOGTYPE_MANA_DRIVER mana_logtype_driver
 extern int mana_logtype_init;
 
 #define DRV_LOG(level, fmt, args...) \
@@ -467,7 +468,7 @@ extern int mana_logtype_init;
 		__func__, ## args)
 
 #define DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
+	RTE_LOG_DP(level, MANA_DRIVER, fmt "\n", ## args)
 
 #define PMD_INIT_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
index 82e57520d38d..d5074b74e4ae 100644
--- a/drivers/net/octeon_ep/otx_ep_common.h
+++ b/drivers/net/octeon_ep/otx_ep_common.h
@@ -598,4 +598,6 @@ int otx_ep_delete_oqs(struct otx_ep_device *otx_ep, uint32_t oq_no);
 #define PCI_VENDOR_ID_CAVIUM			0x177D
 
 extern int otx_net_ep_logtype;
+#define RTE_LOGTYPE_OTX_NET_EP otx_net_ep_logtype
+
 #endif  /* _OTX_EP_COMMON_H_ */
diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c
index c421ef0a1c04..a6a71fdbfd47 100644
--- a/drivers/net/octeon_ep/otx_ep_rxtx.c
+++ b/drivers/net/octeon_ep/otx_ep_rxtx.c
@@ -884,7 +884,7 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		next_fetch = (pkts == new_pkts - 1) ? 0 : 1;
 		oq_pkt = otx_ep_droq_read_packet(otx_ep, droq, next_fetch);
 		if (!oq_pkt) {
-			RTE_LOG_DP(ERR, PMD,
+			RTE_LOG_DP(ERR, OTX_NET_EP,
 				   "DROQ read pkt failed pending %" PRIu64
 				    "last_pkt_count %" PRIu64 "new_pkts %d.\n",
 				   droq->pkts_pending, droq->last_pkt_count,
diff --git a/drivers/net/octeontx/octeontx_logs.h b/drivers/net/octeontx/octeontx_logs.h
index dec8042c67ba..b58f296478c9 100644
--- a/drivers/net/octeontx/octeontx_logs.h
+++ b/drivers/net/octeontx/octeontx_logs.h
@@ -20,7 +20,7 @@
 			"%s(): " fmt "\n", __func__, ## args)
 
 #define octeontx_log_info(fmt, args...)			\
-	RTE_LOG(INFO, PMD, fmt "\n", ## args)
+	RTE_LOG(INFO, OTX_NET_DRIVER, fmt "\n", ## args)
 
 #define octeontx_log_err(s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)
 #define octeontx_log_dbg(s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__)
@@ -31,6 +31,7 @@
 
 extern int otx_net_logtype_init;
 extern int otx_net_logtype_driver;
+#define RTE_LOGTYPE_OTX_NET_DRIVER otx_net_logtype_driver
 extern int otx_net_logtype_mbox;
 
 #endif /* __OCTEONTX_LOGS_H__*/
diff --git a/drivers/net/pfe/pfe_logs.h b/drivers/net/pfe/pfe_logs.h
index 58d5e8e7cff1..369a50bec567 100644
--- a/drivers/net/pfe/pfe_logs.h
+++ b/drivers/net/pfe/pfe_logs.h
@@ -6,6 +6,7 @@
 #define _PFE_LOGS_H_
 
 extern int pfe_logtype_pmd;
+#define RTE_LOGTYPE_PFE_PMD pfe_logtype_pmd
 
 /* PMD related logs */
 #define PFE_PMD_LOG(level, fmt, args...) \
@@ -26,6 +27,6 @@ extern int pfe_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define PFE_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, PFE_PMD, fmt, ## args)
 
 #endif /* _PFE_LOGS_H_ */
diff --git a/drivers/net/qede/qede_logs.h b/drivers/net/qede/qede_logs.h
index 3187d97bb7b0..f67052d10646 100644
--- a/drivers/net/qede/qede_logs.h
+++ b/drivers/net/qede/qede_logs.h
@@ -8,6 +8,7 @@
 #define _QEDE_LOGS_H_
 
 extern int qede_logtype_driver;
+#define RTE_LOGTYPE_QEDE_DRIVER qede_logtype_driver
 
 #define DP_ERR(p_dev, fmt, ...)				\
 	rte_log(RTE_LOG_ERR, qede_logtype_driver,	\
@@ -59,7 +60,7 @@ extern int qede_logtype_init;
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_TX
 #define PMD_TX_LOG(level, q, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \
+	RTE_LOG(level, QEDE_DRIVER, "%s(): port=%u queue=%u " fmt "\n", \
 		__func__, q->port_id, q->queue_id, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
@@ -67,7 +68,7 @@ extern int qede_logtype_init;
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_RX
 #define PMD_RX_LOG(level, q, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n",	\
+	RTE_LOG(level, QEDE_DRIVER, "%s(): port=%u queue=%u " fmt "\n",	\
 		__func__, q->port_id, q->queue_id, ## args)
 #else
 #define PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
diff --git a/drivers/net/virtio/virtio_logs.h b/drivers/net/virtio/virtio_logs.h
index 9b1b1defc5a6..01911514bd45 100644
--- a/drivers/net/virtio/virtio_logs.h
+++ b/drivers/net/virtio/virtio_logs.h
@@ -16,19 +16,20 @@ extern int virtio_logtype_init;
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args)
+	RTE_LOG(level, VIRTIO_DRIVER, "%s() rx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args)
+	RTE_LOG(level, VIRTIO_DRIVER, "%s() tx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 extern int virtio_logtype_driver;
+#define RTE_LOGTYPE_VIRTIO_DRIVER virtio_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
 		"%s(): " fmt "\n", __func__, ## args)
diff --git a/drivers/net/vmxnet3/vmxnet3_logs.h b/drivers/net/vmxnet3/vmxnet3_logs.h
index 74154e3a1a6d..e2127988f6fa 100644
--- a/drivers/net/vmxnet3/vmxnet3_logs.h
+++ b/drivers/net/vmxnet3/vmxnet3_logs.h
@@ -13,26 +13,27 @@ extern int vmxnet3_logtype_init;
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE
 #define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 extern int vmxnet3_logtype_driver;
+#define RTE_LOGTYPE_VMXNET3_DRIVER vmxnet3_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
 		"%s(): " fmt "\n", __func__, ## args)
diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
index 8991e8327d68..f5f2455413f0 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
@@ -10,6 +10,7 @@ extern "C" {
 #endif
 
 extern int dpaa2_cmdif_logtype;
+#define RTE_LOGTYPE_DPAA2_CMDIF dpaa2_cmdif_logtype
 
 #define DPAA2_CMDIF_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa2_cmdif_logtype, "dpaa2_cmdif: " \
@@ -30,7 +31,7 @@ extern int dpaa2_cmdif_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_CMDIF_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "dpaa2_cmdif: " fmt "\n", ## args)
+	RTE_LOG_DP(level, DPAA2_CMDIF, "dpaa2_cmdif: " fmt "\n", ## args)
 
 #define DPAA2_CMDIF_DP_DEBUG(fmt, args...) \
 	DPAA2_CMDIF_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h b/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
index 33041c907e19..62c5666ca948 100644
--- a/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
+++ b/drivers/raw/ifpga/base/osdep_rte/osdep_generic.h
@@ -16,8 +16,11 @@
 #include <rte_byteorder.h>
 #include <rte_memcpy.h>
 
+extern int ifpga_rawdev_logtype;
+#define RTE_LOGTYPE_IFPGA_RAWDEV ifpga_rawdev_logtype
+
 #define dev_printf(level, fmt, args...) \
-	RTE_LOG(level, PMD, "osdep_rte: " fmt, ## args)
+	RTE_LOG(level, IFPGA_RAWDEV, "osdep_rte: " fmt, ## args)
 
 #define osdep_panic(...) rte_panic(...)
 
diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c
index 53e982a52e9d..8479172bfa53 100644
--- a/drivers/vdpa/ifc/base/ifcvf.c
+++ b/drivers/vdpa/ifc/base/ifcvf.c
@@ -224,10 +224,10 @@ ifcvf_enable_mq(struct ifcvf_hw *hw)
 	if (mq_cfg) {
 		if (hw->device_type == IFCVF_BLK) {
 			*(u32 *)mq_cfg = nr_queue;
-			RTE_LOG(INFO, PMD, "%d queues are enabled\n", nr_queue);
+			RTE_LOG(INFO, IFCVF_VDPA, "%d queues are enabled\n", nr_queue);
 		} else {
 			*(u32 *)mq_cfg = nr_queue / 2;
-			RTE_LOG(INFO, PMD, "%d queue pairs are enabled\n",
+			RTE_LOG(INFO, IFCVF_VDPA, "%d queue pairs are enabled\n",
 				nr_queue / 2);
 		}
 	}
@@ -246,7 +246,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
 
 	cfg = hw->common_cfg;
 	if (!cfg) {
-		RTE_LOG(ERR, PMD, "common_cfg in HW is NULL.\n");
+		RTE_LOG(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.\n");
 		return -1;
 	}
 
@@ -258,7 +258,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
 		IFCVF_WRITE_REG16(i + 1, &cfg->queue_msix_vector);
 		msix_vector = IFCVF_READ_REG16(&cfg->queue_msix_vector);
 		if (msix_vector == IFCVF_MSI_NO_VECTOR) {
-			RTE_LOG(ERR, PMD, "queue %d, msix vec alloc failed\n",
+			RTE_LOG(ERR, IFCVF_VDPA, "queue %d, msix vec alloc failed\n",
 				i);
 			return -1;
 		}
@@ -307,7 +307,7 @@ ifcvf_disable_vring_hw(struct ifcvf_hw *hw, int i)
 
 	cfg = hw->common_cfg;
 	if (!cfg) {
-		RTE_LOG(ERR, PMD, "common_cfg in HW is NULL.\n");
+		RTE_LOG(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.\n");
 		return;
 	}
 
diff --git a/drivers/vdpa/ifc/base/ifcvf_osdep.h b/drivers/vdpa/ifc/base/ifcvf_osdep.h
index dd2ff08f77cc..ba7d684c25bc 100644
--- a/drivers/vdpa/ifc/base/ifcvf_osdep.h
+++ b/drivers/vdpa/ifc/base/ifcvf_osdep.h
@@ -13,8 +13,11 @@
 #include <rte_log.h>
 #include <rte_io.h>
 
-#define WARNINGOUT(S, args...)  RTE_LOG(WARNING, PMD, S, ##args)
-#define DEBUGOUT(S, args...)    RTE_LOG(DEBUG, PMD, S, ##args)
+extern int ifcvf_vdpa_logtype;
+#define RTE_LOGTYPE_IFCVF_VDPA ifcvf_vdpa_logtype
+
+#define WARNINGOUT(S, args...)  RTE_LOG(WARNING, IFCVF_VDPA, S, ##args)
+#define DEBUGOUT(S, args...)    RTE_LOG(DEBUG, IFCVF_VDPA, S, ##args)
 #define STATIC                  static
 
 #define msec_delay(x)	rte_delay_us_sleep(1000 * (x))
-- 
2.43.0


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

* [PATCH v6 02/20] common/sfc_efx: remove use of PMD logtype
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 01/20] drivers: use dedicated logtypes Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 03/20] mempool/dpaa2: use driver logtype not PMD Stephen Hemminger
                     ` (18 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Andrew Rybchenko

This code was implemented in a slightly different manner
than all the other logging code (for no good reason).
Make it the same and handle errors in same way as
other drivers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/sfc_efx/sfc_efx.c     | 11 ++---------
 drivers/common/sfc_efx/sfc_efx_log.h |  2 +-
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/common/sfc_efx/sfc_efx.c b/drivers/common/sfc_efx/sfc_efx.c
index 2dc5545760b8..5eeffb065b0d 100644
--- a/drivers/common/sfc_efx/sfc_efx.c
+++ b/drivers/common/sfc_efx/sfc_efx.c
@@ -15,7 +15,7 @@
 #include "sfc_efx_log.h"
 #include "sfc_efx.h"
 
-uint32_t sfc_efx_logtype;
+int sfc_efx_logtype;
 
 static int
 sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,
 	return rc;
 }
 
-RTE_INIT(sfc_efx_register_logtype)
-{
-	int ret;
-
-	ret = rte_log_register_type_and_pick_level("pmd.common.sfc_efx",
-						   RTE_LOG_NOTICE);
-	sfc_efx_logtype = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
-}
+RTE_LOG_REGISTER_DEFAULT(sfc_efx_logtype, NOTICE);
diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h
index 694455c1b14e..1519ebdc175f 100644
--- a/drivers/common/sfc_efx/sfc_efx_log.h
+++ b/drivers/common/sfc_efx/sfc_efx_log.h
@@ -11,7 +11,7 @@
 #define _SFC_EFX_LOG_H_
 
 /** Generic driver log type */
-extern uint32_t sfc_efx_logtype;
+extern int sfc_efx_logtype;
 
 /** Log message, add a prefix and a line break */
 #define SFC_EFX_LOG(level, ...) \
-- 
2.43.0


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

* [PATCH v6 03/20] mempool/dpaa2: use driver logtype not PMD
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 01/20] drivers: use dedicated logtypes Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 02/20] common/sfc_efx: remove use of PMD logtype Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 04/20] net/dpaa: use dedicated " Stephen Hemminger
                     ` (17 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena, Shreyansh Jain,
	Nipun Gupta

The driver already has macros for logging, use them.
Fixes: 7ed359909556 ("mempool/dpaa2: add functions for CMDIF")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 84371d5d1abb..4c9245cb814c 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_ERR("DPAA2 buffer pool not configured");
 		return -ENOMEM;
 	}
 
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr)
 
 	bp_info = mempool_to_bpinfo(mp);
 	if (!(bp_info->bp_list)) {
-		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		DPAA2_MEMPOOL_ERR("DPAA2 buffer pool not configured");
 		return NULL;
 	}
 
-- 
2.43.0


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

* [PATCH v6 04/20] net/dpaa: use dedicated logtype not PMD
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (2 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 03/20] mempool/dpaa2: use driver logtype not PMD Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 05/20] net/dpaa2: used " Stephen Hemminger
                     ` (16 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena, Nipun Gupta,
	Aman Singh, Ferruh Yigit

The driver already has a logtype, but was not used in couple
places.

Fixes: 6b10d1f7bdea ("net/dpaa: update process specific device info")
Fixes: c2c4f87b1259 ("net: add macro for MAC address print")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa/dpaa_ethdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index ef4c06db6a4d..2b497694cb02 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -2096,8 +2096,8 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 	/* copy the primary mac address */
 	rte_ether_addr_copy(&fman_intf->mac_addr, &eth_dev->data->mac_addrs[0]);
 
-	RTE_LOG(INFO, PMD, "net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n",
-		dpaa_device->name, RTE_ETHER_ADDR_BYTES(&fman_intf->mac_addr));
+	DPAA_PMD_INFO("net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT,
+		      dpaa_device->name, RTE_ETHER_ADDR_BYTES(&fman_intf->mac_addr));
 
 	if (!fman_intf->is_shared_mac) {
 		/* Configure error packet handling */
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 
 		ret = dpaa_dev_init_secondary(eth_dev);
 		if (ret != 0) {
-			RTE_LOG(ERR, PMD, "secondary dev init failed\n");
+			DPAA_PMD_ERR("secondary dev init failed");
 			return ret;
 		}
 
@@ -2182,7 +2182,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 
 		if (!(default_q || fmc_q)) {
 			if (dpaa_fm_init()) {
-				DPAA_PMD_ERR("FM init failed\n");
+				DPAA_PMD_ERR("FM init failed");
 				return -1;
 			}
 		}
-- 
2.43.0


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

* [PATCH v6 05/20] net/dpaa2: used dedicated logtype not PMD
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (3 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 04/20] net/dpaa: use dedicated " Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-23  0:53     ` [EXT] " Jun Yang
  2023-12-22 17:11   ` [PATCH v6 06/20] net/mrvl: do not use PMD logtype Stephen Hemminger
                     ` (15 subsequent siblings)
  20 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena, Jun Yang

The driver has a logtype, but was not being used in one place.

Fixes: f023d059769f ("net/dpaa2: support recycle loopback port")
Fixes: 72ec7a678e70 ("net/dpaa2: add soft parser driver")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa2/dpaa2_ethdev.c  | 2 +-
 drivers/net/dpaa2/dpaa2_sparser.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 8e610b6bba30..91846fcd2f23 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 			return ret;
 		}
 	}
-	RTE_LOG(INFO, PMD, "%s: netdev created, connected to %s\n",
+	DPAA2_PMD_INFO("%s: netdev created, connected to %s",
 		eth_dev->data->name, dpaa2_dev->ep_name);
 
 	return 0;
diff --git a/drivers/net/dpaa2/dpaa2_sparser.c b/drivers/net/dpaa2/dpaa2_sparser.c
index 63463c4fbfd6..36a14526a5c5 100644
--- a/drivers/net/dpaa2/dpaa2_sparser.c
+++ b/drivers/net/dpaa2/dpaa2_sparser.c
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 
 	priv->ss_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(addr));
 	priv->ss_offset += sp_param.size;
-	RTE_LOG(INFO, PMD, "Soft parser loaded for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser loaded for dpni@%d", priv->hw_id);
 
 	rte_free(addr);
 	return 0;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv,
 	}
 
 	rte_free(param_addr);
-	RTE_LOG(INFO, PMD, "Soft parser enabled for dpni@%d\n", priv->hw_id);
+	DPAA2_PMD_INFO("Soft parser enabled for dpni@%d", priv->hw_id);
 	return 0;
 }
-- 
2.43.0


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

* [PATCH v6 06/20] net/mrvl: do not use PMD logtype
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (4 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 05/20] net/dpaa2: used " Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 07/20] net/mvpp2: use dedicated logtype Stephen Hemminger
                     ` (14 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Liron Himi, Yelena Krivosheev, Natalie Samsonov

Use the same logtype as other places in the driver.

Fixes: 9e79d810911d ("net/mvpp2: support Tx scatter/gather")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index c12364941d62..1ca13e8b89d7 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -2976,8 +2976,7 @@ mrvl_tx_sg_pkt_burst(void *txq, struct rte_mbuf **tx_pkts,
 		 */
 		if (nb_segs > PP2_PPIO_DESC_NUM_FRAGS) {
 			total_descs -= nb_segs;
-			RTE_LOG(ERR, PMD,
-				"Too many segments. Packet won't be sent.\n");
+			MRVL_LOG(ERR, "Too many segments. Packet won't be sent.");
 			break;
 		}
 
-- 
2.43.0


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

* [PATCH v6 07/20] net/mvpp2: use dedicated logtype
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (5 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 06/20] net/mrvl: do not use PMD logtype Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 08/20] net/nfb: use dynamic logtype Stephen Hemminger
                     ` (13 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Liron Himi, Natalie Samsonov, Yelena Krivosheev

Always use the dedicated logtype, not PMD.

Fixes: 9e79d810911d ("net/mvpp2: support Tx scatter/gather")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 1ca13e8b89d7..a91509d92afb 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)
 
 	/* Use a simple Tx queue (no offloads, no multi segs) if possible */
 	if (priv->multiseg) {
-		RTE_LOG(INFO, PMD, "Using multi-segment tx callback\n");
+		MRVL_LOG(INFO, "Using multi-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst;
 	} else {
-		RTE_LOG(INFO, PMD, "Using single-segment tx callback\n");
+		MRVL_LOG(INFO, "Using single-segment tx callback");
 		dev->tx_pkt_burst = mrvl_tx_pkt_burst;
 	}
 }
-- 
2.43.0


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

* [PATCH v6 08/20] net/nfb: use dynamic logtype
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (6 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 07/20] net/mvpp2: use dedicated logtype Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2024-01-12 13:57     ` Martin Spinler
  2023-12-22 17:11   ` [PATCH v6 09/20] net/vmxnet3: used dedicated logtype not PMD Stephen Hemminger
                     ` (12 subsequent siblings)
  20 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Martin Spinler, Rastislav Cernay

All drivers should be using dynamic logtype.

Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/nfb/nfb.h        |  5 +++++
 drivers/net/nfb/nfb_ethdev.c | 24 ++++++++++--------------
 drivers/net/nfb/nfb_rx.c     |  9 ++++-----
 drivers/net/nfb/nfb_rx.h     |  2 +-
 drivers/net/nfb/nfb_tx.c     |  9 ++++-----
 drivers/net/nfb/nfb_tx.h     |  2 +-
 6 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/net/nfb/nfb.h b/drivers/net/nfb/nfb.h
index 7dc5bd29e44c..45226ee3d938 100644
--- a/drivers/net/nfb/nfb.h
+++ b/drivers/net/nfb/nfb.h
@@ -12,6 +12,11 @@
 #include <netcope/rxmac.h>
 #include <netcope/txmac.h>
 
+extern int nfb_logtype;
+#define NFB_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, nfb_logtype, "%s(): " fmt "\n", \
+		__func__, ## args)
+
 #include "nfb_rx.h"
 #include "nfb_tx.h"
 
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index defd118bd0ee..e533144efe5d 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -12,11 +12,9 @@
 #include <ethdev_pci.h>
 #include <rte_kvargs.h>
 
+#include "nfb.h"
 #include "nfb_stats.h"
-#include "nfb_rx.h"
-#include "nfb_tx.h"
 #include "nfb_rxmode.h"
-#include "nfb.h"
 
 /**
  * Default MAC addr
@@ -192,8 +190,7 @@ nfb_eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
 				(&nfb_timestamp_dynfield_offset,
 				&nfb_timestamp_rx_dynflag);
 		if (ret != 0) {
-			RTE_LOG(ERR, PMD, "Cannot register Rx timestamp"
-					" field/flag %d\n", ret);
+			NFB_LOG(ERR, "Cannot register Rx timestamp field/flag %d", ret);
 			nfb_close(internals->nfb);
 			return -rte_errno;
 		}
@@ -520,7 +517,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 	struct rte_ether_addr eth_addr_init;
 	struct rte_kvargs *kvlist;
 
-	RTE_LOG(INFO, PMD, "Initializing NFB device (" PCI_PRI_FMT ")\n",
+	NFB_LOG(INFO, "Initializing NFB device (" PCI_PRI_FMT ")",
 		pci_addr->domain, pci_addr->bus, pci_addr->devid,
 		pci_addr->function);
 
@@ -536,7 +533,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 		kvlist = rte_kvargs_parse(dev->device->devargs->args,
 						VALID_KEYS);
 		if (kvlist == NULL) {
-			RTE_LOG(ERR, PMD, "Failed to parse device arguments %s",
+			NFB_LOG(ERR, "Failed to parse device arguments %s",
 				dev->device->devargs->args);
 			rte_kvargs_free(kvlist);
 			return -EINVAL;
@@ -551,14 +548,14 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 	 */
 	internals->nfb = nfb_open(internals->nfb_dev);
 	if (internals->nfb == NULL) {
-		RTE_LOG(ERR, PMD, "nfb_open(): failed to open %s",
+		NFB_LOG(ERR, "nfb_open(): failed to open %s",
 			internals->nfb_dev);
 		return -EINVAL;
 	}
 	data->nb_rx_queues = ndp_get_rx_queue_available_count(internals->nfb);
 	data->nb_tx_queues = ndp_get_tx_queue_available_count(internals->nfb);
 
-	RTE_LOG(INFO, PMD, "Available NDP queues RX: %u TX: %u\n",
+	NFB_LOG(INFO, "Available NDP queues RX: %u TX: %u\n",
 		data->nb_rx_queues, data->nb_tx_queues);
 
 	nfb_nc_rxmac_init(internals->nfb,
@@ -583,7 +580,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 	data->mac_addrs = rte_zmalloc(data->name,
 		sizeof(struct rte_ether_addr) * mac_count, RTE_CACHE_LINE_SIZE);
 	if (data->mac_addrs == NULL) {
-		RTE_LOG(ERR, PMD, "Could not alloc space for MAC address!\n");
+		NFB_LOG(ERR, "Could not alloc space for MAC address");
 		nfb_close(internals->nfb);
 		return -EINVAL;
 	}
@@ -601,8 +598,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
 
 	dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 
-	RTE_LOG(INFO, PMD, "NFB device ("
-		PCI_PRI_FMT ") successfully initialized\n",
+	NFB_LOG(INFO, "NFB device (" PCI_PRI_FMT ") successfully initialized",
 		pci_addr->domain, pci_addr->bus, pci_addr->devid,
 		pci_addr->function);
 
@@ -626,8 +622,7 @@ nfb_eth_dev_uninit(struct rte_eth_dev *dev)
 
 	nfb_eth_dev_close(dev);
 
-	RTE_LOG(INFO, PMD, "NFB device ("
-		PCI_PRI_FMT ") successfully uninitialized\n",
+	NFB_LOG(INFO, "NFB device (" PCI_PRI_FMT ") successfully uninitialized",
 		pci_addr->domain, pci_addr->bus, pci_addr->devid,
 		pci_addr->function);
 
@@ -690,3 +685,4 @@ static struct rte_pci_driver nfb_eth_driver = {
 RTE_PMD_REGISTER_PCI(RTE_NFB_DRIVER_NAME, nfb_eth_driver);
 RTE_PMD_REGISTER_PCI_TABLE(RTE_NFB_DRIVER_NAME, nfb_pci_id_table);
 RTE_PMD_REGISTER_KMOD_DEP(RTE_NFB_DRIVER_NAME, "* nfb");
+RTE_LOG_REGISTER_DEFAULT(nfb_logtype, NOTICE);
diff --git a/drivers/net/nfb/nfb_rx.c b/drivers/net/nfb/nfb_rx.c
index 8a9b232305f2..a20f7b9b4b41 100644
--- a/drivers/net/nfb/nfb_rx.c
+++ b/drivers/net/nfb/nfb_rx.c
@@ -6,7 +6,6 @@
 
 #include <rte_kvargs.h>
 
-#include "nfb_rx.h"
 #include "nfb.h"
 
 uint64_t nfb_timestamp_rx_dynflag;
@@ -19,7 +18,7 @@ nfb_eth_rx_queue_start(struct rte_eth_dev *dev, uint16_t rxq_id)
 	int ret;
 
 	if (rxq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "RX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -40,7 +39,7 @@ nfb_eth_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rxq_id)
 	int ret;
 
 	if (rxq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "RX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -70,8 +69,8 @@ nfb_eth_rx_queue_setup(struct rte_eth_dev *dev,
 			RTE_CACHE_LINE_SIZE, socket_id);
 
 	if (rxq == NULL) {
-		RTE_LOG(ERR, PMD, "rte_zmalloc_socket() failed for rx queue id "
-				"%" PRIu16 "!\n", rx_queue_id);
+		NFB_LOG(ERR, "rte_zmalloc_socket() failed for rx queue id %" PRIu16,
+			rx_queue_id);
 		return -ENOMEM;
 	}
 
diff --git a/drivers/net/nfb/nfb_rx.h b/drivers/net/nfb/nfb_rx.h
index b618682e1393..2802f17091a0 100644
--- a/drivers/net/nfb/nfb_rx.h
+++ b/drivers/net/nfb/nfb_rx.h
@@ -156,7 +156,7 @@ nfb_eth_ndp_rx(void *queue,
 	struct rte_mbuf *mbufs[nb_pkts];
 
 	if (unlikely(ndp->queue == NULL || nb_pkts == 0)) {
-		RTE_LOG(ERR, PMD, "RX invalid arguments!\n");
+		NFB_LOG(ERR, "RX invalid arguments");
 		return 0;
 	}
 
diff --git a/drivers/net/nfb/nfb_tx.c b/drivers/net/nfb/nfb_tx.c
index d49fc324e76b..0cc2f596301a 100644
--- a/drivers/net/nfb/nfb_tx.c
+++ b/drivers/net/nfb/nfb_tx.c
@@ -4,7 +4,6 @@
  * All rights reserved.
  */
 
-#include "nfb_tx.h"
 #include "nfb.h"
 
 int
@@ -14,7 +13,7 @@ nfb_eth_tx_queue_start(struct rte_eth_dev *dev, uint16_t txq_id)
 	int ret;
 
 	if (txq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "RX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -35,7 +34,7 @@ nfb_eth_tx_queue_stop(struct rte_eth_dev *dev, uint16_t txq_id)
 	int ret;
 
 	if (txq->queue == NULL) {
-		RTE_LOG(ERR, PMD, "TX NDP queue is NULL!\n");
+		NFB_LOG(ERR, "TX NDP queue is NULL");
 		return -EINVAL;
 	}
 
@@ -62,8 +61,8 @@ nfb_eth_tx_queue_setup(struct rte_eth_dev *dev,
 		RTE_CACHE_LINE_SIZE, socket_id);
 
 	if (txq == NULL) {
-		RTE_LOG(ERR, PMD, "rte_zmalloc_socket() failed for tx queue id "
-			"%" PRIu16 "!\n", tx_queue_id);
+		NFB_LOG(ERR, "rte_zmalloc_socket() failed for tx queue id %" PRIu16,
+			tx_queue_id);
 		return -ENOMEM;
 	}
 
diff --git a/drivers/net/nfb/nfb_tx.h b/drivers/net/nfb/nfb_tx.h
index 910020e9e96f..f107cf914bbd 100644
--- a/drivers/net/nfb/nfb_tx.h
+++ b/drivers/net/nfb/nfb_tx.h
@@ -140,7 +140,7 @@ nfb_eth_ndp_tx(void *queue,
 		return 0;
 
 	if (unlikely(ndp->queue == NULL)) {
-		RTE_LOG(ERR, PMD, "TX invalid arguments!\n");
+		NFB_LOG(ERR, "TX invalid arguments");
 		return 0;
 	}
 
-- 
2.43.0


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

* [PATCH v6 09/20] net/vmxnet3: used dedicated logtype not PMD
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (7 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 08/20] net/nfb: use dynamic logtype Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 10/20] raw/cnxk: replace PMD logtype with dynamic type Stephen Hemminger
                     ` (11 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Jochen Behrens, Yong Wang

The driver has log macros, just not used in one place.

Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index e49191718aea..4fd704045fc4 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)
 	if (events == 0)
 		goto done;
 
-	RTE_LOG(DEBUG, PMD, "Reading events: 0x%X", events);
+	PMD_DRV_LOG(DEBUG, "Reading events: 0x%X", events);
 	vmxnet3_process_events(dev);
 done:
 	vmxnet3_enable_intr(hw, *eventIntrIdx);
-- 
2.43.0


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

* [PATCH v6 10/20] raw/cnxk: replace PMD logtype with dynamic type
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (8 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 09/20] net/vmxnet3: used dedicated logtype not PMD Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 11/20] crypto/scheduler: replace use of logtype PMD Stephen Hemminger
                     ` (10 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao, Jakub Palider, Tomasz Duszynski

Driver should not be using PMD logtype, they should have their
own logtype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/cnxk/roc_platform.h         | 16 ++++++-----
 drivers/raw/cnxk_bphy/cnxk_bphy.c          |  3 ++-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c      |  2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +++++++++++-----------
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h       |  6 +++++
 drivers/raw/cnxk_gpio/cnxk_gpio.c          | 21 ++++++++-------
 drivers/raw/cnxk_gpio/cnxk_gpio.h          |  5 ++++
 drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 17 ++++++------
 8 files changed, 57 insertions(+), 44 deletions(-)

diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index ba23b2e0d79e..9d2ea8f00965 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;
 extern int cnxk_logtype_ree;
 extern int cnxk_logtype_dpi;
 
+#define RTE_LOGTYPE_CNXK cnxk_logtype_base
+
 #define plt_err(fmt, args...)                                                  \
-	RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
-#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args)
-#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
+	RTE_LOG(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+#define plt_info(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)
+#define plt_warn(fmt, args...) RTE_LOG(WARNING, CNXK, fmt "\n", ##args)
+#define plt_print(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)
 #define plt_dump(fmt, ...)      fprintf(stderr, fmt "\n", ##__VA_ARGS__)
 #define plt_dump_no_nl(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
 
@@ -296,11 +298,11 @@ extern int cnxk_logtype_dpi;
 
 /* Datapath logs */
 #define plt_dp_err(fmt, args...)                                               \
-	RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
 #define plt_dp_info(fmt, args...)                                              \
-	RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP(INFO, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
 #define plt_dp_dbg(fmt, args...)                                              \
-	RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP(DEBUG, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
 
 #ifdef __cplusplus
 #define CNXK_PCI_ID(subsystem_dev, dev)                                        \
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
index 15dbc4c1a637..1dbab6fb3e12 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
@@ -251,7 +251,7 @@ cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev,
 
 	/* get rid of last response if any */
 	if (qp->rsp) {
-		RTE_LOG(WARNING, PMD, "Previous response got overwritten\n");
+		CNXK_BPHY_LOG(WARNING, "Previous response got overwritten");
 		rte_free(qp->rsp);
 	}
 	qp->rsp = rsp;
@@ -410,3 +410,4 @@ static struct rte_pci_driver cnxk_bphy_rawdev_pmd = {
 RTE_PMD_REGISTER_PCI(bphy_rawdev_pci_driver, cnxk_bphy_rawdev_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(bphy_rawdev_pci_driver, pci_bphy_map);
 RTE_PMD_REGISTER_KMOD_DEP(bphy_rawdev_pci_driver, "vfio-pci");
+RTE_LOG_REGISTER_SUFFIX(cnxk_logtype_bphy, bphy, INFO);
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
index 2d8466ef918b..4358aeecc3e5 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
@@ -189,7 +189,7 @@ cnxk_bphy_cgx_process_buf(struct cnxk_bphy_cgx *cgx, unsigned int queue,
 
 	/* get rid of last response if any */
 	if (qp->rsp) {
-		RTE_LOG(WARNING, PMD, "Previous response got overwritten\n");
+		CNXK_BPHY_LOG(WARNING, "Previous response got overwritten");
 		rte_free(qp->rsp);
 	}
 	qp->rsp = rsp;
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
index a3021b4bb7db..f01d958661ad 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
@@ -57,62 +57,61 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)
 		if (ret)
 			break;
 		if (descs != 1) {
-			RTE_LOG(ERR, PMD, "Wrong number of descs reported\n");
+			CNXK_BPHY_LOG(ERR, "Wrong number of descs reported");
 			ret = -ENODEV;
 			break;
 		}
 
-		RTE_LOG(INFO, PMD, "Testing queue %d\n", i);
+		CNXK_BPHY_LOG(INFO, "Testing queue %d", i);
 
 		ret = rte_pmd_bphy_cgx_stop_rxtx(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to stop rx/tx\n");
+			CNXK_BPHY_LOG(ERR, "Failed to stop rx/tx");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_start_rxtx(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to start rx/tx\n");
+			CNXK_BPHY_LOG(ERR, "Failed to start rx/tx");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_set_link_state(dev_id, i, false);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set link down\n");
+			CNXK_BPHY_LOG(ERR, "Failed to set link down");
 			break;
 		}
 
 		ret = cnxk_bphy_cgx_link_cond(dev_id, i, 0);
 		if (ret != 0)
-			RTE_LOG(ERR, PMD,
-				"Timed out waiting for a link down\n");
+			CNXK_BPHY_LOG(ERR, "Timed out waiting for a link down");
 
 		ret = rte_pmd_bphy_cgx_set_link_state(dev_id, i, true);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set link up\n");
+			CNXK_BPHY_LOG(ERR, "Failed to set link up");
 			break;
 		}
 
 		ret = cnxk_bphy_cgx_link_cond(dev_id, i, 1);
 		if (ret != 1)
-			RTE_LOG(ERR, PMD, "Timed out waiting for a link up\n");
+			CNXK_BPHY_LOG(ERR, "Timed out waiting for a link up");
 
 		ret = rte_pmd_bphy_cgx_intlbk_enable(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to enable internal lbk\n");
+			CNXK_BPHY_LOG(ERR, "Failed to enable internal lbk");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_intlbk_disable(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to disable internal lbk\n");
+			CNXK_BPHY_LOG(ERR, "Failed to disable internal lbk");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_ptp_rx_enable(dev_id, i);
 		/* ptp not available on RPM */
 		if (ret < 0 && ret != -ENOTSUP) {
-			RTE_LOG(ERR, PMD, "Failed to enable ptp\n");
+			CNXK_BPHY_LOG(ERR, "Failed to enable ptp");
 			break;
 		}
 		ret = 0;
@@ -120,27 +119,27 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)
 		ret = rte_pmd_bphy_cgx_ptp_rx_disable(dev_id, i);
 		/* ptp not available on RPM */
 		if (ret < 0 && ret != -ENOTSUP) {
-			RTE_LOG(ERR, PMD, "Failed to disable ptp\n");
+			CNXK_BPHY_LOG(ERR, "Failed to disable ptp");
 			break;
 		}
 		ret = 0;
 
 		ret = rte_pmd_bphy_cgx_get_supported_fec(dev_id, i, &fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to get supported FEC\n");
+			CNXK_BPHY_LOG(ERR, "Failed to get supported FEC");
 			break;
 		}
 
 		ret = rte_pmd_bphy_cgx_set_fec(dev_id, i, fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to set FEC to %d\n", fec);
+			CNXK_BPHY_LOG(ERR, "Failed to set FEC to %d", fec);
 			break;
 		}
 
 		fec = CNXK_BPHY_CGX_ETH_LINK_FEC_NONE;
 		ret = rte_pmd_bphy_cgx_set_fec(dev_id, i, fec);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Failed to disable FEC\n");
+			CNXK_BPHY_LOG(ERR, "Failed to disable FEC");
 			break;
 		}
 	}
diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
index 9d8d0285581b..7a7d9f6fa66f 100644
--- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
+++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
@@ -26,6 +26,12 @@
 extern "C" {
 #endif
 
+extern int cnxk_logtype_bphy;
+
+#define CNXK_BPHY_LOG(level, fmt, args...)	\
+	rte_log(RTE_LOG_ ## level, cnxk_logtype_bphy, \
+		"%s(): " fmt "\n", __func__, ## args)
+
 /** Available message types */
 enum cnxk_bphy_cgx_msg_type {
 	/** Type used to obtain link information */
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.c b/drivers/raw/cnxk_gpio/cnxk_gpio.c
index 3c4d79e4810e..329ac28a2736 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.c
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.c
@@ -215,13 +215,13 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)
 		errno = 0;
 		val = strtol(token, NULL, 10);
 		if (errno) {
-			RTE_LOG(ERR, PMD, "failed to parse %s\n", token);
+			CNXK_GPIO_LOG(ERR, "failed to parse %s", token);
 			ret = -errno;
 			goto out;
 		}
 
 		if (val < 0 || val >= gpiochip->num_gpios) {
-			RTE_LOG(ERR, PMD, "gpio%d out of 0-%d range\n", val,
+			CNXK_GPIO_LOG(ERR, "gpio%d out of 0-%d range", val,
 				gpiochip->num_gpios - 1);
 			ret = -EINVAL;
 			goto out;
@@ -231,7 +231,7 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)
 			if (list[i] != val)
 				continue;
 
-			RTE_LOG(WARNING, PMD, "gpio%d already allowed\n", val);
+			CNXK_GPIO_LOG(WARNING, "gpio%d already allowed", val);
 			break;
 		}
 		if (i == queue)
@@ -398,7 +398,7 @@ cnxk_gpio_queue_setup(struct rte_rawdev *dev, uint16_t queue_id,
 			return ret;
 		}
 	} else {
-		RTE_LOG(WARNING, PMD, "using existing gpio%d\n", gpio->num);
+		CNXK_GPIO_LOG(WARNING, "using existing gpio%d", gpio->num);
 	}
 
 	gpiochip->gpios[num] = gpio;
@@ -647,7 +647,7 @@ cnxk_gpio_process_buf(struct cnxk_gpio *gpio, struct rte_rawdev_buf *rbuf)
 
 	/* get rid of last response if any */
 	if (gpio->rsp) {
-		RTE_LOG(WARNING, PMD, "previous response got overwritten\n");
+		CNXK_GPIO_LOG(WARNING, "previous response got overwritten");
 		rte_free(gpio->rsp);
 	}
 	gpio->rsp = rsp;
@@ -741,7 +741,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	cnxk_gpio_format_name(name, sizeof(name));
 	rawdev = rte_rawdev_pmd_allocate(name, sizeof(*gpiochip), rte_socket_id());
 	if (!rawdev) {
-		RTE_LOG(ERR, PMD, "failed to allocate %s rawdev\n", name);
+		CNXK_GPIO_LOG(ERR, "failed to allocate %s rawdev", name);
 		return -ENOMEM;
 	}
 
@@ -770,7 +770,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	snprintf(buf, sizeof(buf), "%s/gpiochip%d/base", CNXK_GPIO_CLASS_PATH, gpiochip->num);
 	ret = cnxk_gpio_read_attr_int(buf, &gpiochip->base);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to read %s\n", buf);
+		CNXK_GPIO_LOG(ERR, "failed to read %s", buf);
 		goto out;
 	}
 
@@ -778,20 +778,20 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)
 	snprintf(buf, sizeof(buf), "%s/gpiochip%d/ngpio", CNXK_GPIO_CLASS_PATH, gpiochip->num);
 	ret = cnxk_gpio_read_attr_int(buf, &gpiochip->num_gpios);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to read %s\n", buf);
+		CNXK_GPIO_LOG(ERR, "failed to read %s", buf);
 		goto out;
 	}
 	gpiochip->num_queues = gpiochip->num_gpios;
 
 	ret = cnxk_gpio_parse_allowlist(gpiochip, params->allowlist);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "failed to parse allowed gpios\n");
+		CNXK_GPIO_LOG(ERR, "failed to parse allowed gpios");
 		goto out;
 	}
 
 	gpiochip->gpios = rte_calloc(NULL, gpiochip->num_gpios, sizeof(struct cnxk_gpio *), 0);
 	if (!gpiochip->gpios) {
-		RTE_LOG(ERR, PMD, "failed to allocate gpios memory\n");
+		CNXK_GPIO_LOG(ERR, "failed to allocate gpios memory");
 		ret = -ENOMEM;
 		goto out;
 	}
@@ -851,3 +851,4 @@ RTE_PMD_REGISTER_VDEV(cnxk_gpio, cnxk_gpio_drv);
 RTE_PMD_REGISTER_PARAM_STRING(cnxk_gpio,
 		"gpiochip=<int> "
 		"allowlist=<list>");
+RTE_LOG_REGISTER_SUFFIX(cnxk_logtype_gpio, gpio, INFO);
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.h b/drivers/raw/cnxk_gpio/cnxk_gpio.h
index e62f78a7604a..336d7ac373d7 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.h
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.h
@@ -5,6 +5,11 @@
 #ifndef _CNXK_GPIO_H_
 #define _CNXK_GPIO_H_
 
+extern int cnxk_logtype_gpio;
+
+#define CNXK_GPIO_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, cnxk_logtype_gpio, fmt "\n", ## args)
+
 struct cnxk_gpiochip;
 
 struct cnxk_gpio {
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c b/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
index 10742b5dc48a..2f3973a7b5e6 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c
@@ -56,7 +56,7 @@ cnxk_gpio_read_attr(char *attr, char *val)
 
 #define CNXK_GPIO_ERR_STR(err, str, ...) do {                                  \
 	if (err) {                                                             \
-		RTE_LOG(ERR, PMD, "%s:%d: " str " (%d)\n", __func__, __LINE__, \
+		CNXK_GPIO_LOG(ERR, "%s:%d: " str " (%d)", __func__, __LINE__, \
 			##__VA_ARGS__, err);                                   \
 		goto out;                                                      \
 	}                                                                      \
@@ -330,30 +330,29 @@ cnxk_gpio_selftest(uint16_t dev_id)
 	for (i = 0; i < queues; i++) {
 		ret = rte_rawdev_queue_conf_get(dev_id, i, &conf, sizeof(conf));
 		if (ret) {
-			RTE_LOG(ERR, PMD,
-				"failed to read queue configuration (%d)\n",
+			CNXK_GPIO_LOG(ERR, "failed to read queue configuration (%d)",
 				ret);
 			goto out;
 		}
 
-		RTE_LOG(INFO, PMD, "testing queue%d (gpio%d)\n", i, conf.gpio);
+		CNXK_GPIO_LOG(INFO, "testing queue%d (gpio%d)", i, conf.gpio);
 
 		if (conf.size != 1) {
-			RTE_LOG(ERR, PMD, "wrong queue size received\n");
+			CNXK_GPIO_LOG(ERR, "wrong queue size received");
 			ret = -EIO;
 			goto out;
 		}
 
 		ret = rte_rawdev_queue_setup(dev_id, i, NULL, 0);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "failed to setup queue (%d)\n", ret);
+			CNXK_GPIO_LOG(ERR, "failed to setup queue (%d)", ret);
 			goto out;
 		}
 
 		gpio = gpiochip->gpios[conf.gpio];
 		snprintf(buf, sizeof(buf), CNXK_GPIO_PATH_FMT, gpio->num);
 		if (!cnxk_gpio_attr_exists(buf)) {
-			RTE_LOG(ERR, PMD, "%s does not exist\n", buf);
+			CNXK_GPIO_LOG(ERR, "%s does not exist", buf);
 			ret = -ENOENT;
 			goto release;
 		}
@@ -371,13 +370,13 @@ cnxk_gpio_selftest(uint16_t dev_id)
 		ret2 = ret;
 		ret = rte_rawdev_queue_release(dev_id, i);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "failed to release queue (%d)\n",
+			CNXK_GPIO_LOG(ERR, "failed to release queue (%d)",
 				ret);
 			break;
 		}
 
 		if (cnxk_gpio_attr_exists(buf)) {
-			RTE_LOG(ERR, PMD, "%s still exists\n", buf);
+			CNXK_GPIO_LOG(ERR, "%s still exists", buf);
 			ret = -EIO;
 			break;
 		}
-- 
2.43.0


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

* [PATCH v6 11/20] crypto/scheduler: replace use of logtype PMD
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (9 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 10/20] raw/cnxk: replace PMD logtype with dynamic type Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 12/20] crypto/armv8: do not use PMD logtype Stephen Hemminger
                     ` (9 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Kai Ji, Fan Zhang

Driver has logging macro but not used everywhere.

Fixes: 6760463c9f26 ("crypto/scheduler: add mode-specific threshold parameter")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/scheduler/scheduler_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
index 589d092d7457..95ce893f0540 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -197,8 +197,8 @@ cryptodev_scheduler_create(const char *name,
 				return -EINVAL;
 			}
 
-			RTE_LOG(INFO, PMD, "  Sched mode param (%s = %s)\n",
-					param_name, param_val);
+			CR_SCHED_LOG(INFO, "  Sched mode param (%s = %s)",
+				     param_name, param_val);
 		}
 	}
 
-- 
2.43.0


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

* [PATCH v6 12/20] crypto/armv8: do not use PMD logtype
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (10 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 11/20] crypto/scheduler: replace use of logtype PMD Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:42     ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 13/20] crypto/ccp: " Stephen Hemminger
                     ` (8 subsequent siblings)
  20 siblings, 1 reply; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Ruifeng Wang, Jerin Jacob, Zbigniew Bodek

Driver already has logging macros, just not used in one place.

Fixes: 169ca3db550c ("crypto/armv8: add PMD optimized for ARMv8 processors")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/armv8/rte_armv8_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index 824a2cc7352a..3b7f45b46c33 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -833,8 +833,8 @@ cryptodev_armv8_crypto_uninit(struct rte_vdev_device *vdev)
 	if (name == NULL)
 		return -EINVAL;
 
-	RTE_LOG(INFO, PMD,
-		"Closing ARMv8 crypto device %s on numa socket %u\n",
+	ARVM8_CRYTPO_LOG_INFO(
+		"Closing ARMv8 crypto device %s on numa socket %u",
 		name, rte_socket_id());
 
 	cryptodev = rte_cryptodev_pmd_get_named_dev(name);
-- 
2.43.0


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

* [PATCH v6 13/20] crypto/ccp: do not use PMD logtype
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (11 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 12/20] crypto/armv8: do not use PMD logtype Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 14/20] crypto/caam_jr: use dedicated logtype Stephen Hemminger
                     ` (7 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Sunil Uttarwar, Ravi Kumar

This driver has logging macros but not used consistently.

Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/ccp/rte_ccp_pmd.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index a5271d72273d..46a9275e3743 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -194,8 +194,7 @@ cryptodev_ccp_remove(struct rte_pci_device *pci_dev)
 
 	ccp_pmd_init_done = 0;
 
-	RTE_LOG(INFO, PMD, "Closing ccp device %s on numa socket %u\n",
-			name, rte_socket_id());
+	CCP_LOG_INFO("Closing ccp device %s on numa socket %u", name, rte_socket_id());
 
 	return rte_cryptodev_pmd_destroy(dev);
 }
@@ -228,7 +227,7 @@ cryptodev_ccp_create(const char *name,
 	}
 	cryptodev_cnt++;
 
-	CCP_LOG_DBG("CCP : Crypto device count = %d\n", cryptodev_cnt);
+	CCP_LOG_DBG("CCP : Crypto device count = %d", cryptodev_cnt);
 	dev->device = &pci_dev->device;
 	dev->device->driver = &pci_drv->driver;
 	dev->driver_id = ccp_cryptodev_driver_id;
@@ -279,7 +278,7 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	};
 
 	if (ccp_pmd_init_done) {
-		RTE_LOG(INFO, PMD, "CCP PMD already initialized\n");
+		CCP_LOG_INFO("CCP PMD already initialized");
 		return -EFAULT;
 	}
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
@@ -288,11 +287,11 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	init_params.def_p.max_nb_queue_pairs = CCP_PMD_MAX_QUEUE_PAIRS;
 
-	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
+	CCP_LOG_INFO("Initialising %s on NUMA node %d", name,
 		init_params.def_p.socket_id);
-	RTE_LOG(INFO, PMD, "Max number of queue pairs = %d\n",
+	CCP_LOG_INFO("Max number of queue pairs = %d",
 		init_params.def_p.max_nb_queue_pairs);
-	RTE_LOG(INFO, PMD, "Authentication offload to %s\n",
+	CCP_LOG_INFO("Authentication offload to %s",
 		((init_params.auth_opt == 0) ? "CCP" : "CPU"));
 
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
-- 
2.43.0


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

* [PATCH v6 14/20] crypto/caam_jr: use dedicated logtype
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (12 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 13/20] crypto/ccp: " Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 15/20] crypto/dpaa_sec, crypto/dpaa2_sec: " Stephen Hemminger
                     ` (6 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal, Akhil Goyal

The driver has macro and logtype but not used in a couple places.
Also, remove extraneous newlines.

Fixes: af7c9b5e9ce7 ("crypto/caam_jr: introduce basic driver")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/caam_jr/caam_jr.c     | 46 +++++++++++++---------------
 drivers/crypto/caam_jr/caam_jr_log.h | 12 ++++----
 drivers/crypto/caam_jr/caam_jr_uio.c |  4 +--
 3 files changed, 29 insertions(+), 33 deletions(-)

diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index b55258689b49..d3b42d8e1b91 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -123,10 +123,8 @@ void caam_jr_stats_get(struct rte_cryptodev *dev,
 		stats->dequeued_count += qp[i]->rx_pkts;
 		stats->enqueue_err_count += qp[i]->tx_errs;
 		stats->dequeue_err_count += qp[i]->rx_errs;
-		CAAM_JR_INFO("extra stats:\n\tRX Poll ERR = %" PRIu64
-			     "\n\tTX Ring Full = %" PRIu64,
-			     qp[i]->rx_poll_err,
-			     qp[i]->tx_ring_full);
+		CAAM_JR_INFO("extra stats: RX Poll ERR = %" PRIu64 "TX Ring Full = %" PRIu64,
+			     qp[i]->rx_poll_err, qp[i]->tx_ring_full);
 	}
 }
 
@@ -309,7 +307,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses)
 
 	cdb = caam_jr_dma_mem_alloc(L1_CACHE_BYTES, sizeof(struct sec_cdb));
 	if (!cdb) {
-		CAAM_JR_ERR("failed to allocate memory for cdb\n");
+		CAAM_JR_ERR("failed to allocate memory for cdb");
 		return -1;
 	}
 
@@ -606,7 +604,7 @@ hw_poll_job_ring(struct sec_job_ring_t *job_ring,
 		/*TODO for multiple ops, packets*/
 		ctx = container_of(current_desc, struct caam_jr_op_ctx, jobdes);
 		if (unlikely(sec_error_code)) {
-			CAAM_JR_ERR("desc at cidx %d generated error 0x%x\n",
+			CAAM_JR_ERR("desc at cidx %d generated error 0x%x",
 				job_ring->cidx, sec_error_code);
 			hw_handle_job_ring_error(job_ring, sec_error_code);
 			//todo improve with exact errors
@@ -1368,7 +1366,7 @@ caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp)
 	}
 
 	if (unlikely(!ses->qp || ses->qp != qp)) {
-		CAAM_JR_DP_DEBUG("Old:sess->qp=%p New qp = %p\n", ses->qp, qp);
+		CAAM_JR_DP_DEBUG("Old:sess->qp=%p New qp = %p", ses->qp, qp);
 		ses->qp = qp;
 		caam_jr_prep_cdb(ses);
 	}
@@ -1554,7 +1552,7 @@ caam_jr_cipher_init(struct rte_cryptodev *dev __rte_unused,
 	session->cipher_key.data = rte_zmalloc(NULL, xform->cipher.key.length,
 					       RTE_CACHE_LINE_SIZE);
 	if (session->cipher_key.data == NULL && xform->cipher.key.length > 0) {
-		CAAM_JR_ERR("No Memory for cipher key\n");
+		CAAM_JR_ERR("No Memory for cipher key");
 		return -ENOMEM;
 	}
 	session->cipher_key.length = xform->cipher.key.length;
@@ -1576,7 +1574,7 @@ caam_jr_auth_init(struct rte_cryptodev *dev __rte_unused,
 	session->auth_key.data = rte_zmalloc(NULL, xform->auth.key.length,
 					     RTE_CACHE_LINE_SIZE);
 	if (session->auth_key.data == NULL && xform->auth.key.length > 0) {
-		CAAM_JR_ERR("No Memory for auth key\n");
+		CAAM_JR_ERR("No Memory for auth key");
 		return -ENOMEM;
 	}
 	session->auth_key.length = xform->auth.key.length;
@@ -1602,7 +1600,7 @@ caam_jr_aead_init(struct rte_cryptodev *dev __rte_unused,
 	session->aead_key.data = rte_zmalloc(NULL, xform->aead.key.length,
 					     RTE_CACHE_LINE_SIZE);
 	if (session->aead_key.data == NULL && xform->aead.key.length > 0) {
-		CAAM_JR_ERR("No Memory for aead key\n");
+		CAAM_JR_ERR("No Memory for aead key");
 		return -ENOMEM;
 	}
 	session->aead_key.length = xform->aead.key.length;
@@ -1755,7 +1753,7 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 					       RTE_CACHE_LINE_SIZE);
 	if (session->cipher_key.data == NULL &&
 			cipher_xform->key.length > 0) {
-		CAAM_JR_ERR("No Memory for cipher key\n");
+		CAAM_JR_ERR("No Memory for cipher key");
 		return -ENOMEM;
 	}
 
@@ -1765,7 +1763,7 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 					RTE_CACHE_LINE_SIZE);
 	if (session->auth_key.data == NULL &&
 			auth_xform->key.length > 0) {
-		CAAM_JR_ERR("No Memory for auth key\n");
+		CAAM_JR_ERR("No Memory for auth key");
 		rte_free(session->cipher_key.data);
 		return -ENOMEM;
 	}
@@ -1810,11 +1808,11 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 	case RTE_CRYPTO_AUTH_KASUMI_F9:
 	case RTE_CRYPTO_AUTH_AES_CBC_MAC:
 	case RTE_CRYPTO_AUTH_ZUC_EIA3:
-		CAAM_JR_ERR("Crypto: Unsupported auth alg %u\n",
+		CAAM_JR_ERR("Crypto: Unsupported auth alg %u",
 			auth_xform->algo);
 		goto out;
 	default:
-		CAAM_JR_ERR("Crypto: Undefined Auth specified %u\n",
+		CAAM_JR_ERR("Crypto: Undefined Auth specified %u",
 			auth_xform->algo);
 		goto out;
 	}
@@ -1834,11 +1832,11 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 	case RTE_CRYPTO_CIPHER_3DES_ECB:
 	case RTE_CRYPTO_CIPHER_AES_ECB:
 	case RTE_CRYPTO_CIPHER_KASUMI_F8:
-		CAAM_JR_ERR("Crypto: Unsupported Cipher alg %u\n",
+		CAAM_JR_ERR("Crypto: Unsupported Cipher alg %u",
 			cipher_xform->algo);
 		goto out;
 	default:
-		CAAM_JR_ERR("Crypto: Undefined Cipher specified %u\n",
+		CAAM_JR_ERR("Crypto: Undefined Cipher specified %u",
 			cipher_xform->algo);
 		goto out;
 	}
@@ -1962,7 +1960,7 @@ caam_jr_dev_configure(struct rte_cryptodev *dev,
 						NULL, NULL, NULL, NULL,
 						SOCKET_ID_ANY, 0);
 		if (!internals->ctx_pool) {
-			CAAM_JR_ERR("%s create failed\n", str);
+			CAAM_JR_ERR("%s create failed", str);
 			return -ENOMEM;
 		}
 	} else
@@ -2180,7 +2178,7 @@ init_job_ring(void *reg_base_addr, int irq_id)
 		}
 	}
 	if (job_ring == NULL) {
-		CAAM_JR_ERR("No free job ring\n");
+		CAAM_JR_ERR("No free job ring");
 		return NULL;
 	}
 
@@ -2301,7 +2299,7 @@ caam_jr_dev_init(const char *name,
 						job_ring->uio_fd);
 
 	if (!dev->data->dev_private) {
-		CAAM_JR_ERR("Ring memory allocation failed\n");
+		CAAM_JR_ERR("Ring memory allocation failed");
 		goto cleanup2;
 	}
 
@@ -2334,7 +2332,7 @@ caam_jr_dev_init(const char *name,
 	security_instance = rte_malloc("caam_jr",
 				sizeof(struct rte_security_ctx), 0);
 	if (security_instance == NULL) {
-		CAAM_JR_ERR("memory allocation failed\n");
+		CAAM_JR_ERR("memory allocation failed");
 		//todo error handling.
 		goto cleanup2;
 	}
@@ -2346,7 +2344,7 @@ caam_jr_dev_init(const char *name,
 
 	rte_cryptodev_pmd_probing_finish(dev);
 
-	RTE_LOG(INFO, PMD, "%s cryptodev init\n", dev->data->name);
+	CAAM_JR_INFO("%s cryptodev init", dev->data->name);
 
 	return 0;
 
@@ -2386,8 +2384,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev)
 
 	ret = of_init();
 	if (ret) {
-		RTE_LOG(ERR, PMD,
-		"of_init failed\n");
+		CAAM_JR_ERR("of_init failed");
 		return -EINVAL;
 	}
 	/* if sec device version is not configured */
@@ -2407,8 +2404,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev)
 	}
 #ifdef RTE_LIBRTE_PMD_CAAM_JR_BE
 	if (rta_get_sec_era() > RTA_SEC_ERA_8) {
-		RTE_LOG(ERR, PMD,
-		"CAAM is compiled in BE mode for device with sec era > 8???\n");
+		CAAM_JR_ERR("CAAM is compiled in BE mode for device with sec era > 8???");
 		return -EINVAL;
 	}
 #endif
diff --git a/drivers/crypto/caam_jr/caam_jr_log.h b/drivers/crypto/caam_jr/caam_jr_log.h
index 8f6aa50e2a4a..3d32b75e3a01 100644
--- a/drivers/crypto/caam_jr/caam_jr_log.h
+++ b/drivers/crypto/caam_jr/caam_jr_log.h
@@ -10,13 +10,13 @@
 extern int caam_jr_logtype;
 #define RTE_LOGTYPE_CAAM_JR caam_jr_logtype
 
-#define CAAM_JR_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \
-		fmt "\n", ##args)
+#define CAAM_JR_LOG(level, fmt, args...)		\
+	rte_log(RTE_LOG_ ## level, caam_jr_logtype,	\
+		"caam_jr: " fmt "\n", ##args)
 
-#define CAAM_JR_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, caam_jr_logtype, "caam_jr: %s(): " \
-		fmt "\n", __func__, ##args)
+#define CAAM_JR_DEBUG(fmt, args...)				\
+	rte_log(RTE_LOG_DEBUG, caam_jr_logtype,			\
+		"caam_jr: %s(): " fmt "\n", __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() CAAM_JR_DEBUG(" >>")
 
diff --git a/drivers/crypto/caam_jr/caam_jr_uio.c b/drivers/crypto/caam_jr/caam_jr_uio.c
index 583ba3b523af..4d9acfbe9196 100644
--- a/drivers/crypto/caam_jr/caam_jr_uio.c
+++ b/drivers/crypto/caam_jr/caam_jr_uio.c
@@ -338,7 +338,7 @@ free_job_ring(int uio_fd)
 	}
 
 	if (job_ring == NULL) {
-		CAAM_JR_ERR("JR not available for fd = %x\n", uio_fd);
+		CAAM_JR_ERR("JR not available for fd = %x", uio_fd);
 		return;
 	}
 
@@ -441,7 +441,7 @@ sec_configure(void)
 					dir->d_name, "name", uio_name);
 			CAAM_JR_INFO("sec device uio name: %s", uio_name);
 			if (ret != 0) {
-				CAAM_JR_ERR("file_read_first_line failed\n");
+				CAAM_JR_ERR("file_read_first_line failed");
 				closedir(d);
 				return -1;
 			}
-- 
2.43.0


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

* [PATCH v6 15/20] crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (13 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 14/20] crypto/caam_jr: use dedicated logtype Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 16/20] event/dlb2: " Stephen Hemminger
                     ` (5 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal, Akhil Goyal,
	Ashish Jain

A couple of messages were using RTE_LOGTYPE_PMD when dedicated
logtype was already available.

Fixes: fe3688ba7950 ("crypto/dpaa_sec: support event crypto adapter")
Fixes: bffc7d561c81 ("crypto/dpaa2_sec: support event crypto adapter")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c |  6 ++---
 drivers/crypto/dpaa_sec/dpaa_sec.c          | 30 ++++++++++-----------
 2 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index bb5a2c629e53..1cae6c45059e 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -4153,7 +4153,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 		ret = dpseci_set_opr(dpseci, CMD_PRI_LOW, priv->token,
 				   qp_id, OPR_OPT_CREATE, &ocfg);
 		if (ret) {
-			RTE_LOG(ERR, PMD, "Error setting opr: ret: %d\n", ret);
+			DPAA2_SEC_ERR("Error setting opr: ret: %d", ret);
 			return ret;
 		}
 		qp->tx_vq.cb_eqresp_free = dpaa2_sec_free_eqresp_buf;
@@ -4163,7 +4163,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 	ret = dpseci_set_rx_queue(dpseci, CMD_PRI_LOW, priv->token,
 				  qp_id, &cfg);
 	if (ret) {
-		RTE_LOG(ERR, PMD, "Error in dpseci_set_queue: ret: %d\n", ret);
+		DPAA2_SEC_ERR("Error in dpseci_set_queue: ret: %d", ret);
 		return ret;
 	}
 
@@ -4188,7 +4188,7 @@ dpaa2_sec_eventq_detach(const struct rte_cryptodev *dev,
 	ret = dpseci_set_rx_queue(dpseci, CMD_PRI_LOW, priv->token,
 				  qp_id, &cfg);
 	if (ret)
-		RTE_LOG(ERR, PMD, "Error in dpseci_set_queue: ret: %d\n", ret);
+		DPAA2_SEC_ERR("Error in dpseci_set_queue: ret: %d", ret);
 
 	return ret;
 }
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index a301e8edb2a4..e7ebcbe2af22 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -102,7 +102,7 @@ ern_sec_fq_handler(struct qman_portal *qm __rte_unused,
 		   struct qman_fq *fq,
 		   const struct qm_mr_entry *msg)
 {
-	DPAA_SEC_DP_ERR("sec fq %d error, RC = %x, seqnum = %x\n",
+	DPAA_SEC_DP_ERR("sec fq %d error, RC = %x, seqnum = %x",
 			fq->fqid, msg->ern.rc, msg->ern.seqnum);
 }
 
@@ -849,7 +849,7 @@ dpaa_sec_deq(struct dpaa_sec_qp *qp, struct rte_crypto_op **ops, int nb_ops)
 			op->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
 		} else {
 			if (dpaa_sec_dp_dump > DPAA_SEC_DP_NO_DUMP) {
-				DPAA_SEC_DP_WARN("SEC return err:0x%x\n",
+				DPAA_SEC_DP_WARN("SEC return err:0x%x",
 						  ctx->fd_status);
 				if (dpaa_sec_dp_dump > DPAA_SEC_DP_ERR_DUMP)
 					dpaa_sec_dump(ctx, qp);
@@ -1943,8 +1943,7 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
 				}
 			} else if (unlikely(ses->qp[rte_lcore_id() %
 						MAX_DPAA_CORES] != qp)) {
-				DPAA_SEC_DP_ERR("Old:sess->qp = %p"
-					" New qp = %p\n",
+				DPAA_SEC_DP_ERR("Old: sess->qp = %p New qp = %p",
 					ses->qp[rte_lcore_id() %
 					MAX_DPAA_CORES], qp);
 				frames_to_send = loop;
@@ -2054,7 +2053,7 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
 				fd->cmd = 0x80000000 |
 					*((uint32_t *)((uint8_t *)op +
 					ses->pdcp.hfn_ovd_offset));
-				DPAA_SEC_DP_DEBUG("Per packet HFN: %x, ovd:%u\n",
+				DPAA_SEC_DP_DEBUG("Per packet HFN: %x, ovd:%u",
 					*((uint32_t *)((uint8_t *)op +
 					ses->pdcp.hfn_ovd_offset)),
 					ses->pdcp.hfn_ovd);
@@ -2095,7 +2094,7 @@ dpaa_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops,
 	dpaa_qp->rx_pkts += num_rx;
 	dpaa_qp->rx_errs += nb_ops - num_rx;
 
-	DPAA_SEC_DP_DEBUG("SEC Received %d Packets\n", num_rx);
+	DPAA_SEC_DP_DEBUG("SEC Received %d Packets", num_rx);
 
 	return num_rx;
 }
@@ -2158,7 +2157,7 @@ dpaa_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 							NULL, NULL, NULL, NULL,
 							SOCKET_ID_ANY, 0);
 		if (!qp->ctx_pool) {
-			DPAA_SEC_ERR("%s create failed\n", str);
+			DPAA_SEC_ERR("%s create failed", str);
 			return -ENOMEM;
 		}
 	} else
@@ -2459,7 +2458,7 @@ dpaa_sec_aead_init(struct rte_cryptodev *dev __rte_unused,
 	session->aead_key.data = rte_zmalloc(NULL, xform->aead.key.length,
 					     RTE_CACHE_LINE_SIZE);
 	if (session->aead_key.data == NULL && xform->aead.key.length > 0) {
-		DPAA_SEC_ERR("No Memory for aead key\n");
+		DPAA_SEC_ERR("No Memory for aead key");
 		return -ENOMEM;
 	}
 	session->aead_key.length = xform->aead.key.length;
@@ -2508,7 +2507,7 @@ dpaa_sec_detach_rxq(struct dpaa_sec_dev_private *qi, struct qman_fq *fq)
 	for (i = 0; i < RTE_DPAA_MAX_RX_QUEUE; i++) {
 		if (&qi->inq[i] == fq) {
 			if (qman_retire_fq(fq, NULL) != 0)
-				DPAA_SEC_DEBUG("Queue is not retired\n");
+				DPAA_SEC_DEBUG("Queue is not retired");
 			qman_oos_fq(fq);
 			qi->inq_attach[i] = 0;
 			return 0;
@@ -3483,7 +3482,7 @@ dpaa_sec_eventq_attach(const struct rte_cryptodev *dev,
 		qp->outq.cb.dqrr_dpdk_cb = dpaa_sec_process_atomic_event;
 		break;
 	case RTE_SCHED_TYPE_ORDERED:
-		DPAA_SEC_ERR("Ordered queue schedule type is not supported\n");
+		DPAA_SEC_ERR("Ordered queue schedule type is not supported");
 		return -ENOTSUP;
 	default:
 		opts.fqd.fq_ctrl |= QM_FQCTRL_AVOIDBLOCK;
@@ -3518,7 +3517,7 @@ dpaa_sec_eventq_detach(const struct rte_cryptodev *dev,
 	qman_oos_fq(&qp->outq);
 	ret = qman_init_fq(&qp->outq, 0, &opts);
 	if (ret)
-		RTE_LOG(ERR, PMD, "Error in qman_init_fq: ret: %d\n", ret);
+		DPAA_SEC_ERR("Error in qman_init_fq: ret: %d", ret);
 	qp->outq.cb.dqrr = NULL;
 
 	return ret;
@@ -3581,8 +3580,7 @@ check_devargs_handler(__rte_unused const char *key, const char *value,
 {
 	dpaa_sec_dp_dump = atoi(value);
 	if (dpaa_sec_dp_dump > DPAA_SEC_DP_FULL_DUMP) {
-		DPAA_SEC_WARN("WARN: DPAA_SEC_DP_DUMP_LEVEL is not "
-			      "supported, changing to FULL error prints\n");
+		DPAA_SEC_WARN("WARN: DPAA_SEC_DP_DUMP_LEVEL is not supported, changing to FULL error prints");
 		dpaa_sec_dp_dump = DPAA_SEC_DP_FULL_DUMP;
 	}
 
@@ -3645,7 +3643,7 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)
 
 	ret = munmap(internals->sec_hw, MAP_SIZE);
 	if (ret)
-		DPAA_SEC_WARN("munmap failed\n");
+		DPAA_SEC_WARN("munmap failed");
 
 	close(map_fd);
 	cryptodev->driver_id = dpaa_cryptodev_driver_id;
@@ -3709,11 +3707,11 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)
 
 	dpaa_sec_get_devargs(cryptodev->device->devargs, DRIVER_DUMP_MODE);
 
-	RTE_LOG(INFO, PMD, "%s cryptodev init\n", cryptodev->data->name);
+	DPAA_SEC_INFO("%s cryptodev init", cryptodev->data->name);
 	return 0;
 
 init_error:
-	DPAA_SEC_ERR("driver %s: create failed\n", cryptodev->data->name);
+	DPAA_SEC_ERR("driver %s: create failed", cryptodev->data->name);
 
 	rte_free(cryptodev->security_ctx);
 	return -EFAULT;
-- 
2.43.0


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

* [PATCH v6 16/20] event/dlb2: use dedicated logtype
  2023-12-22 17:11 ` [PATCH v6 00/20] Remove " Stephen Hemminger
                     ` (14 preceding siblings ...)
  2023-12-22 17:11   ` [PATCH v6 15/20] crypto/dpaa_sec, crypto/dpaa2_sec: " Stephen Hemminger
@ 2023-12-22 17:11   ` Stephen Hemminger
  2023-12-22 17:11   ` [PATCH v6 17/20] event/dpaa, event/dpaa2: " Stephen Hemminger
                     ` (4 subsequent siblings)
  20 siblings, 0 replies; 214+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:11 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Abdullah Sevincer, Timothy McDaniel, Gage Eads

Driver was using RTE_LOGTYPE_PMD when it had its own logtype.
Fixes: 5433956d5185 ("event/dlb2: add eventdev probe")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/dlb2/dlb2.c | 275 +++++++++++++++++++-------------------
 1 file changed, 137 insertions(+), 138 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 050ace0904b4..419876490780 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -169,7 +169,7 @@ dlb2_hw_query_resources(struct dlb2_eventdev *dlb2)
 	ret = dlb2_iface_get_num_resources(handle,
 					   &dlb2->hw_rsrc_query_results);
 	if (ret) {
-		DLB2_LOG_ERR("ioctl get dlb2 num resources, err=%d\n", ret);
+		DLB2_LOG_ERR("ioctl get dlb2 num resources, err=%d", ret);
 		return ret;
 	}
 
@@ -259,7 +259,7 @@ set_producer_coremask(const char *key __rte_unused,
 	const char **mask_str = opaque;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -293,7 +293,7 @@ set_max_cq_depth(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -304,7 +304,7 @@ set_max_cq_depth(const char *key __rte_unused,
 	if (*max_cq_depth < DLB2_MIN_CQ_DEPTH_OVERRIDE ||
 	    *max_cq_depth > DLB2_MAX_CQ_DEPTH_OVERRIDE ||
 	    !rte_is_power_of_2(*max_cq_depth)) {
-		DLB2_LOG_ERR("dlb2: max_cq_depth %d and %d and a power of 2\n",
+		DLB2_LOG_ERR("dlb2: max_cq_depth %d and %d and a power of 2",
 			     DLB2_MIN_CQ_DEPTH_OVERRIDE,
 			     DLB2_MAX_CQ_DEPTH_OVERRIDE);
 		return -EINVAL;
@@ -322,7 +322,7 @@ set_max_enq_depth(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -333,7 +333,7 @@ set_max_enq_depth(const char *key __rte_unused,
 	if (*max_enq_depth < DLB2_MIN_ENQ_DEPTH_OVERRIDE ||
 	    *max_enq_depth > DLB2_MAX_ENQ_DEPTH_OVERRIDE ||
 	    !rte_is_power_of_2(*max_enq_depth)) {
-		DLB2_LOG_ERR("dlb2: max_enq_depth %d and %d and a power of 2\n",
+		DLB2_LOG_ERR("dlb2: max_enq_depth %d and %d and a power of 2",
 		DLB2_MIN_ENQ_DEPTH_OVERRIDE,
 		DLB2_MAX_ENQ_DEPTH_OVERRIDE);
 		return -EINVAL;
@@ -351,7 +351,7 @@ set_max_num_events(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -361,7 +361,7 @@ set_max_num_events(const char *key __rte_unused,
 
 	if (*max_num_events < 0 || *max_num_events >
 			DLB2_MAX_NUM_LDB_CREDITS) {
-		DLB2_LOG_ERR("dlb2: max_num_events must be between 0 and %d\n",
+		DLB2_LOG_ERR("dlb2: max_num_events must be between 0 and %d",
 			     DLB2_MAX_NUM_LDB_CREDITS);
 		return -EINVAL;
 	}
@@ -378,7 +378,7 @@ set_num_dir_credits(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -388,7 +388,7 @@ set_num_dir_credits(const char *key __rte_unused,
 
 	if (*num_dir_credits < 0 ||
 	    *num_dir_credits > DLB2_MAX_NUM_DIR_CREDITS(DLB2_HW_V2)) {
-		DLB2_LOG_ERR("dlb2: num_dir_credits must be between 0 and %d\n",
+		DLB2_LOG_ERR("dlb2: num_dir_credits must be between 0 and %d",
 			     DLB2_MAX_NUM_DIR_CREDITS(DLB2_HW_V2));
 		return -EINVAL;
 	}
@@ -405,7 +405,7 @@ set_dev_id(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -425,7 +425,7 @@ set_poll_interval(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -445,7 +445,7 @@ set_port_cos(const char *key __rte_unused,
 	int first, last, cos_id, i;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -458,18 +458,18 @@ set_port_cos(const char *key __rte_unused,
 	} else if (sscanf(value, "%d:%d", &first, &cos_id) == 2) {
 		last = first;
 	} else {
-		DLB2_LOG_ERR("Error parsing ldb port port_cos devarg. Should be port-port:val, or port:val\n");
+		DLB2_LOG_ERR("Error parsing ldb port port_cos devarg. Should be port-port:val, or port:val");
 		return -EINVAL;
 	}
 
 	if (first > last || first < 0 ||
 		last >= DLB2_MAX_NUM_LDB_PORTS) {
-		DLB2_LOG_ERR("Error parsing ldb port cos_id arg, invalid port value\n");
+		DLB2_LOG_ERR("Error parsing ldb port cos_id arg, invalid port value");
 		return -EINVAL;
 	}
 
 	if (cos_id < DLB2_COS_0 || cos_id > DLB2_COS_3) {
-		DLB2_LOG_ERR("Error parsing ldb port cos_id devarg, must be between 0 and 4\n");
+		DLB2_LOG_ERR("Error parsing ldb port cos_id devarg, must be between 0 and 4");
 		return -EINVAL;
 	}
 
@@ -487,7 +487,7 @@ set_cos_bw(const char *key __rte_unused,
 	struct dlb2_cos_bw *cos_bw = opaque;
 
 	if (opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -495,11 +495,11 @@ set_cos_bw(const char *key __rte_unused,
 
 	if (sscanf(value, "%d:%d:%d:%d", &cos_bw->val[0], &cos_bw->val[1],
 		   &cos_bw->val[2], &cos_bw->val[3]) != 4) {
-		DLB2_LOG_ERR("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3 where all values combined are <= 100\n");
+		DLB2_LOG_ERR("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3 where all values combined are <= 100");
 		return -EINVAL;
 	}
 	if (cos_bw->val[0] + cos_bw->val[1] + cos_bw->val[2] + cos_bw->val[3] > 100) {
-		DLB2_LOG_ERR("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3  where all values combined are <= 100\n");
+		DLB2_LOG_ERR("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3  where all values combined are <= 100");
 		return -EINVAL;
 	}
 
@@ -515,7 +515,7 @@ set_sw_credit_quanta(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -524,7 +524,7 @@ set_sw_credit_quanta(const char *key __rte_unused,
 		return ret;
 
 	if (*sw_credit_quanta <= 0) {
-		DLB2_LOG_ERR("sw_credit_quanta must be > 0\n");
+		DLB2_LOG_ERR("sw_credit_quanta must be > 0");
 		return -EINVAL;
 	}
 
@@ -540,7 +540,7 @@ set_hw_credit_quanta(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -560,7 +560,7 @@ set_default_depth_thresh(const char *key __rte_unused,
 	int ret;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -579,7 +579,7 @@ set_vector_opts_enab(const char *key __rte_unused,
 	bool *dlb2_vector_opts_enabled = opaque;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -599,7 +599,7 @@ set_default_ldb_port_allocation(const char *key __rte_unused,
 	bool *default_ldb_port_allocation = opaque;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -619,7 +619,7 @@ set_enable_cq_weight(const char *key __rte_unused,
 	bool *enable_cq_weight = opaque;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -640,7 +640,7 @@ set_qid_depth_thresh(const char *key __rte_unused,
 	int first, last, thresh, i;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -657,18 +657,18 @@ set_qid_depth_thresh(const char *key __rte_unused,
 	} else if (sscanf(value, "%d:%d", &first, &thresh) == 2) {
 		last = first;
 	} else {
-		DLB2_LOG_ERR("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val\n");
+		DLB2_LOG_ERR("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val");
 		return -EINVAL;
 	}
 
 	if (first > last || first < 0 ||
 		last >= DLB2_MAX_NUM_QUEUES(DLB2_HW_V2)) {
-		DLB2_LOG_ERR("Error parsing qid depth devarg, invalid qid value\n");
+		DLB2_LOG_ERR("Error parsing qid depth devarg, invalid qid value");
 		return -EINVAL;
 	}
 
 	if (thresh < 0 || thresh > DLB2_MAX_QUEUE_DEPTH_THRESHOLD) {
-		DLB2_LOG_ERR("Error parsing qid depth devarg, threshold > %d\n",
+		DLB2_LOG_ERR("Error parsing qid depth devarg, threshold > %d",
 			     DLB2_MAX_QUEUE_DEPTH_THRESHOLD);
 		return -EINVAL;
 	}
@@ -688,7 +688,7 @@ set_qid_depth_thresh_v2_5(const char *key __rte_unused,
 	int first, last, thresh, i;
 
 	if (value == NULL || opaque == NULL) {
-		DLB2_LOG_ERR("NULL pointer\n");
+		DLB2_LOG_ERR("NULL pointer");
 		return -EINVAL;
 	}
 
@@ -705,18 +705,18 @@ set_qid_depth_thresh_v2_5(const char *key __rte_unused,
 	} else if (sscanf(value, "%d:%d", &first, &thresh) == 2) {
 		last = first;
 	} else {
-		DLB2_LOG_ERR("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val\n");
+		DLB2_LOG_ERR("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val");
 		return -EINVAL;
 	}
 
 	if (first > last || first < 0 ||
 		last >= DLB2_MAX_NUM_QUEUES(DLB2_HW_V2_5)) {
-		DLB2_LOG_ERR("Error parsing qid depth devarg, invalid qid value\n");
+		DLB2_LOG_ERR("Error parsing qid depth devarg, invalid qid value");
 		return -EINVAL;
 	}
 
 	if (thresh < 0 || thresh > DLB2_MAX_QUEUE_DEPTH_THRESHOLD) {
-		DLB2_LOG_ERR("Error parsing qid depth devarg, threshold > %d\n",
+		DLB2_LOG_ERR("Error parsing qid depth devarg, threshold > %d",
 			     DLB2_MAX_QUEUE_DEPTH_THRESHOLD);
 		return -EINVAL;
 	}
@@ -738,7 +738,7 @@ dlb2_eventdev_info_get(struct rte_eventdev *dev,
 	if (ret) {
 		const struct rte_eventdev_data *data = dev->data;
 
-		DLB2_LOG_ERR("get resources err=%d, devid=%d\n",
+		DLB2_LOG_ERR("get resources err=%d, devid=%d",
 			     ret, data->dev_id);
 		/* fn is void, so fall through and return values set up in
 		 * probe
@@ -781,7 +781,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,
 	struct dlb2_create_sched_domain_args *cfg;
 
 	if (resources_asked == NULL) {
-		DLB2_LOG_ERR("dlb2: dlb2_create NULL parameter\n");
+		DLB2_LOG_ERR("dlb2: dlb2_create NULL parameter");
 		ret = EINVAL;
 		goto error_exit;
 	}
@@ -809,7 +809,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,
 
 	if (cos_ports > resources_asked->num_ldb_ports ||
 	    (cos_ports && dlb2->max_cos_port >= resources_asked->num_ldb_ports)) {
-		DLB2_LOG_ERR("dlb2: num_ldb_ports < cos_ports\n");
+		DLB2_LOG_ERR("dlb2: num_ldb_ports < cos_ports");
 		ret = EINVAL;
 		goto error_exit;
 	}
@@ -832,7 +832,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,
 		evdev_dlb2_default_info.max_event_port_dequeue_depth;
 
 	if (device_version == DLB2_HW_V2_5) {
-		DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, credits=%d\n",
+		DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, credits=%d",
 			     cfg->num_ldb_queues,
 			     resources_asked->num_ldb_ports,
 			     cfg->num_dir_ports,
@@ -840,7 +840,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,
 			     cfg->num_hist_list_entries,
 			     cfg->num_credits);
 	} else {
-		DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, ldb_credits=%d, dir_credits=%d\n",
+		DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, ldb_credits=%d, dir_credits=%d",
 			     cfg->num_ldb_queues,
 			     resources_asked->num_ldb_ports,
 			     cfg->num_dir_ports,
@@ -854,7 +854,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,
 
 	ret = dlb2_iface_sched_domain_create(handle, cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: domain create failed, ret = %d, extra status: %s\n",
+		DLB2_LOG_ERR("dlb2: domain create failed, ret = %d, extra status: %s",
 			     ret,
 			     dlb2_error_strings[cfg->response.status]);
 
@@ -930,27 +930,27 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev)
 		dlb2_hw_reset_sched_domain(dev, true);
 		ret = dlb2_hw_query_resources(dlb2);
 		if (ret) {
-			DLB2_LOG_ERR("get resources err=%d, devid=%d\n",
+			DLB2_LOG_ERR("get resources err=%d, devid=%d",
 				     ret, data->dev_id);
 			return ret;
 		}
 	}
 
 	if (config->nb_event_queues > rsrcs->num_queues) {
-		DLB2_LOG_ERR("nb_event_queues parameter (%d) exceeds the QM device's capabilities (%d).\n",
+		DLB2_LOG_ERR("nb_event_queues parameter (%d) exceeds the QM device's capabilities (%d).",
 			     config->nb_event_queues,
 			     rsrcs->num_queues);
 		return -EINVAL;
 	}
 	if (config->nb_event_ports > (rsrcs->num_ldb_ports
 			+ rsrcs->num_dir_ports)) {
-		DLB2_LOG_ERR("nb_event_ports parameter (%d) exceeds the QM device's capabilities (%d).\n",
+		DLB2_LOG_ERR("nb_event_ports parameter (%d) exceeds the QM device's capabilities (%d).",
 			     config->nb_event_ports,
 			     (rsrcs->num_ldb_ports + rsrcs->num_dir_ports));
 		return -EINVAL;
 	}
 	if (config->nb_events_limit > rsrcs->nb_events_limit) {
-		DLB2_LOG_ERR("nb_events_limit parameter (%d) exceeds the QM device's capabilities (%d).\n",
+		DLB2_LOG_ERR("nb_events_limit parameter (%d) exceeds the QM device's capabilities (%d).",
 			     config->nb_events_limit,
 			     rsrcs->nb_events_limit);
 		return -EINVAL;
@@ -1000,7 +1000,7 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev)
 
 	if (dlb2_hw_create_sched_domain(dlb2, handle, rsrcs,
 					dlb2->version) < 0) {
-		DLB2_LOG_ERR("dlb2_hw_create_sched_domain failed\n");
+		DLB2_LOG_ERR("dlb2_hw_create_sched_domain failed");
 		return -ENODEV;
 	}
 
@@ -1068,7 +1068,7 @@ dlb2_get_sn_allocation(struct dlb2_eventdev *dlb2, int group)
 
 	ret = dlb2_iface_get_sn_allocation(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: get_sn_allocation ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: get_sn_allocation ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return ret;
 	}
@@ -1088,7 +1088,7 @@ dlb2_set_sn_allocation(struct dlb2_eventdev *dlb2, int group, int num)
 
 	ret = dlb2_iface_set_sn_allocation(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: set_sn_allocation ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: set_sn_allocation ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return ret;
 	}
@@ -1107,7 +1107,7 @@ dlb2_get_sn_occupancy(struct dlb2_eventdev *dlb2, int group)
 
 	ret = dlb2_iface_get_sn_occupancy(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: get_sn_occupancy ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: get_sn_occupancy ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return ret;
 	}
@@ -1161,7 +1161,7 @@ dlb2_program_sn_allocation(struct dlb2_eventdev *dlb2,
 	}
 
 	if (i == DLB2_NUM_SN_GROUPS) {
-		DLB2_LOG_ERR("[%s()] No groups with %d sequence_numbers are available or have free slots\n",
+		DLB2_LOG_ERR("[%s()] No groups with %d sequence_numbers are available or have free slots",
 		       __func__, sequence_numbers);
 		return;
 	}
@@ -1236,7 +1236,7 @@ dlb2_hw_create_ldb_queue(struct dlb2_eventdev *dlb2,
 
 	ret = dlb2_iface_ldb_queue_create(handle, &cfg);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: create LB event queue error, ret=%d (driver status: %s)\n",
+		DLB2_LOG_ERR("dlb2: create LB event queue error, ret=%d (driver status: %s)",
 			     ret, dlb2_error_strings[cfg.response.status]);
 		return -EINVAL;
 	}
@@ -1250,7 +1250,7 @@ dlb2_hw_create_ldb_queue(struct dlb2_eventdev *dlb2,
 	queue->sched_type = sched_type;
 	queue->config_state = DLB2_CONFIGURED;
 
-	DLB2_LOG_DBG("Created LB event queue %d, nb_inflights=%d, nb_seq=%d, qid inflights=%d\n",
+	DLB2_LOG_DBG("Created LB event queue %d, nb_inflights=%d, nb_seq=%d, qid inflights=%d",
 		     qm_qid,
 		     cfg.num_atomic_inflights,
 		     cfg.num_sequence_numbers,
@@ -1272,7 +1272,7 @@ dlb2_eventdev_ldb_queue_setup(struct rte_eventdev *dev,
 
 	qm_qid = dlb2_hw_create_ldb_queue(dlb2, ev_queue, queue_conf);
 	if (qm_qid < 0) {
-		DLB2_LOG_ERR("Failed to create the load-balanced queue\n");
+		DLB2_LOG_ERR("Failed to create the load-balanced queue");
 
 		return qm_qid;
 	}
@@ -1380,7 +1380,7 @@ dlb2_init_consume_qe(struct dlb2_port *qm_port, char *mz_name)
 			RTE_CACHE_LINE_SIZE);
 
 	if (qe == NULL)	{
-		DLB2_LOG_ERR("dlb2: no memory for consume_qe\n");
+		DLB2_LOG_ERR("dlb2: no memory for consume_qe");
 		return -ENOMEM;
 	}
 	qm_port->consume_qe = qe;
@@ -1412,7 +1412,7 @@ dlb2_init_int_arm_qe(struct dlb2_port *qm_port, char *mz_name)
 			RTE_CACHE_LINE_SIZE);
 
 	if (qe == NULL) {
-		DLB2_LOG_ERR("dlb2: no memory for complete_qe\n");
+		DLB2_LOG_ERR("dlb2: no memory for complete_qe");
 		return -ENOMEM;
 	}
 	qm_port->int_arm_qe = qe;
@@ -1440,20 +1440,20 @@ dlb2_init_qe_mem(struct dlb2_port *qm_port, char *mz_name)
 	qm_port->qe4 = rte_zmalloc(mz_name, sz, RTE_CACHE_LINE_SIZE);
 
 	if (qm_port->qe4 == NULL) {
-		DLB2_LOG_ERR("dlb2: no qe4 memory\n");
+		DLB2_LOG_ERR("dlb2: no qe4 memory");
 		ret = -ENOMEM;
 		goto error_exit;
 	}
 
 	ret = dlb2_init_int_arm_qe(qm_port, mz_name);
 	if (ret < 0) {
-		DLB2_LOG_ERR("dlb2: dlb2_init_int_arm_qe ret