DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/6] replace usage of LOGTYPE_PMD in Intel drivers
@ 2019-07-16 15:40 Stephen Hemminger
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug Stephen Hemminger
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Stephen Hemminger @ 2019-07-16 15:40 UTC (permalink / raw)
  To: wenzhuo.lu, konstantin.ananyev, beilei.xing, qi.z.zhang,
	xiao.w.wang, jingjing.wu
  Cc: dev, Stephen Hemminger

The RTE_LOGTYPE_PMD has been superseded by individual driver
logtypes. There still is still some vestigtial usage in the
Intel driver code. This patch set converts all of these to
use logtype_tx and logtype_rx.

Stephen Hemminger (6):
  net/e1000: use dynamic log type for tx/rx debug
  net/fm10k: use dynamic log type for tx/rx debug
  net/ixgbe: use dynamic log type for tx/rx debug
  net/ice: use dynamic log type for tx/rx debug
  net/i40e: use dynamic log type for tx/rx debug
  net/iavf: use dynamic log type for tx/rx debug

 drivers/net/e1000/e1000_logs.c   | 48 ++++++++++++++++++++++++++------
 drivers/net/e1000/e1000_logs.h   | 25 +++++++++++------
 drivers/net/fm10k/fm10k_ethdev.c | 28 +++++++++++++++++++
 drivers/net/fm10k/fm10k_logs.h   | 18 ++++++++----
 drivers/net/i40e/i40e_ethdev.c   | 27 ++++++++++++++++++
 drivers/net/i40e/i40e_logs.h     | 24 ++++++++++------
 drivers/net/iavf/iavf_ethdev.c   | 28 +++++++++++++++++++
 drivers/net/iavf/iavf_log.h      | 19 +++++++++----
 drivers/net/ice/ice_ethdev.c     | 27 ++++++++++++++++++
 drivers/net/ice/ice_logs.h       | 18 ++++++++----
 drivers/net/ixgbe/ixgbe_ethdev.c | 27 ++++++++++++++++++
 drivers/net/ixgbe/ixgbe_logs.h   | 24 ++++++++++------
 drivers/net/ixgbe/ixgbe_pf.c     | 19 ++++++-------
 13 files changed, 267 insertions(+), 65 deletions(-)

-- 
2.20.1


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

* [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug
  2019-07-16 15:40 [dpdk-dev] [PATCH 0/6] replace usage of LOGTYPE_PMD in Intel drivers Stephen Hemminger
@ 2019-07-16 15:40 ` Stephen Hemminger
  2019-08-27  8:21   ` Ferruh Yigit
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 2/6] net/fm10k: " Stephen Hemminger
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2019-07-16 15:40 UTC (permalink / raw)
  To: wenzhuo.lu, konstantin.ananyev, beilei.xing, qi.z.zhang,
	xiao.w.wang, jingjing.wu
  Cc: dev, Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver should register the logtypes
for itself.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/e1000/e1000_logs.c | 48 +++++++++++++++++++++++++++-------
 drivers/net/e1000/e1000_logs.h | 25 +++++++++++-------
 2 files changed, 55 insertions(+), 18 deletions(-)

diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 22173939f5e5..05f883dd201b 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -8,19 +8,49 @@
 int e1000_logtype_init;
 int e1000_logtype_driver;
 
+#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+int e1000_logtype_rx;
+#endif
+#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+int e1000_logtype_tx;
+#endif
+#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
+int e1000_logtype_tx_free;
+#endif
+
 /* avoids double registering of logs if EM and IGB drivers are in use */
 static int e1000_log_initialized;
 
 void
 e1000_igb_init_log(void)
 {
-	if (!e1000_log_initialized) {
-		e1000_logtype_init = rte_log_register("pmd.net.e1000.init");
-		if (e1000_logtype_init >= 0)
-			rte_log_set_level(e1000_logtype_init, RTE_LOG_NOTICE);
-		e1000_logtype_driver = rte_log_register("pmd.net.e1000.driver");
-		if (e1000_logtype_driver >= 0)
-			rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
-		e1000_log_initialized = 1;
-	}
+	if (e1000_log_initialized)
+		return;
+
+	e1000_logtype_init = rte_log_register("pmd.net.e1000.init");
+	if (e1000_logtype_init >= 0)
+		rte_log_set_level(e1000_logtype_init, RTE_LOG_NOTICE);
+	e1000_logtype_driver = rte_log_register("pmd.net.e1000.driver");
+	if (e1000_logtype_driver >= 0)
+		rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
+
+#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
+	if (e1000_logtype_rx >= 0)
+		rte_log_set_level(e1000_logtype_rx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+	e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
+	if (e1000_logtype_tx >= 0)
+		rte_log_set_level(e1000_logtype_tx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
+	e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
+	if (e1000_logtype_tx_free >= 0)
+		rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_NOTICE);
+#endif
+
+	e1000_log_initialized = 1;
 }
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 69d3d31186e0..2612134f38a0 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -8,6 +8,7 @@
 #include <rte_log.h>
 
 extern int e1000_logtype_init;
+
 #define PMD_INIT_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, e1000_logtype_init, \
 		"%s(): " fmt "\n", __func__, ##args)
@@ -15,24 +16,30 @@ extern int e1000_logtype_init;
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_LIBRTE_E1000_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int e1000_logtype_rx;
+#define PMD_RX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, e1000_logtype_rx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
-#define PMD_RX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_E1000_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int e1000_logtype_tx;
+#define PMD_TX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, e1000_logtype_tx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
-#define PMD_TX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-#define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int e1000_logtype_tx_free;
+#define PMD_TX_FREE_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, e1000_logtype_tx_free,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
-#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
+#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 extern int e1000_logtype_driver;
-- 
2.20.1


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

* [dpdk-dev] [PATCH 2/6] net/fm10k: use dynamic log type for tx/rx debug
  2019-07-16 15:40 [dpdk-dev] [PATCH 0/6] replace usage of LOGTYPE_PMD in Intel drivers Stephen Hemminger
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug Stephen Hemminger
@ 2019-07-16 15:40 ` Stephen Hemminger
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 3/6] net/ixgbe: " Stephen Hemminger
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2019-07-16 15:40 UTC (permalink / raw)
  To: wenzhuo.lu, konstantin.ananyev, beilei.xing, qi.z.zhang,
	xiao.w.wang, jingjing.wu
  Cc: dev, Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver must dynamic log types.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/fm10k/fm10k_ethdev.c | 28 ++++++++++++++++++++++++++++
 drivers/net/fm10k/fm10k_logs.h   | 18 ++++++++++++------
 2 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index a1e3836cb449..1f0a6286a57b 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -43,6 +43,16 @@
 int fm10k_logtype_init;
 int fm10k_logtype_driver;
 
+#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+int fm10k_logtype_rx;
+#endif
+#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+int fm10k_logtype_tx;
+#endif
+#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
+int fm10k_logtype_tx_free;
+#endif
+
 static void fm10k_close_mbx_service(struct fm10k_hw *hw);
 static void fm10k_dev_promiscuous_enable(struct rte_eth_dev *dev);
 static void fm10k_dev_promiscuous_disable(struct rte_eth_dev *dev);
@@ -3286,4 +3296,22 @@ RTE_INIT(fm10k_init_log)
 	fm10k_logtype_driver = rte_log_register("pmd.net.fm10k.driver");
 	if (fm10k_logtype_driver >= 0)
 		rte_log_set_level(fm10k_logtype_driver, RTE_LOG_NOTICE);
+
+#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+	fm10k_logtype_rx = rte_log_register("pmd.net.fm10k.rx");
+	if (fm10k_logtype_rx >= 0)
+		rte_log_set_level(fm10k_logtype_rx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+	fm10k_logtype_tx = rte_log_register("pmd.net.fm10k.tx");
+	if (fm10k_logtype_tx >= 0)
+		rte_log_set_level(fm10k_logtype_tx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
+	fm10k_logtype_tx_free = rte_log_register("pmd.net.fm10k.tx_free");
+	if (fm10k_logtype_tx_free >= 0)
+		rte_log_set_level(fm10k_logtype_tx_free, RTE_LOG_NOTICE);
+#endif
 }
diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h
index df56a51cac48..9ae743d80678 100644
--- a/drivers/net/fm10k/fm10k_logs.h
+++ b/drivers/net/fm10k/fm10k_logs.h
@@ -15,22 +15,28 @@ extern int fm10k_logtype_init;
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_LIBRTE_FM10K_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int fm10k_logtype_rx;
+#define PMD_RX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, fm10k_logtype_rx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_FM10K_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int fm10k_logtype_tx;
+#define PMD_TX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, fm10k_logtype_tx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-#define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int fm10k_logtype_tx_free;
+#define PMD_TX_FREE_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, fm10k_logtype_tx_free,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
 #endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH 3/6] net/ixgbe: use dynamic log type for tx/rx debug
  2019-07-16 15:40 [dpdk-dev] [PATCH 0/6] replace usage of LOGTYPE_PMD in Intel drivers Stephen Hemminger
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug Stephen Hemminger
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 2/6] net/fm10k: " Stephen Hemminger
@ 2019-07-16 15:40 ` Stephen Hemminger
  2019-08-27  8:24   ` Ferruh Yigit
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 4/6] net/ice: " Stephen Hemminger
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2019-07-16 15:40 UTC (permalink / raw)
  To: wenzhuo.lu, konstantin.ananyev, beilei.xing, qi.z.zhang,
	xiao.w.wang, jingjing.wu
  Cc: dev, Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver must dynamic log types.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 27 +++++++++++++++++++++++++++
 drivers/net/ixgbe/ixgbe_logs.h   | 24 +++++++++++++++---------
 drivers/net/ixgbe/ixgbe_pf.c     | 19 ++++++++-----------
 3 files changed, 50 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 22c5b2c5cabd..5c84fd046752 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -419,6 +419,16 @@ static void ixgbe_l2_tunnel_conf(struct rte_eth_dev *dev);
 int ixgbe_logtype_init;
 int ixgbe_logtype_driver;
 
+#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+int ixgbe_logtype_rx;
+#endif
+#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+int ixgbe_logtype_tx;
+#endif
+#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
+int ixgbe_logtype_tx_free;
+#endif
+
 /*
  * The set of PCI devices this driver supports
  */
@@ -8732,4 +8742,21 @@ RTE_INIT(ixgbe_init_log)
 	ixgbe_logtype_driver = rte_log_register("pmd.net.ixgbe.driver");
 	if (ixgbe_logtype_driver >= 0)
 		rte_log_set_level(ixgbe_logtype_driver, RTE_LOG_NOTICE);
+#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+	ixgbe_logtype_rx = rte_log_register("pmd.net.ixgbe.rx");
+	if (ixgbe_logtype_rx >= 0)
+		rte_log_set_level(ixgbe_logtype_rx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+	ixgbe_logtype_tx = rte_log_register("pmd.net.ixgbe.tx");
+	if (ixgbe_logtype_tx >= 0)
+		rte_log_set_level(ixgbe_logtype_tx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
+	ixgbe_logtype_tx_free = rte_log_register("pmd.net.ixgbe.tx_free");
+	if (ixgbe_logtype_tx_free >= 0)
+		rte_log_set_level(ixgbe_logtype_tx_free, RTE_LOG_NOTICE);
+#endif
 }
diff --git a/drivers/net/ixgbe/ixgbe_logs.h b/drivers/net/ixgbe/ixgbe_logs.h
index dc73e9bded35..2a279d109813 100644
--- a/drivers/net/ixgbe/ixgbe_logs.h
+++ b/drivers/net/ixgbe/ixgbe_logs.h
@@ -13,24 +13,30 @@ extern int ixgbe_logtype_init;
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int ixgbe_logtype_rx;
+#define PMD_RX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
-#define PMD_RX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int ixgbe_logtype_tx;
+#define PMD_TX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
-#define PMD_TX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-#define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int ixgbe_logtype_tx_free;
+#define PMD_TX_FREE_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx_free,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
-#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
+#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 extern int ixgbe_logtype_driver;
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index c88d56e24564..a9e77f21c0de 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -161,16 +161,14 @@ ixgbe_add_tx_flow_control_drop_filter(struct rte_eth_dev *eth_dev)
 	struct ixgbe_ethertype_filter ethertype_filter;
 
 	if (!hw->mac.ops.set_ethertype_anti_spoofing) {
-		RTE_LOG(INFO, PMD, "ether type anti-spoofing is not"
-			" supported.\n");
+		PMD_DRV_LOG(INFO, "ether type anti-spoofing is not supported.\n");
 		return;
 	}
 
 	i = ixgbe_ethertype_filter_lookup(filter_info,
 					  IXGBE_ETHERTYPE_FLOW_CTRL);
 	if (i >= 0) {
-		RTE_LOG(ERR, PMD, "A ether type filter"
-			" entity for flow control already exists!\n");
+		PMD_DRV_LOG(ERR, "A ether type filter entity for flow control already exists!\n");
 		return;
 	}
 
@@ -183,8 +181,7 @@ ixgbe_add_tx_flow_control_drop_filter(struct rte_eth_dev *eth_dev)
 	i = ixgbe_ethertype_filter_insert(filter_info,
 					  &ethertype_filter);
 	if (i < 0) {
-		RTE_LOG(ERR, PMD, "Cannot find an unused ether type filter"
-			" entity for flow control.\n");
+		PMD_DRV_LOG(ERR, "Cannot find an unused ether type filter entity for flow control.\n");
 		return;
 	}
 
@@ -415,7 +412,7 @@ ixgbe_disable_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf)
 
 	vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
 
-	RTE_LOG(INFO, PMD, "VF %u: disabling multicast promiscuous\n", vf);
+	PMD_DRV_LOG(INFO, "VF %u: disabling multicast promiscuous\n", vf);
 
 	vmolr &= ~IXGBE_VMOLR_MPE;
 
@@ -588,7 +585,7 @@ ixgbe_negotiate_vf_api(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
 		break;
 	}
 
-	RTE_LOG(ERR, PMD, "Negotiate invalid api version %u from VF %d\n",
+	PMD_DRV_LOG(ERR, "Negotiate invalid api version %u from VF %d\n",
 		api_version, vf);
 
 	return -1;
@@ -635,7 +632,7 @@ ixgbe_get_vf_queues(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
 	switch (eth_conf->txmode.mq_mode) {
 	case ETH_MQ_TX_NONE:
 	case ETH_MQ_TX_DCB:
-		RTE_LOG(ERR, PMD, "PF must work with virtualization for VF %u"
+		PMD_DRV_LOG(ERR, "PF must work with virtualization for VF %u"
 			", but its tx mode = %d\n", vf,
 			eth_conf->txmode.mq_mode);
 		return -1;
@@ -670,7 +667,7 @@ ixgbe_get_vf_queues(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
 		break;
 
 	default:
-		RTE_LOG(ERR, PMD, "PF work with invalid mode = %d\n",
+		PMD_DRV_LOG(ERR, "PF work with invalid mode = %d\n",
 			eth_conf->txmode.mq_mode);
 		return -1;
 	}
@@ -725,7 +722,7 @@ ixgbe_set_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
 		fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
 		if (!(fctrl & IXGBE_FCTRL_UPE)) {
 			/* VF promisc requires PF in promisc */
-			RTE_LOG(ERR, PMD,
+			PMD_DRV_LOG(ERR,
 			       "Enabling VF promisc requires PF in promisc\n");
 			return -1;
 		}
-- 
2.20.1


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

* [dpdk-dev] [PATCH 4/6] net/ice: use dynamic log type for tx/rx debug
  2019-07-16 15:40 [dpdk-dev] [PATCH 0/6] replace usage of LOGTYPE_PMD in Intel drivers Stephen Hemminger
                   ` (2 preceding siblings ...)
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 3/6] net/ixgbe: " Stephen Hemminger
@ 2019-07-16 15:40 ` Stephen Hemminger
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 5/6] net/i40e: " Stephen Hemminger
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 6/6] net/iavf: " Stephen Hemminger
  5 siblings, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2019-07-16 15:40 UTC (permalink / raw)
  To: wenzhuo.lu, konstantin.ananyev, beilei.xing, qi.z.zhang,
	xiao.w.wang, jingjing.wu
  Cc: dev, Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver must dynamic log types.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/ice/ice_ethdev.c | 27 +++++++++++++++++++++++++++
 drivers/net/ice/ice_logs.h   | 18 ++++++++++++------
 2 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 9ce730cd4412..37cc59bc7060 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -23,6 +23,15 @@
 
 int ice_logtype_init;
 int ice_logtype_driver;
+#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+int ice_logtype_rx;
+#endif
+#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+int ice_logtype_tx;
+#endif
+#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
+int ice_logtype_tx_free;
+#endif
 
 static int ice_dev_configure(struct rte_eth_dev *dev);
 static int ice_dev_start(struct rte_eth_dev *dev);
@@ -3762,4 +3771,22 @@ RTE_INIT(ice_init_log)
 	ice_logtype_driver = rte_log_register("pmd.net.ice.driver");
 	if (ice_logtype_driver >= 0)
 		rte_log_set_level(ice_logtype_driver, RTE_LOG_NOTICE);
+
+#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+	ice_logtype_rx = rte_log_register("pmd.net.ice.rx");
+	if (ice_logtype_rx >= 0)
+		rte_log_set_level(ice_logtype_rx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+	ice_logtype_tx = rte_log_register("pmd.net.ice.tx");
+	if (ice_logtype_tx >= 0)
+		rte_log_set_level(ice_logtype_tx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
+	ice_logtype_tx_free = rte_log_register("pmd.net.ice.tx_free");
+	if (ice_logtype_tx_free >= 0)
+		rte_log_set_level(ice_logtype_tx_free, RTE_LOG_NOTICE);
+#endif
 }
diff --git a/drivers/net/ice/ice_logs.h b/drivers/net/ice/ice_logs.h
index de2d573d440a..aab7da5f7b37 100644
--- a/drivers/net/ice/ice_logs.h
+++ b/drivers/net/ice/ice_logs.h
@@ -15,22 +15,28 @@ extern int ice_logtype_driver;
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_LIBRTE_ICE_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int ice_logtype_rx;
+#define PMD_RX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, ice_logtype_rx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_ICE_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int ice_logtype_tx;
+#define PMD_TX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, ice_logtype_tx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-#define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int ice_logtype_tx_free;
+#define PMD_TX_FREE_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, ice_logtype_tx_free,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
 #endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH 5/6] net/i40e: use dynamic log type for tx/rx debug
  2019-07-16 15:40 [dpdk-dev] [PATCH 0/6] replace usage of LOGTYPE_PMD in Intel drivers Stephen Hemminger
                   ` (3 preceding siblings ...)
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 4/6] net/ice: " Stephen Hemminger
@ 2019-07-16 15:40 ` Stephen Hemminger
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 6/6] net/iavf: " Stephen Hemminger
  5 siblings, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2019-07-16 15:40 UTC (permalink / raw)
  To: wenzhuo.lu, konstantin.ananyev, beilei.xing, qi.z.zhang,
	xiao.w.wang, jingjing.wu
  Cc: dev, Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver must dynamic log types.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/i40e/i40e_ethdev.c | 27 +++++++++++++++++++++++++++
 drivers/net/i40e/i40e_logs.h   | 24 +++++++++++++++---------
 2 files changed, 42 insertions(+), 9 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 2b9fc4572290..1e168c6253d8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -399,6 +399,15 @@ static void i40e_notify_all_vfs_link_status(struct rte_eth_dev *dev);
 
 int i40e_logtype_init;
 int i40e_logtype_driver;
+#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+int i40e_logtype_rx;
+#endif
+#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+int i40e_logtype_tx;
+#endif
+#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
+int i40e_logtype_tx_free;
+#endif
 
 static const char *const valid_keys[] = {
 	ETH_I40E_FLOATING_VEB_ARG,
@@ -12766,6 +12775,24 @@ RTE_INIT(i40e_init_log)
 	i40e_logtype_driver = rte_log_register("pmd.net.i40e.driver");
 	if (i40e_logtype_driver >= 0)
 		rte_log_set_level(i40e_logtype_driver, RTE_LOG_NOTICE);
+
+#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+	i40e_logtype_rx = rte_log_register("pmd.net.i40e.rx");
+	if (i40e_logtype_rx >= 0)
+		rte_log_set_level(i40e_logtype_rx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+	i40e_logtype_tx = rte_log_register("pmd.net.i40e.tx");
+	if (i40e_logtype_tx >= 0)
+		rte_log_set_level(i40e_logtype_tx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
+	i40e_logtype_tx_free = rte_log_register("pmd.net.i40e.tx_free");
+	if (i40e_logtype_tx_free >= 0)
+		rte_log_set_level(i40e_logtype_tx_free, RTE_LOG_NOTICE);
+#endif
 }
 
 RTE_PMD_REGISTER_PARAM_STRING(net_i40e,
diff --git a/drivers/net/i40e/i40e_logs.h b/drivers/net/i40e/i40e_logs.h
index b1049699352f..dac3267eb4e2 100644
--- a/drivers/net/i40e/i40e_logs.h
+++ b/drivers/net/i40e/i40e_logs.h
@@ -12,24 +12,30 @@ extern int i40e_logtype_init;
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_LIBRTE_I40E_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int i40e_logtype_rx;
+#define PMD_RX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, i40e_logtype_rx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
-#define PMD_RX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_I40E_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int i40e_logtype_tx;
+#define PMD_TX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, i40e_logtype_tx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
-#define PMD_TX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-#define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int i40e_logtype_tx_free;
+#define PMD_TX_FREE_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, i40e_logtype_tx_free,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
-#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
+#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 extern int i40e_logtype_driver;
-- 
2.20.1


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

* [dpdk-dev] [PATCH 6/6] net/iavf: use dynamic log type for tx/rx debug
  2019-07-16 15:40 [dpdk-dev] [PATCH 0/6] replace usage of LOGTYPE_PMD in Intel drivers Stephen Hemminger
                   ` (4 preceding siblings ...)
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 5/6] net/i40e: " Stephen Hemminger
@ 2019-07-16 15:40 ` Stephen Hemminger
  5 siblings, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2019-07-16 15:40 UTC (permalink / raw)
  To: wenzhuo.lu, konstantin.ananyev, beilei.xing, qi.z.zhang,
	xiao.w.wang, jingjing.wu
  Cc: dev, Stephen Hemminger

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver must dynamic log types.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/iavf/iavf_ethdev.c | 28 ++++++++++++++++++++++++++++
 drivers/net/iavf/iavf_log.h    | 19 +++++++++++++------
 2 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 53dc05c78d1c..d019e6ad57cb 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -76,6 +76,16 @@ static int iavf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,
 int iavf_logtype_init;
 int iavf_logtype_driver;
 
+#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+int iavf_logtype_rx;
+#endif
+#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+int iavf_logtype_tx;
+#endif
+#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
+int iavf_logtype_tx_free;
+#endif
+
 static const struct rte_pci_id pci_id_iavf_map[] = {
 	{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_ADAPTIVE_VF) },
 	{ .vendor_id = 0, /* sentinel */ },
@@ -1419,6 +1429,24 @@ RTE_INIT(iavf_init_log)
 	iavf_logtype_driver = rte_log_register("pmd.net.iavf.driver");
 	if (iavf_logtype_driver >= 0)
 		rte_log_set_level(iavf_logtype_driver, RTE_LOG_NOTICE);
+
+#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+	iavf_logtype_rx = rte_log_register("pmd.net.iavf.rx");
+	if (iavf_logtype_rx >= 0)
+		rte_log_set_level(iavf_logtype_rx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+	iavf_logtype_tx = rte_log_register("pmd.net.iavf.tx");
+	if (iavf_logtype_tx >= 0)
+		rte_log_set_level(iavf_logtype_tx, RTE_LOG_NOTICE);
+#endif
+
+#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
+	iavf_logtype_tx_free = rte_log_register("pmd.net.iavf.tx_free");
+	if (iavf_logtype_tx_free >= 0)
+		rte_log_set_level(iavf_logtype_tx_free, RTE_LOG_NOTICE);
+#endif
 }
 
 /* memory func for base code */
diff --git a/drivers/net/iavf/iavf_log.h b/drivers/net/iavf/iavf_log.h
index f66c37041439..1088ec75f55b 100644
--- a/drivers/net/iavf/iavf_log.h
+++ b/drivers/net/iavf/iavf_log.h
@@ -20,23 +20,30 @@ extern int iavf_logtype_driver;
 	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>")
 
+
 #ifdef RTE_LIBRTE_IAVF_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int iavf_logtype_rx;
+#define PMD_RX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, iavf_logtype_rx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_IAVF_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int iavf_logtype_tx;
+#define PMD_TX_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, iavf_logtype_tx,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-#define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+extern int iavf_logtype_tx_free;
+#define PMD_TX_FREE_LOG(level, fmt, args...)			\
+	rte_log(RTE_LOG_ ## level, iavf_logtype_tx_free,	\
+		"%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
 #endif
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug Stephen Hemminger
@ 2019-08-27  8:21   ` Ferruh Yigit
  2019-09-30 15:28     ` Ye Xiaolong
  2019-09-30 16:10     ` Ferruh Yigit
  0 siblings, 2 replies; 13+ messages in thread
From: Ferruh Yigit @ 2019-08-27  8:21 UTC (permalink / raw)
  To: Stephen Hemminger, wenzhuo.lu, konstantin.ananyev, beilei.xing,
	qi.z.zhang, xiao.w.wang, jingjing.wu
  Cc: dev

On 7/16/2019 4:40 PM, Stephen Hemminger wrote:
> The generic RTE_LOGTYPE_PMD is a historical relic and should
> not be used. Every driver should register the logtypes
> for itself.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

<...>

> +#ifdef RTE_LIBRTE_E1000_DEBUG_RX
> +	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
> +	if (e1000_logtype_rx >= 0)
> +		rte_log_set_level(e1000_logtype_rx, RTE_LOG_NOTICE);

What do you think setting default level for data path log level to
'RTE_LOG_DEBUG' since they are already controlled by a config option, and to
keep the behavior consistent with previous usage, because almost all macros are
called with DEBUG level. Same for all drivers in this patchset.

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

* Re: [dpdk-dev] [PATCH 3/6] net/ixgbe: use dynamic log type for tx/rx debug
  2019-07-16 15:40 ` [dpdk-dev] [PATCH 3/6] net/ixgbe: " Stephen Hemminger
@ 2019-08-27  8:24   ` Ferruh Yigit
  0 siblings, 0 replies; 13+ messages in thread
From: Ferruh Yigit @ 2019-08-27  8:24 UTC (permalink / raw)
  To: Stephen Hemminger, wenzhuo.lu, konstantin.ananyev, beilei.xing,
	qi.z.zhang, xiao.w.wang, jingjing.wu
  Cc: dev

On 7/16/2019 4:40 PM, Stephen Hemminger wrote:
> The generic RTE_LOGTYPE_PMD is a historical relic and should
> not be used. Every driver must dynamic log types.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

<...>

> @@ -161,16 +161,14 @@ ixgbe_add_tx_flow_control_drop_filter(struct rte_eth_dev *eth_dev)
>  	struct ixgbe_ethertype_filter ethertype_filter;
>  
>  	if (!hw->mac.ops.set_ethertype_anti_spoofing) {
> -		RTE_LOG(INFO, PMD, "ether type anti-spoofing is not"
> -			" supported.\n");
> +		PMD_DRV_LOG(INFO, "ether type anti-spoofing is not supported.\n");
>  		return;
>  	}
>  
>  	i = ixgbe_ethertype_filter_lookup(filter_info,
>  					  IXGBE_ETHERTYPE_FLOW_CTRL);
>  	if (i >= 0) {
> -		RTE_LOG(ERR, PMD, "A ether type filter"
> -			" entity for flow control already exists!\n");
> +		PMD_DRV_LOG(ERR, "A ether type filter entity for flow control already exists!\n");
>  		return;
>  	}
>  

This patch both adds dynamic log for Rx/Tx and converts log macro 'RTE_LOG' to
'PMD_DRV_LOG', can we separate these into two different patches?

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

* Re: [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug
  2019-08-27  8:21   ` Ferruh Yigit
@ 2019-09-30 15:28     ` Ye Xiaolong
  2019-09-30 15:50       ` Stephen Hemminger
  2019-09-30 16:10     ` Ferruh Yigit
  1 sibling, 1 reply; 13+ messages in thread
From: Ye Xiaolong @ 2019-09-30 15:28 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Stephen Hemminger, wenzhuo.lu, konstantin.ananyev, beilei.xing,
	qi.z.zhang, xiao.w.wang, jingjing.wu, dev

On 08/27, Ferruh Yigit wrote:
>On 7/16/2019 4:40 PM, Stephen Hemminger wrote:
>> The generic RTE_LOGTYPE_PMD is a historical relic and should
>> not be used. Every driver should register the logtypes
>> for itself.
>> 
>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
><...>
>
>> +#ifdef RTE_LIBRTE_E1000_DEBUG_RX
>> +	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
>> +	if (e1000_logtype_rx >= 0)
>> +		rte_log_set_level(e1000_logtype_rx, RTE_LOG_NOTICE);
>
>What do you think setting default level for data path log level to
>'RTE_LOG_DEBUG' since they are already controlled by a config option, and to
>keep the behavior consistent with previous usage, because almost all macros are
>called with DEBUG level. Same for all drivers in this patchset.

+1

Thanks,
Xiaolong

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

* Re: [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug
  2019-09-30 15:28     ` Ye Xiaolong
@ 2019-09-30 15:50       ` Stephen Hemminger
  2019-09-30 15:56         ` Ferruh Yigit
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2019-09-30 15:50 UTC (permalink / raw)
  To: Ye Xiaolong
  Cc: Ferruh Yigit, wenzhuo.lu, konstantin.ananyev, beilei.xing,
	qi.z.zhang, xiao.w.wang, jingjing.wu, dev

On Mon, 30 Sep 2019 23:28:38 +0800
Ye Xiaolong <xiaolong.ye@intel.com> wrote:

> On 08/27, Ferruh Yigit wrote:
> >On 7/16/2019 4:40 PM, Stephen Hemminger wrote:  
> >> The generic RTE_LOGTYPE_PMD is a historical relic and should
> >> not be used. Every driver should register the logtypes
> >> for itself.
> >> 
> >> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>  
> >
> ><...>
> >  
> >> +#ifdef RTE_LIBRTE_E1000_DEBUG_RX
> >> +	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
> >> +	if (e1000_logtype_rx >= 0)
> >> +		rte_log_set_level(e1000_logtype_rx, RTE_LOG_NOTICE);  
> >
> >What do you think setting default level for data path log level to
> >'RTE_LOG_DEBUG' since they are already controlled by a config option, and to
> >keep the behavior consistent with previous usage, because almost all macros are
> >called with DEBUG level. Same for all drivers in this patchset.  
> 
> +1
> 
> Thanks,
> Xiaolong

Or drop DEBUG_RX and DEBUG_TX  completely since they are not useful anymore.
The code works, and distributions can not enable this.

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

* Re: [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug
  2019-09-30 15:50       ` Stephen Hemminger
@ 2019-09-30 15:56         ` Ferruh Yigit
  0 siblings, 0 replies; 13+ messages in thread
From: Ferruh Yigit @ 2019-09-30 15:56 UTC (permalink / raw)
  To: Stephen Hemminger, Ye Xiaolong
  Cc: wenzhuo.lu, konstantin.ananyev, beilei.xing, qi.z.zhang,
	xiao.w.wang, jingjing.wu, dev

On 9/30/2019 4:50 PM, Stephen Hemminger wrote:
> On Mon, 30 Sep 2019 23:28:38 +0800
> Ye Xiaolong <xiaolong.ye@intel.com> wrote:
> 
>> On 08/27, Ferruh Yigit wrote:
>>> On 7/16/2019 4:40 PM, Stephen Hemminger wrote:  
>>>> The generic RTE_LOGTYPE_PMD is a historical relic and should
>>>> not be used. Every driver should register the logtypes
>>>> for itself.
>>>>
>>>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>  
>>>
>>> <...>
>>>  
>>>> +#ifdef RTE_LIBRTE_E1000_DEBUG_RX
>>>> +	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
>>>> +	if (e1000_logtype_rx >= 0)
>>>> +		rte_log_set_level(e1000_logtype_rx, RTE_LOG_NOTICE);  
>>>
>>> What do you think setting default level for data path log level to
>>> 'RTE_LOG_DEBUG' since they are already controlled by a config option, and to
>>> keep the behavior consistent with previous usage, because almost all macros are
>>> called with DEBUG level. Same for all drivers in this patchset.  
>>
>> +1
>>
>> Thanks,
>> Xiaolong
> 
> Or drop DEBUG_RX and DEBUG_TX  completely since they are not useful anymore.
> The code works, and distributions can not enable this.
> 

Distributions can't enable this, but still can be useful for the debug. I am
planning to update the default log level to DEBUG and merge it, any objection?

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

* Re: [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug
  2019-08-27  8:21   ` Ferruh Yigit
  2019-09-30 15:28     ` Ye Xiaolong
@ 2019-09-30 16:10     ` Ferruh Yigit
  1 sibling, 0 replies; 13+ messages in thread
From: Ferruh Yigit @ 2019-09-30 16:10 UTC (permalink / raw)
  To: Stephen Hemminger, wenzhuo.lu, konstantin.ananyev, beilei.xing,
	qi.z.zhang, xiao.w.wang, jingjing.wu
  Cc: dev

On 8/27/2019 9:21 AM, Ferruh Yigit wrote:
> On 7/16/2019 4:40 PM, Stephen Hemminger wrote:
>> The generic RTE_LOGTYPE_PMD is a historical relic and should
>> not be used. Every driver should register the logtypes
>> for itself.
>>
>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> <...>
> 
>> +#ifdef RTE_LIBRTE_E1000_DEBUG_RX
>> +	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
>> +	if (e1000_logtype_rx >= 0)
>> +		rte_log_set_level(e1000_logtype_rx, RTE_LOG_NOTICE);
> 
> What do you think setting default level for data path log level to
> 'RTE_LOG_DEBUG' since they are already controlled by a config option, and to
> keep the behavior consistent with previous usage, because almost all macros are
> called with DEBUG level. Same for all drivers in this patchset.
> 

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Series applied to dpdk-next-net/master, thanks.

(Default log level for datapath change to RTE_LOG_DEBUG while merging.)

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

end of thread, other threads:[~2019-09-30 16:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16 15:40 [dpdk-dev] [PATCH 0/6] replace usage of LOGTYPE_PMD in Intel drivers Stephen Hemminger
2019-07-16 15:40 ` [dpdk-dev] [PATCH 1/6] net/e1000: use dynamic log type for tx/rx debug Stephen Hemminger
2019-08-27  8:21   ` Ferruh Yigit
2019-09-30 15:28     ` Ye Xiaolong
2019-09-30 15:50       ` Stephen Hemminger
2019-09-30 15:56         ` Ferruh Yigit
2019-09-30 16:10     ` Ferruh Yigit
2019-07-16 15:40 ` [dpdk-dev] [PATCH 2/6] net/fm10k: " Stephen Hemminger
2019-07-16 15:40 ` [dpdk-dev] [PATCH 3/6] net/ixgbe: " Stephen Hemminger
2019-08-27  8:24   ` Ferruh Yigit
2019-07-16 15:40 ` [dpdk-dev] [PATCH 4/6] net/ice: " Stephen Hemminger
2019-07-16 15:40 ` [dpdk-dev] [PATCH 5/6] net/i40e: " Stephen Hemminger
2019-07-16 15:40 ` [dpdk-dev] [PATCH 6/6] net/iavf: " Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).