DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/8] ether: refine debug compile option
@ 2021-03-10 12:16 Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 1/8] " Qi Zhang
                   ` (13 more replies)
  0 siblings, 14 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-10 12:16 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

Patch 1/8: introduces new compile options for specific Rx/Tx data path
debug in ether layer, so PMD can choose to reuse them to avoid maintain
their own.

- RTE_LIBRTE_ETHDEV_DEBUG_RX
- RTE_LIBRTE_ETHDEV_DEBUG_TX

Patch 2/8 - 8/8: refine all the compile option for Intel PMDs.

Qi Zhang (8):
  ether: refine debug compile option
  net/fm10k: refine debug compile option
  net/e1000: refine debug compile option
  net/i40e: refine debug compile option
  net/iavf: refine debug compile option
  net/ice: refine debug compile option
  net/ixgbe: refine debug compile option
  net/igc: refine debug compile option

 doc/guides/nics/overview.rst     | 20 ++++++++++
 drivers/net/e1000/e1000_logs.c   | 17 ++-------
 drivers/net/e1000/e1000_logs.h   | 13 +------
 drivers/net/e1000/em_rxtx.c      | 38 +++++++++----------
 drivers/net/e1000/igb_rxtx.c     |  2 +-
 drivers/net/fm10k/fm10k_ethdev.c |  7 +---
 drivers/net/fm10k/fm10k_logs.h   | 13 +------
 drivers/net/fm10k/fm10k_rxtx.c   |  8 ++--
 drivers/net/i40e/i40e_ethdev.c   |  7 +---
 drivers/net/i40e/i40e_logs.h     | 13 +------
 drivers/net/i40e/i40e_rxtx.c     | 16 ++++----
 drivers/net/iavf/iavf_ethdev.c   |  7 +---
 drivers/net/iavf/iavf_log.h      | 13 +------
 drivers/net/iavf/iavf_rxtx.c     |  8 ++--
 drivers/net/ice/ice_ethdev.c     |  7 +---
 drivers/net/ice/ice_logs.h       | 13 +------
 drivers/net/ice/ice_rxtx.c       | 20 +++++-----
 drivers/net/igc/igc_logs.h       |  4 +-
 drivers/net/igc/igc_txrx.c       |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h   | 13 +------
 drivers/net/ixgbe/ixgbe_rxtx.c   | 64 ++++++++++++++++----------------
 lib/librte_ethdev/rte_ethdev.h   | 16 ++++----
 23 files changed, 135 insertions(+), 193 deletions(-)

-- 
2.26.2


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

* [dpdk-dev] [PATCH 1/8] ether: refine debug compile option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
@ 2021-03-10 12:16 ` Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 2/8] net/fm10k: " Qi Zhang
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-10 12:16 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

The patch introduces below compile options for specific Rx/Tx data path
debug, so PMD can choose to reuse them to avoid maintain their own.

- RTE_LIBRTE_ETHDEV_DEBUG_RX
- RTE_LIBRTE_ETHDEV_DEBUG_TX

Also, all the compile options are documented on the overview page, so
users can easily find them.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 doc/guides/nics/overview.rst   | 20 ++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h | 16 ++++++++--------
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
index 20cd52b097..20cf54ef32 100644
--- a/doc/guides/nics/overview.rst
+++ b/doc/guides/nics/overview.rst
@@ -32,3 +32,23 @@ More details about features can be found in :doc:`features`.
 
    Features marked with "P" are partially supported. Refer to the appropriate
    NIC guide in the following sections for details.
+
+The ethdev layer support below compile options for debug purpose:
+
+- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
+
+  Compile with debug code on data path.
+
+- ``RTE_LIBRTE_ETHDEV_DEBUG_RX`` (default **disabled**)
+
+  Compile with debug code on Rx data path.
+
+- ``RTE_LIBRTE_ETHDEV_DEBUG_TX`` (default **disabled**)
+
+  Compile with debug code on Tx data path.
+
+.. Note::
+
+   The lib_ethdev use above options to wrap debug code to trace invalid parameters on
+   data path APIs, so performance downgrade is expected when enable those options.
+   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 059a061072..335831129f 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -4877,7 +4877,7 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	uint16_t nb_rx;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_RX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
 
@@ -5011,11 +5011,11 @@ rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev;
 	void *rxq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined (RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_RX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined (RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_RX)
 	if (queue_id >= dev->data->nb_rx_queues)
 		return -ENODEV;
 #endif
@@ -5068,11 +5068,11 @@ static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
 	struct rte_eth_dev *dev;
 	void *txq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined (RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_TX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined (RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_TX)
 	if (queue_id >= dev->data->nb_tx_queues)
 		return -ENODEV;
 #endif
@@ -5154,7 +5154,7 @@ rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined (RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_TX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
 
@@ -5252,7 +5252,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined (RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_TX)
 	if (!rte_eth_dev_is_valid_port(port_id)) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX port_id=%u\n", port_id);
 		rte_errno = ENODEV;
@@ -5262,7 +5262,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 
 	dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined (RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_TX)
 	if (queue_id >= dev->data->nb_tx_queues) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
 		rte_errno = EINVAL;
-- 
2.26.2


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

* [dpdk-dev] [PATCH 2/8] net/fm10k: refine debug compile option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 1/8] " Qi Zhang
@ 2021-03-10 12:16 ` Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 3/8] net/e1000: " Qi Zhang
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-10 12:16 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_FM10K_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_FM10K_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_FM10K_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c |  7 ++-----
 drivers/net/fm10k/fm10k_logs.h   | 13 ++-----------
 drivers/net/fm10k/fm10k_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index fd471c415e..c6c6b0d111 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3287,12 +3287,9 @@ RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_LOG_REGISTER(fm10k_logtype_init, pmd.net.fm10k.init, NOTICE);
 RTE_LOG_REGISTER(fm10k_logtype_driver, pmd.net.fm10k.driver, NOTICE);
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(fm10k_logtype_rx, pmd.net.fm10k.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(fm10k_logtype_tx, pmd.net.fm10k.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-RTE_LOG_REGISTER(fm10k_logtype_tx_free, pmd.net.fm10k.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h
index 9ae743d806..36ada34d8f 100644
--- a/drivers/net/fm10k/fm10k_logs.h
+++ b/drivers/net/fm10k/fm10k_logs.h
@@ -14,7 +14,7 @@ extern int fm10k_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-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
-
 extern int fm10k_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 8585c5b9e4..ac9a35d6c3 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -16,7 +16,7 @@
 #define rte_packet_prefetch(p)  do {} while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 static inline void dump_rxd(union fm10k_rx_desc *rxd)
 {
 	PMD_RX_LOG(DEBUG, "+----------------|----------------+");
@@ -115,7 +115,7 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 		rte_pktmbuf_pkt_len(mbuf) = desc.w.length;
@@ -229,7 +229,7 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 
@@ -710,7 +710,7 @@ fm10k_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH 3/8] net/e1000: refine debug compile option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 1/8] " Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 2/8] net/fm10k: " Qi Zhang
@ 2021-03-10 12:16 ` Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 4/8] net/i40e: " Qi Zhang
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-10 12:16 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_E1000_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_E1000_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_E1000_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/e1000/e1000_logs.c | 17 ++++-----------
 drivers/net/e1000/e1000_logs.h | 13 ++----------
 drivers/net/e1000/em_rxtx.c    | 38 +++++++++++++++++-----------------
 drivers/net/e1000/igb_rxtx.c   |  2 +-
 4 files changed, 26 insertions(+), 44 deletions(-)

diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 231f5c03ef..f4b5a545f6 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -8,15 +8,12 @@
 int e1000_logtype_init;
 int e1000_logtype_driver;
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 int e1000_logtype_rx;
 #endif
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_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;
@@ -34,23 +31,17 @@ e1000_igb_init_log(void)
 	if (e1000_logtype_driver >= 0)
 		rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
 	if (e1000_logtype_rx >= 0)
 		rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 	e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
 	if (e1000_logtype_tx >= 0)
 		rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-	e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
-	if (e1000_logtype_tx_free >= 0)
-		rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
-#endif
-
 	e1000_log_initialized = 1;
 }
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 2612134f38..c989033392 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -15,7 +15,7 @@ extern int e1000_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_rx,	\
@@ -24,7 +24,7 @@ extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_tx,	\
@@ -33,15 +33,6 @@ extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-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)
-#endif
-
 extern int e1000_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, e1000_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index db5d1222ce..47a02b6cf4 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -311,10 +311,10 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (! (txr[desc_to_clean_to].upper.fields.status & E1000_TXD_STAT_DD))
 	{
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -327,11 +327,11 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)", nb_tx_to_clean,
-			last_desc_cleaned, desc_to_clean_to, txq->port_id,
-			txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)", nb_tx_to_clean,
+		   last_desc_cleaned, desc_to_clean_to, txq->port_id,
+		   txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -457,11 +457,11 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		while (unlikely (nb_used > txq->nb_tx_free)) {
-			PMD_TX_FREE_LOG(DEBUG, "Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG, "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (em_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -579,10 +579,10 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id=%4u "
-					"(port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id=%4u "
+				   "(port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= E1000_TXD_CMD_RS;
 
@@ -626,7 +626,7 @@ eth_em_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 1500d2ffff..5749650f95 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -641,7 +641,7 @@ eth_igb_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH 4/8] net/i40e: refine debug compile option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (2 preceding siblings ...)
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 3/8] net/e1000: " Qi Zhang
@ 2021-03-10 12:16 ` Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 5/8] net/iavf: " Qi Zhang
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-10 12:16 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_I40E_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_I40E_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_I40E_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  7 ++-----
 drivers/net/i40e/i40e_logs.h   | 13 ++-----------
 drivers/net/i40e/i40e_rxtx.c   | 16 ++++++++--------
 3 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index d7cd049891..afd88c36d2 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12373,15 +12373,12 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
 
 RTE_LOG_REGISTER(i40e_logtype_init, pmd.net.i40e.init, NOTICE);
 RTE_LOG_REGISTER(i40e_logtype_driver, pmd.net.i40e.driver, NOTICE);
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(i40e_logtype_rx, pmd.net.i40e.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(i40e_logtype_tx, pmd.net.i40e.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-RTE_LOG_REGISTER(i40e_logtype_tx_free, pmd.net.i40e.tx_free, DEBUG);
-#endif
 
 RTE_PMD_REGISTER_PARAM_STRING(net_i40e,
 			      ETH_I40E_FLOATING_VEB_ARG "=1"
diff --git a/drivers/net/i40e/i40e_logs.h b/drivers/net/i40e/i40e_logs.h
index dac3267eb4..e747fa8681 100644
--- a/drivers/net/i40e/i40e_logs.h
+++ b/drivers/net/i40e/i40e_logs.h
@@ -11,7 +11,7 @@ extern int i40e_logtype_init;
 		__func__, ##args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_rx,	\
@@ -20,7 +20,7 @@ extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_tx,	\
@@ -29,15 +29,6 @@ extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-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)
-#endif
-
 extern int i40e_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, i40e_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 61cb204be2..e5eecf03de 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -372,9 +372,9 @@ i40e_xmit_cleanup(struct i40e_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-			"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -1253,10 +1253,10 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_used);
 
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= I40E_TX_DESC_CMD_RS;
 
@@ -1525,7 +1525,7 @@ i40e_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH 5/8] net/iavf: refine debug compile option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (3 preceding siblings ...)
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 4/8] net/i40e: " Qi Zhang
@ 2021-03-10 12:16 ` Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 6/8] net/ice: " Qi Zhang
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-10 12:16 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IAVF_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IAVF_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IAVF_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c |  7 ++-----
 drivers/net/iavf/iavf_log.h    | 13 ++-----------
 drivers/net/iavf/iavf_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 4d37722022..863160135f 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -2360,12 +2360,9 @@ RTE_PMD_REGISTER_KMOD_DEP(net_iavf, "* igb_uio | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(net_iavf, "cap=dcf");
 RTE_LOG_REGISTER(iavf_logtype_init, pmd.net.iavf.init, NOTICE);
 RTE_LOG_REGISTER(iavf_logtype_driver, pmd.net.iavf.driver, NOTICE);
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(iavf_logtype_rx, pmd.net.iavf.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(iavf_logtype_tx, pmd.net.iavf.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-RTE_LOG_REGISTER(iavf_logtype_tx_free, pmd.net.iavf.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/iavf/iavf_log.h b/drivers/net/iavf/iavf_log.h
index 1088ec75f5..c83f09cc25 100644
--- a/drivers/net/iavf/iavf_log.h
+++ b/drivers/net/iavf/iavf_log.h
@@ -21,7 +21,7 @@ extern int iavf_logtype_driver;
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>")
 
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_rx,	\
@@ -30,7 +30,7 @@ extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_tx,	\
@@ -39,13 +39,4 @@ extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-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
-
 #endif /* _IAVF_LOG_H_ */
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 8fafe4579b..c4611c0431 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -1979,9 +1979,9 @@ iavf_xmit_cleanup(struct iavf_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(IAVF_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(IAVF_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -2335,7 +2335,7 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH 6/8] net/ice: refine debug compile option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (4 preceding siblings ...)
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 5/8] net/iavf: " Qi Zhang
@ 2021-03-10 12:16 ` Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 7/8] net/ixgbe: " Qi Zhang
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-10 12:16 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_ICE_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_ICE_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ICE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.c |  7 ++-----
 drivers/net/ice/ice_logs.h   | 13 ++-----------
 drivers/net/ice/ice_rxtx.c   | 20 ++++++++++----------
 3 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 8999d441ac..3de7e513f9 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -5366,12 +5366,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ice,
 
 RTE_LOG_REGISTER(ice_logtype_init, pmd.net.ice.init, NOTICE);
 RTE_LOG_REGISTER(ice_logtype_driver, pmd.net.ice.driver, NOTICE);
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ice_logtype_rx, pmd.net.ice.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ice_logtype_tx, pmd.net.ice.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ice_logtype_tx_free, pmd.net.ice.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ice/ice_logs.h b/drivers/net/ice/ice_logs.h
index aab7da5f7b..8e2463b69f 100644
--- a/drivers/net/ice/ice_logs.h
+++ b/drivers/net/ice/ice_logs.h
@@ -14,7 +14,7 @@ extern int ice_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-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
-
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ice_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 530c206f4f..74fbd46f47 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2436,11 +2436,11 @@ ice_xmit_cleanup(struct ice_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (!(txd[desc_to_clean_to].cmd_type_offset_bsz &
 	    rte_cpu_to_le_64(ICE_TX_DESC_DTYPE_DESC_DONE))) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d) value=0x%"PRIx64"\n",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id,
-				txd[desc_to_clean_to].cmd_type_offset_bsz);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d) value=0x%"PRIx64"\n",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id,
+			   txd[desc_to_clean_to].cmd_type_offset_bsz);
 		/* Failed to clean any descriptors */
 		return -1;
 	}
@@ -2731,10 +2731,10 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		/* set RS bit on the last descriptor of one packet */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= ICE_TX_DESC_CMD_RS;
 
@@ -3243,7 +3243,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH 7/8] net/ixgbe: refine debug compile option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (5 preceding siblings ...)
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 6/8] net/ice: " Qi Zhang
@ 2021-03-10 12:16 ` Qi Zhang
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 8/8] net/igc: " Qi Zhang
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-10 12:16 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IXGBE_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IXGBE_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IXGBE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h   | 13 +------
 drivers/net/ixgbe/ixgbe_rxtx.c   | 64 ++++++++++++++++----------------
 3 files changed, 36 insertions(+), 48 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 761a0f26bb..f48db42c0d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -8455,12 +8455,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf,
 RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.init, NOTICE);
 RTE_LOG_REGISTER(ixgbe_logtype_driver, pmd.net.ixgbe.driver, NOTICE);
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ixgbe_logtype_rx, pmd.net.ixgbe.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ixgbe_logtype_tx, pmd.net.ixgbe.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ixgbe_logtype_tx_free, pmd.net.ixgbe.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ixgbe/ixgbe_logs.h b/drivers/net/ixgbe/ixgbe_logs.h
index 2a279d1098..983adeffe0 100644
--- a/drivers/net/ixgbe/ixgbe_logs.h
+++ b/drivers/net/ixgbe/ixgbe_logs.h
@@ -12,7 +12,7 @@ extern int ixgbe_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx,	\
@@ -21,7 +21,7 @@ extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx,	\
@@ -30,15 +30,6 @@ extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-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)
-#endif
-
 extern int ixgbe_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 7d23bab290..9ba62af04b 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -583,11 +583,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	status = txr[desc_to_clean_to].wb.status;
 	if (!(status & rte_cpu_to_le_32(IXGBE_TXD_STAT_DD))) {
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -600,11 +600,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)",
-			nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
-			txq->port_id, txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)",
+		   nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
+		   txq->port_id, txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -750,12 +750,12 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		if (nb_used > txq->nb_tx_free) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (ixgbe_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -766,17 +766,17 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 			/* nb_used better be <= txq->tx_rs_thresh */
 			if (unlikely(nb_used > txq->tx_rs_thresh)) {
-				PMD_TX_FREE_LOG(DEBUG,
-					"The number of descriptors needed to "
-					"transmit the packet exceeds the "
-					"RS bit threshold. This will impact "
-					"performance."
-					"nb_used=%4u nb_free=%4u "
-					"tx_rs_thresh=%4u. "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->tx_rs_thresh,
-					txq->port_id, txq->queue_id);
+				PMD_TX_LOG(DEBUG,
+					   "The number of descriptors needed to "
+					   "transmit the packet exceeds the "
+					   "RS bit threshold. This will impact "
+					   "performance."
+					   "nb_used=%4u nb_free=%4u "
+					   "tx_rs_thresh=%4u. "
+					   "(port=%d queue=%d)",
+					   nb_used, txq->nb_tx_free,
+					   txq->tx_rs_thresh,
+					   txq->port_id, txq->queue_id);
 				/*
 				 * Loop here until there are enough TX
 				 * descriptors or until the ring cannot be
@@ -920,10 +920,10 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= IXGBE_TXD_CMD_RS;
 
@@ -995,7 +995,7 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH 8/8] net/igc: refine debug compile option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (6 preceding siblings ...)
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 7/8] net/ixgbe: " Qi Zhang
@ 2021-03-10 12:16 ` Qi Zhang
  2021-03-10 12:35 ` [dpdk-dev] [PATCH 0/8] ether: " Ferruh Yigit
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-10 12:16 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 6457c4d180..a67a79b900 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -20,14 +20,14 @@ extern int igc_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index c0a5d5e84f..2c632786b9 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -1434,7 +1434,7 @@ eth_igc_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* Re: [dpdk-dev] [PATCH 0/8] ether: refine debug compile option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (7 preceding siblings ...)
  2021-03-10 12:16 ` [dpdk-dev] [PATCH 8/8] net/igc: " Qi Zhang
@ 2021-03-10 12:35 ` Ferruh Yigit
  2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-10 12:35 UTC (permalink / raw)
  To: Qi Zhang
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang

On 3/10/2021 12:16 PM, Qi Zhang wrote:
> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option to wrap
> data path debug code. As .config has been removed since the meson build,
> It is not friendly for new DPDK users to notice those debug options.
> 
> Patch 1/8: introduces new compile options for specific Rx/Tx data path
> debug in ether layer, so PMD can choose to reuse them to avoid maintain
> their own.
> 
> - RTE_LIBRTE_ETHDEV_DEBUG_RX
> - RTE_LIBRTE_ETHDEV_DEBUG_TX
> 

+1 to have common flag and documentation

> Patch 2/8 - 8/8: refine all the compile option for Intel PMDs.
> 
> Qi Zhang (8):
>    ether: refine debug compile option
>    net/fm10k: refine debug compile option
>    net/e1000: refine debug compile option
>    net/i40e: refine debug compile option
>    net/iavf: refine debug compile option
>    net/ice: refine debug compile option
>    net/ixgbe: refine debug compile option
>    net/igc: refine debug compile option

<...>



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

* [dpdk-dev] [PATCH v2 0/8] ether: refine debug compile option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (8 preceding siblings ...)
  2021-03-10 12:35 ` [dpdk-dev] [PATCH 0/8] ether: " Ferruh Yigit
@ 2021-03-12 12:12 ` Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 1/8] " Qi Zhang
                     ` (7 more replies)
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
                   ` (3 subsequent siblings)
  13 siblings, 8 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-12 12:12 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

Patch 1/8: introduces new compile options for specific Rx/Tx data path
debug in ether layer, so PMD can choose to reuse them to avoid maintain
their own.

- RTE_LIBRTE_ETHDEV_DEBUG_RX
- RTE_LIBRTE_ETHDEV_DEBUG_TX

Patch 2/8 - 8/8: refine all the compile option for Intel PMDs.

v2:
- fix some coding style issues.

Qi Zhang (8):
  ether: refine debug compile option
  net/fm10k: refine debug compile option
  net/e1000: refine debug compile option
  net/i40e: refine debug compile option
  net/iavf: refine debug compile option
  net/ice: refine debug compile option
  net/ixgbe: refine debug compile option
  net/igc: refine debug compile option

 doc/guides/nics/overview.rst     | 20 ++++++++++
 drivers/net/e1000/e1000_logs.c   | 17 ++-------
 drivers/net/e1000/e1000_logs.h   | 13 +------
 drivers/net/e1000/em_rxtx.c      | 38 +++++++++----------
 drivers/net/e1000/igb_rxtx.c     |  2 +-
 drivers/net/fm10k/fm10k_ethdev.c |  7 +---
 drivers/net/fm10k/fm10k_logs.h   | 13 +------
 drivers/net/fm10k/fm10k_rxtx.c   |  8 ++--
 drivers/net/i40e/i40e_ethdev.c   |  7 +---
 drivers/net/i40e/i40e_logs.h     | 13 +------
 drivers/net/i40e/i40e_rxtx.c     | 16 ++++----
 drivers/net/iavf/iavf_ethdev.c   |  7 +---
 drivers/net/iavf/iavf_log.h      | 13 +------
 drivers/net/iavf/iavf_rxtx.c     |  8 ++--
 drivers/net/ice/ice_ethdev.c     |  7 +---
 drivers/net/ice/ice_logs.h       | 13 +------
 drivers/net/ice/ice_rxtx.c       | 20 +++++-----
 drivers/net/igc/igc_logs.h       |  4 +-
 drivers/net/igc/igc_txrx.c       |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h   | 13 +------
 drivers/net/ixgbe/ixgbe_rxtx.c   | 64 ++++++++++++++++----------------
 lib/librte_ethdev/rte_ethdev.h   | 16 ++++----
 23 files changed, 135 insertions(+), 193 deletions(-)

-- 
2.26.2


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

* [dpdk-dev] [PATCH v2 1/8] ether: refine debug compile option
  2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
@ 2021-03-12 12:12   ` Qi Zhang
  2021-03-16 13:05     ` Ferruh Yigit
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 2/8] net/fm10k: " Qi Zhang
                     ` (6 subsequent siblings)
  7 siblings, 1 reply; 81+ messages in thread
From: Qi Zhang @ 2021-03-12 12:12 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

The patch introduces below compile options for specific Rx/Tx data path
debug, so PMD can choose to reuse them to avoid maintain their own.

- RTE_LIBRTE_ETHDEV_DEBUG_RX
- RTE_LIBRTE_ETHDEV_DEBUG_TX

Also, all the compile options are documented on the overview page, so
users can easily find them.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 doc/guides/nics/overview.rst   | 20 ++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h | 16 ++++++++--------
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
index 20cd52b097..20cf54ef32 100644
--- a/doc/guides/nics/overview.rst
+++ b/doc/guides/nics/overview.rst
@@ -32,3 +32,23 @@ More details about features can be found in :doc:`features`.
 
    Features marked with "P" are partially supported. Refer to the appropriate
    NIC guide in the following sections for details.
+
+The ethdev layer support below compile options for debug purpose:
+
+- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
+
+  Compile with debug code on data path.
+
+- ``RTE_LIBRTE_ETHDEV_DEBUG_RX`` (default **disabled**)
+
+  Compile with debug code on Rx data path.
+
+- ``RTE_LIBRTE_ETHDEV_DEBUG_TX`` (default **disabled**)
+
+  Compile with debug code on Tx data path.
+
+.. Note::
+
+   The lib_ethdev use above options to wrap debug code to trace invalid parameters on
+   data path APIs, so performance downgrade is expected when enable those options.
+   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 059a061072..e4352c0c32 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -4877,7 +4877,7 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	uint16_t nb_rx;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_RX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
 
@@ -5011,11 +5011,11 @@ rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev;
 	void *rxq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_RX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_RX)
 	if (queue_id >= dev->data->nb_rx_queues)
 		return -ENODEV;
 #endif
@@ -5068,11 +5068,11 @@ static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
 	struct rte_eth_dev *dev;
 	void *txq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_TX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_TX)
 	if (queue_id >= dev->data->nb_tx_queues)
 		return -ENODEV;
 #endif
@@ -5154,7 +5154,7 @@ rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_TX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
 
@@ -5252,7 +5252,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_TX)
 	if (!rte_eth_dev_is_valid_port(port_id)) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX port_id=%u\n", port_id);
 		rte_errno = ENODEV;
@@ -5262,7 +5262,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 
 	dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || defined(RTE_LIBRTE_ETHDEV_DEBUG_TX)
 	if (queue_id >= dev->data->nb_tx_queues) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
 		rte_errno = EINVAL;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v2 2/8] net/fm10k: refine debug compile option
  2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 1/8] " Qi Zhang
@ 2021-03-12 12:12   ` Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 3/8] net/e1000: " Qi Zhang
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-12 12:12 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_FM10K_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_FM10K_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_FM10K_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c |  7 ++-----
 drivers/net/fm10k/fm10k_logs.h   | 13 ++-----------
 drivers/net/fm10k/fm10k_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index fd471c415e..c6c6b0d111 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3287,12 +3287,9 @@ RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_LOG_REGISTER(fm10k_logtype_init, pmd.net.fm10k.init, NOTICE);
 RTE_LOG_REGISTER(fm10k_logtype_driver, pmd.net.fm10k.driver, NOTICE);
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(fm10k_logtype_rx, pmd.net.fm10k.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(fm10k_logtype_tx, pmd.net.fm10k.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-RTE_LOG_REGISTER(fm10k_logtype_tx_free, pmd.net.fm10k.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h
index 9ae743d806..36ada34d8f 100644
--- a/drivers/net/fm10k/fm10k_logs.h
+++ b/drivers/net/fm10k/fm10k_logs.h
@@ -14,7 +14,7 @@ extern int fm10k_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-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
-
 extern int fm10k_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 8585c5b9e4..ac9a35d6c3 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -16,7 +16,7 @@
 #define rte_packet_prefetch(p)  do {} while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 static inline void dump_rxd(union fm10k_rx_desc *rxd)
 {
 	PMD_RX_LOG(DEBUG, "+----------------|----------------+");
@@ -115,7 +115,7 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 		rte_pktmbuf_pkt_len(mbuf) = desc.w.length;
@@ -229,7 +229,7 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 
@@ -710,7 +710,7 @@ fm10k_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v2 3/8] net/e1000: refine debug compile option
  2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 1/8] " Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 2/8] net/fm10k: " Qi Zhang
@ 2021-03-12 12:12   ` Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 4/8] net/i40e: " Qi Zhang
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-12 12:12 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_E1000_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_E1000_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_E1000_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/e1000/e1000_logs.c | 17 ++++-----------
 drivers/net/e1000/e1000_logs.h | 13 ++----------
 drivers/net/e1000/em_rxtx.c    | 38 +++++++++++++++++-----------------
 drivers/net/e1000/igb_rxtx.c   |  2 +-
 4 files changed, 26 insertions(+), 44 deletions(-)

diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 231f5c03ef..f4b5a545f6 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -8,15 +8,12 @@
 int e1000_logtype_init;
 int e1000_logtype_driver;
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 int e1000_logtype_rx;
 #endif
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_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;
@@ -34,23 +31,17 @@ e1000_igb_init_log(void)
 	if (e1000_logtype_driver >= 0)
 		rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
 	if (e1000_logtype_rx >= 0)
 		rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 	e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
 	if (e1000_logtype_tx >= 0)
 		rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-	e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
-	if (e1000_logtype_tx_free >= 0)
-		rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
-#endif
-
 	e1000_log_initialized = 1;
 }
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 2612134f38..c989033392 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -15,7 +15,7 @@ extern int e1000_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_rx,	\
@@ -24,7 +24,7 @@ extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_tx,	\
@@ -33,15 +33,6 @@ extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-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)
-#endif
-
 extern int e1000_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, e1000_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index db5d1222ce..47a02b6cf4 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -311,10 +311,10 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (! (txr[desc_to_clean_to].upper.fields.status & E1000_TXD_STAT_DD))
 	{
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -327,11 +327,11 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)", nb_tx_to_clean,
-			last_desc_cleaned, desc_to_clean_to, txq->port_id,
-			txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)", nb_tx_to_clean,
+		   last_desc_cleaned, desc_to_clean_to, txq->port_id,
+		   txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -457,11 +457,11 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		while (unlikely (nb_used > txq->nb_tx_free)) {
-			PMD_TX_FREE_LOG(DEBUG, "Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG, "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (em_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -579,10 +579,10 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id=%4u "
-					"(port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id=%4u "
+				   "(port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= E1000_TXD_CMD_RS;
 
@@ -626,7 +626,7 @@ eth_em_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 1500d2ffff..5749650f95 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -641,7 +641,7 @@ eth_igb_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v2 4/8] net/i40e: refine debug compile option
  2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
                     ` (2 preceding siblings ...)
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 3/8] net/e1000: " Qi Zhang
@ 2021-03-12 12:12   ` Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 5/8] net/iavf: " Qi Zhang
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-12 12:12 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_I40E_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_I40E_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_I40E_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  7 ++-----
 drivers/net/i40e/i40e_logs.h   | 13 ++-----------
 drivers/net/i40e/i40e_rxtx.c   | 16 ++++++++--------
 3 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index d7cd049891..afd88c36d2 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12373,15 +12373,12 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
 
 RTE_LOG_REGISTER(i40e_logtype_init, pmd.net.i40e.init, NOTICE);
 RTE_LOG_REGISTER(i40e_logtype_driver, pmd.net.i40e.driver, NOTICE);
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(i40e_logtype_rx, pmd.net.i40e.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(i40e_logtype_tx, pmd.net.i40e.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-RTE_LOG_REGISTER(i40e_logtype_tx_free, pmd.net.i40e.tx_free, DEBUG);
-#endif
 
 RTE_PMD_REGISTER_PARAM_STRING(net_i40e,
 			      ETH_I40E_FLOATING_VEB_ARG "=1"
diff --git a/drivers/net/i40e/i40e_logs.h b/drivers/net/i40e/i40e_logs.h
index dac3267eb4..e747fa8681 100644
--- a/drivers/net/i40e/i40e_logs.h
+++ b/drivers/net/i40e/i40e_logs.h
@@ -11,7 +11,7 @@ extern int i40e_logtype_init;
 		__func__, ##args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_rx,	\
@@ -20,7 +20,7 @@ extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_tx,	\
@@ -29,15 +29,6 @@ extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-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)
-#endif
-
 extern int i40e_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, i40e_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 61cb204be2..e5eecf03de 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -372,9 +372,9 @@ i40e_xmit_cleanup(struct i40e_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-			"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -1253,10 +1253,10 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_used);
 
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= I40E_TX_DESC_CMD_RS;
 
@@ -1525,7 +1525,7 @@ i40e_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v2 5/8] net/iavf: refine debug compile option
  2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
                     ` (3 preceding siblings ...)
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 4/8] net/i40e: " Qi Zhang
@ 2021-03-12 12:12   ` Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 6/8] net/ice: " Qi Zhang
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-12 12:12 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IAVF_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IAVF_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IAVF_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c |  7 ++-----
 drivers/net/iavf/iavf_log.h    | 13 ++-----------
 drivers/net/iavf/iavf_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 4d37722022..863160135f 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -2360,12 +2360,9 @@ RTE_PMD_REGISTER_KMOD_DEP(net_iavf, "* igb_uio | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(net_iavf, "cap=dcf");
 RTE_LOG_REGISTER(iavf_logtype_init, pmd.net.iavf.init, NOTICE);
 RTE_LOG_REGISTER(iavf_logtype_driver, pmd.net.iavf.driver, NOTICE);
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(iavf_logtype_rx, pmd.net.iavf.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(iavf_logtype_tx, pmd.net.iavf.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-RTE_LOG_REGISTER(iavf_logtype_tx_free, pmd.net.iavf.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/iavf/iavf_log.h b/drivers/net/iavf/iavf_log.h
index 1088ec75f5..c83f09cc25 100644
--- a/drivers/net/iavf/iavf_log.h
+++ b/drivers/net/iavf/iavf_log.h
@@ -21,7 +21,7 @@ extern int iavf_logtype_driver;
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>")
 
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_rx,	\
@@ -30,7 +30,7 @@ extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_tx,	\
@@ -39,13 +39,4 @@ extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-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
-
 #endif /* _IAVF_LOG_H_ */
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 8fafe4579b..c4611c0431 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -1979,9 +1979,9 @@ iavf_xmit_cleanup(struct iavf_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(IAVF_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(IAVF_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -2335,7 +2335,7 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v2 6/8] net/ice: refine debug compile option
  2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
                     ` (4 preceding siblings ...)
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 5/8] net/iavf: " Qi Zhang
@ 2021-03-12 12:12   ` Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 7/8] net/ixgbe: " Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 8/8] net/igc: " Qi Zhang
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-12 12:12 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_ICE_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_ICE_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ICE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.c |  7 ++-----
 drivers/net/ice/ice_logs.h   | 13 ++-----------
 drivers/net/ice/ice_rxtx.c   | 20 ++++++++++----------
 3 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 8999d441ac..3de7e513f9 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -5366,12 +5366,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ice,
 
 RTE_LOG_REGISTER(ice_logtype_init, pmd.net.ice.init, NOTICE);
 RTE_LOG_REGISTER(ice_logtype_driver, pmd.net.ice.driver, NOTICE);
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ice_logtype_rx, pmd.net.ice.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ice_logtype_tx, pmd.net.ice.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ice_logtype_tx_free, pmd.net.ice.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ice/ice_logs.h b/drivers/net/ice/ice_logs.h
index aab7da5f7b..8e2463b69f 100644
--- a/drivers/net/ice/ice_logs.h
+++ b/drivers/net/ice/ice_logs.h
@@ -14,7 +14,7 @@ extern int ice_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-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
-
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ice_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 530c206f4f..74fbd46f47 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2436,11 +2436,11 @@ ice_xmit_cleanup(struct ice_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (!(txd[desc_to_clean_to].cmd_type_offset_bsz &
 	    rte_cpu_to_le_64(ICE_TX_DESC_DTYPE_DESC_DONE))) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d) value=0x%"PRIx64"\n",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id,
-				txd[desc_to_clean_to].cmd_type_offset_bsz);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d) value=0x%"PRIx64"\n",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id,
+			   txd[desc_to_clean_to].cmd_type_offset_bsz);
 		/* Failed to clean any descriptors */
 		return -1;
 	}
@@ -2731,10 +2731,10 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		/* set RS bit on the last descriptor of one packet */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= ICE_TX_DESC_CMD_RS;
 
@@ -3243,7 +3243,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v2 7/8] net/ixgbe: refine debug compile option
  2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
                     ` (5 preceding siblings ...)
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 6/8] net/ice: " Qi Zhang
@ 2021-03-12 12:12   ` Qi Zhang
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 8/8] net/igc: " Qi Zhang
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-12 12:12 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IXGBE_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IXGBE_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IXGBE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h   | 13 +------
 drivers/net/ixgbe/ixgbe_rxtx.c   | 64 ++++++++++++++++----------------
 3 files changed, 36 insertions(+), 48 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 761a0f26bb..f48db42c0d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -8455,12 +8455,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf,
 RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.init, NOTICE);
 RTE_LOG_REGISTER(ixgbe_logtype_driver, pmd.net.ixgbe.driver, NOTICE);
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ixgbe_logtype_rx, pmd.net.ixgbe.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ixgbe_logtype_tx, pmd.net.ixgbe.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ixgbe_logtype_tx_free, pmd.net.ixgbe.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ixgbe/ixgbe_logs.h b/drivers/net/ixgbe/ixgbe_logs.h
index 2a279d1098..983adeffe0 100644
--- a/drivers/net/ixgbe/ixgbe_logs.h
+++ b/drivers/net/ixgbe/ixgbe_logs.h
@@ -12,7 +12,7 @@ extern int ixgbe_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx,	\
@@ -21,7 +21,7 @@ extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx,	\
@@ -30,15 +30,6 @@ extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-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)
-#endif
-
 extern int ixgbe_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 7d23bab290..9ba62af04b 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -583,11 +583,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	status = txr[desc_to_clean_to].wb.status;
 	if (!(status & rte_cpu_to_le_32(IXGBE_TXD_STAT_DD))) {
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -600,11 +600,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)",
-			nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
-			txq->port_id, txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)",
+		   nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
+		   txq->port_id, txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -750,12 +750,12 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		if (nb_used > txq->nb_tx_free) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (ixgbe_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -766,17 +766,17 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 			/* nb_used better be <= txq->tx_rs_thresh */
 			if (unlikely(nb_used > txq->tx_rs_thresh)) {
-				PMD_TX_FREE_LOG(DEBUG,
-					"The number of descriptors needed to "
-					"transmit the packet exceeds the "
-					"RS bit threshold. This will impact "
-					"performance."
-					"nb_used=%4u nb_free=%4u "
-					"tx_rs_thresh=%4u. "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->tx_rs_thresh,
-					txq->port_id, txq->queue_id);
+				PMD_TX_LOG(DEBUG,
+					   "The number of descriptors needed to "
+					   "transmit the packet exceeds the "
+					   "RS bit threshold. This will impact "
+					   "performance."
+					   "nb_used=%4u nb_free=%4u "
+					   "tx_rs_thresh=%4u. "
+					   "(port=%d queue=%d)",
+					   nb_used, txq->nb_tx_free,
+					   txq->tx_rs_thresh,
+					   txq->port_id, txq->queue_id);
 				/*
 				 * Loop here until there are enough TX
 				 * descriptors or until the ring cannot be
@@ -920,10 +920,10 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= IXGBE_TXD_CMD_RS;
 
@@ -995,7 +995,7 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v2 8/8] net/igc: refine debug compile option
  2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
                     ` (6 preceding siblings ...)
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 7/8] net/ixgbe: " Qi Zhang
@ 2021-03-12 12:12   ` Qi Zhang
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-12 12:12 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_LIBRTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_LIBRTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_LIBRTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 6457c4d180..a67a79b900 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -20,14 +20,14 @@ extern int igc_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_RX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_TX
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index c0a5d5e84f..2c632786b9 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -1434,7 +1434,7 @@ eth_igc_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* Re: [dpdk-dev] [PATCH v2 1/8] ether: refine debug compile option
  2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 1/8] " Qi Zhang
@ 2021-03-16 13:05     ` Ferruh Yigit
  2021-03-16 13:39       ` Thomas Monjalon
  0 siblings, 1 reply; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-16 13:05 UTC (permalink / raw)
  To: Qi Zhang, Thomas Monjalon, Andrew Rybchenko
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang

On 3/12/2021 12:12 PM, Qi Zhang wrote:
> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option to wrap
> data path debug code. As .config has been removed since the meson build,
> It is not friendly for new DPDK users to notice those debug options.
> 
> The patch introduces below compile options for specific Rx/Tx data path
> debug, so PMD can choose to reuse them to avoid maintain their own.
> 
> - RTE_LIBRTE_ETHDEV_DEBUG_RX
> - RTE_LIBRTE_ETHDEV_DEBUG_TX
> 
> Also, all the compile options are documented on the overview page, so
> users can easily find them.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>   doc/guides/nics/overview.rst   | 20 ++++++++++++++++++++
>   lib/librte_ethdev/rte_ethdev.h | 16 ++++++++--------
>   2 files changed, 28 insertions(+), 8 deletions(-)
> 
> diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
> index 20cd52b097..20cf54ef32 100644
> --- a/doc/guides/nics/overview.rst
> +++ b/doc/guides/nics/overview.rst
> @@ -32,3 +32,23 @@ More details about features can be found in :doc:`features`.
>   
>      Features marked with "P" are partially supported. Refer to the appropriate
>      NIC guide in the following sections for details.
> +
> +The ethdev layer support below compile options for debug purpose:
> +
> +- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
> +
> +  Compile with debug code on data path.
> +
> +- ``RTE_LIBRTE_ETHDEV_DEBUG_RX`` (default **disabled**)
> +
> +  Compile with debug code on Rx data path.
> +
> +- ``RTE_LIBRTE_ETHDEV_DEBUG_TX`` (default **disabled**)
> +
> +  Compile with debug code on Tx data path.
> +
> +.. Note::
> +
> +   The lib_ethdev use above options to wrap debug code to trace invalid parameters on
> +   data path APIs, so performance downgrade is expected when enable those options.
> +   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.

Hi Qi,

Overall patch looks good to me, but not sure about adding the documentation to 
the NIC overview page. What do you think about moving the doc to next chapter, 
under "3.1. Driver Compilation"?


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

* Re: [dpdk-dev] [PATCH v2 1/8] ether: refine debug compile option
  2021-03-16 13:05     ` Ferruh Yigit
@ 2021-03-16 13:39       ` Thomas Monjalon
  2021-03-16 14:12         ` Bruce Richardson
  2021-03-16 16:37         ` Ferruh Yigit
  0 siblings, 2 replies; 81+ messages in thread
From: Thomas Monjalon @ 2021-03-16 13:39 UTC (permalink / raw)
  To: Qi Zhang, Andrew Rybchenko, Ferruh Yigit
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, bruce.richardson

16/03/2021 14:05, Ferruh Yigit:
> On 3/12/2021 12:12 PM, Qi Zhang wrote:
> > PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option to wrap
> > data path debug code. As .config has been removed since the meson build,
> > It is not friendly for new DPDK users to notice those debug options.
> > 
> > The patch introduces below compile options for specific Rx/Tx data path
> > debug, so PMD can choose to reuse them to avoid maintain their own.
> > 
> > - RTE_LIBRTE_ETHDEV_DEBUG_RX
> > - RTE_LIBRTE_ETHDEV_DEBUG_TX
> > 
> > Also, all the compile options are documented on the overview page, so
> > users can easily find them.

English question: is "compile option" correct,
or should it be "compilation option"?
Cc Bruce to have a native in the discussion :)


> > --- a/doc/guides/nics/overview.rst
> > +++ b/doc/guides/nics/overview.rst
> > @@ -32,3 +32,23 @@ More details about features can be found in :doc:`features`.
> > +The ethdev layer support below compile options for debug purpose:

s/support/supports/

> > +
> > +- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
> > +
> > +  Compile with debug code on data path.

What is data path if not Rx or Tx?

> > +
> > +- ``RTE_LIBRTE_ETHDEV_DEBUG_RX`` (default **disabled**)
> > +
> > +  Compile with debug code on Rx data path.
> > +
> > +- ``RTE_LIBRTE_ETHDEV_DEBUG_TX`` (default **disabled**)
> > +
> > +  Compile with debug code on Tx data path.

In general, I think "LIBRTE_" is redundant and useless as macro prefix.

> > +
> > +.. Note::
> > +
> > +   The lib_ethdev use above options to wrap debug code to trace invalid parameters on

s/lib_ethdev/ethdev library/

> > +   data path APIs, so performance downgrade is expected when enable those options.

s/enable/enabling/

> > +   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.

Oh yes it could reduce the number of options.


> Overall patch looks good to me, but not sure about adding the documentation to 
> the NIC overview page. What do you think about moving the doc to next chapter, 
> under "3.1. Driver Compilation"?

+1




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

* Re: [dpdk-dev] [PATCH v2 1/8] ether: refine debug compile option
  2021-03-16 13:39       ` Thomas Monjalon
@ 2021-03-16 14:12         ` Bruce Richardson
  2021-03-16 23:29           ` Zhang, Qi Z
  2021-03-16 16:37         ` Ferruh Yigit
  1 sibling, 1 reply; 81+ messages in thread
From: Bruce Richardson @ 2021-03-16 14:12 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Qi Zhang, Andrew Rybchenko, Ferruh Yigit, dev, xiao.w.wang,
	jingjing.wu, beilei.xing, jia.guo, qiming.yang, haiyue.wang

On Tue, Mar 16, 2021 at 02:39:05PM +0100, Thomas Monjalon wrote:
> 16/03/2021 14:05, Ferruh Yigit:
> > On 3/12/2021 12:12 PM, Qi Zhang wrote:
> > > PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option to wrap
> > > data path debug code. As .config has been removed since the meson build,
> > > It is not friendly for new DPDK users to notice those debug options.
> > > 
> > > The patch introduces below compile options for specific Rx/Tx data path
> > > debug, so PMD can choose to reuse them to avoid maintain their own.
> > > 
> > > - RTE_LIBRTE_ETHDEV_DEBUG_RX
> > > - RTE_LIBRTE_ETHDEV_DEBUG_TX
> > > 
> > > Also, all the compile options are documented on the overview page, so
> > > users can easily find them.
> 
> English question: is "compile option" correct,
> or should it be "compilation option"?
> Cc Bruce to have a native in the discussion :)
> 

"compilation options" is better.
However, throughout this patch, I wonder if "build" might be a better verb to
use than "compile".


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

* Re: [dpdk-dev] [PATCH v2 1/8] ether: refine debug compile option
  2021-03-16 13:39       ` Thomas Monjalon
  2021-03-16 14:12         ` Bruce Richardson
@ 2021-03-16 16:37         ` Ferruh Yigit
  2021-03-22 17:24           ` Ferruh Yigit
  1 sibling, 1 reply; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-16 16:37 UTC (permalink / raw)
  To: Thomas Monjalon, Qi Zhang, Andrew Rybchenko
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, bruce.richardson

On 3/16/2021 1:39 PM, Thomas Monjalon wrote:
> 16/03/2021 14:05, Ferruh Yigit:
>> On 3/12/2021 12:12 PM, Qi Zhang wrote:
>>> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option to wrap
>>> data path debug code. As .config has been removed since the meson build,
>>> It is not friendly for new DPDK users to notice those debug options.
>>>
>>> The patch introduces below compile options for specific Rx/Tx data path
>>> debug, so PMD can choose to reuse them to avoid maintain their own.
>>>
>>> - RTE_LIBRTE_ETHDEV_DEBUG_RX
>>> - RTE_LIBRTE_ETHDEV_DEBUG_TX
>>>
>>> Also, all the compile options are documented on the overview page, so
>>> users can easily find them.

<...>

>>> +
>>> +- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
>>> +
>>> +  Compile with debug code on data path.
> 
> What is data path if not Rx or Tx?
> 
>>> +
>>> +- ``RTE_LIBRTE_ETHDEV_DEBUG_RX`` (default **disabled**)
>>> +
>>> +  Compile with debug code on Rx data path.
>>> +
>>> +- ``RTE_LIBRTE_ETHDEV_DEBUG_TX`` (default **disabled**)
>>> +
>>> +  Compile with debug code on Tx data path.
> 
> In general, I think "LIBRTE_" is redundant and useless as macro prefix.
> 


'RTE_LIBRTE_ETHDEV_DEBUG' already exits, it enables datapath debug without 
distinguishing Rx or Tx.

When we have _RX and _TX macro variants now, it may be possible to
1- get rid of 'RTE_LIBRTE_ETHDEV_DEBUG' macro and continue with fine grained RX & TX
2- Use 'RTE_LIBRTE_ETHDEV_DEBUG' as an alias to enable both RX & TX
3- Keep 'RTE_LIBRTE_ETHDEV_DEBUG' for ethdev layer datapath debug, and RX & TX 
variants for PMDs.

I think (3) can be more backward compatible, and can be helpful to separate 
ethdev layer and PMD debugging, but no so strong opinion.

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

* Re: [dpdk-dev] [PATCH v2 1/8] ether: refine debug compile option
  2021-03-16 14:12         ` Bruce Richardson
@ 2021-03-16 23:29           ` Zhang, Qi Z
  0 siblings, 0 replies; 81+ messages in thread
From: Zhang, Qi Z @ 2021-03-16 23:29 UTC (permalink / raw)
  To: Richardson, Bruce, Thomas Monjalon
  Cc: Andrew Rybchenko, Yigit, Ferruh, dev, Wang, Xiao W, Wu, Jingjing,
	Xing, Beilei, Guo, Jia, Yang, Qiming, Wang, Haiyue



> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson@intel.com>
> Sent: Tuesday, March 16, 2021 10:13 PM
> To: Thomas Monjalon <thomas@monjalon.net>
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Andrew Rybchenko
> <arybchenko@solarflare.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Guo, Jia
> <jia.guo@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>
> Subject: Re: [PATCH v2 1/8] ether: refine debug compile option
> 
> On Tue, Mar 16, 2021 at 02:39:05PM +0100, Thomas Monjalon wrote:
> > 16/03/2021 14:05, Ferruh Yigit:
> > > On 3/12/2021 12:12 PM, Qi Zhang wrote:
> > > > PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option
> to
> > > > wrap data path debug code. As .config has been removed since the
> > > > meson build, It is not friendly for new DPDK users to notice those debug
> options.
> > > >
> > > > The patch introduces below compile options for specific Rx/Tx data
> > > > path debug, so PMD can choose to reuse them to avoid maintain their
> own.
> > > >
> > > > - RTE_LIBRTE_ETHDEV_DEBUG_RX
> > > > - RTE_LIBRTE_ETHDEV_DEBUG_TX
> > > >
> > > > Also, all the compile options are documented on the overview page,
> > > > so users can easily find them.
> >
> > English question: is "compile option" correct, or should it be
> > "compilation option"?
> > Cc Bruce to have a native in the discussion :)
> >
> 
> "compilation options" is better.
> However, throughout this patch, I wonder if "build" might be a better verb to
> use than "compile".

OK, I will use "build" in v3, thanks!


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

* [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (9 preceding siblings ...)
  2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
@ 2021-03-17 11:15 ` Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 1/9] " Qi Zhang
                     ` (8 more replies)
  2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
                   ` (2 subsequent siblings)
  13 siblings, 9 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-17 11:15 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

Patch 1/9: introduces new compile options for data path debug in ether
layer, PMD can choose to reuse them to avoid maintain their own.

- RTE_ETHDEV_DEBUG
- RTE_ETHDEV_DEBUG_RX
- RTE_ETHDEV_DEBUG_TX

Patch 2/9: replace all RTE_LIBRTE_ETHDEV_DEBUG with RTE_ETHDEV_DEBUG
in all PMDs

Patch 3/9 - 9/9: refine the build option for Intel PMDs by using the
new build options

v3:
- rename "RTE_LIBRTE_ETHDEV_xxx" to "RTE_ETHDEV_xxx"
- move document from "overview.rst" page to "build_and_test.rst"
- fix grammar issues.

v2:
- fix some coding style issues.

Qi Zhang (9):
  ether: refine debug build option
  net: replace build option
  net/fm10k: refine debug build option
  net/e1000: refine debug build option
  net/i40e: refine debug build option
  net/iavf: refine debug build option
  net/ice: refine debug build option
  net/ixgbe: refine debug build option
  net/igc: refine debug build option

 doc/guides/nics/build_and_test.rst           | 20 ++++++
 drivers/net/ark/ark_logs.h                   |  2 +-
 drivers/net/atlantic/atl_rxtx.c              |  2 +-
 drivers/net/e1000/e1000_logs.c               | 17 ++----
 drivers/net/e1000/e1000_logs.h               | 13 +---
 drivers/net/e1000/em_rxtx.c                  | 38 ++++++------
 drivers/net/e1000/igb_rxtx.c                 |  2 +-
 drivers/net/ena/ena_ethdev.c                 |  2 +-
 drivers/net/enic/enic_rxtx.c                 |  2 +-
 drivers/net/fm10k/fm10k_ethdev.c             |  7 +--
 drivers/net/fm10k/fm10k_logs.h               | 13 +---
 drivers/net/fm10k/fm10k_rxtx.c               |  8 +--
 drivers/net/hinic/hinic_pmd_tx.c             |  2 +-
 drivers/net/hns3/hns3_rxtx.c                 |  4 +-
 drivers/net/i40e/i40e_ethdev.c               |  7 +--
 drivers/net/i40e/i40e_logs.h                 | 13 +---
 drivers/net/i40e/i40e_rxtx.c                 | 16 ++---
 drivers/net/iavf/iavf_ethdev.c               |  7 +--
 drivers/net/iavf/iavf_log.h                  | 13 +---
 drivers/net/iavf/iavf_rxtx.c                 |  8 +--
 drivers/net/ice/ice_ethdev.c                 |  7 +--
 drivers/net/ice/ice_logs.h                   | 13 +---
 drivers/net/ice/ice_rxtx.c                   | 20 +++---
 drivers/net/igc/igc_logs.h                   |  4 +-
 drivers/net/igc/igc_txrx.c                   |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c             |  7 +--
 drivers/net/ixgbe/ixgbe_logs.h               | 13 +---
 drivers/net/ixgbe/ixgbe_rxtx.c               | 64 ++++++++++----------
 drivers/net/qede/qede_rxtx.c                 |  4 +-
 drivers/net/softnic/rte_eth_softnic.c        |  2 +-
 drivers/net/softnic/rte_eth_softnic_thread.c |  2 +-
 drivers/net/txgbe/txgbe_rxtx.c               |  2 +-
 drivers/net/virtio/virtio_rxtx.c             |  2 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c           |  2 +-
 lib/librte_ethdev/rte_ethdev.h               | 16 ++---
 35 files changed, 149 insertions(+), 207 deletions(-)

-- 
2.26.2


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

* [dpdk-dev] [PATCH v3 1/9] ether: refine debug build option
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
@ 2021-03-17 11:15   ` Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 2/9] net: replace " Qi Zhang
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-17 11:15 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

The patch introduces below build options for data path debug, so PMD
can choose to reuse them to avoid maintain their own.

- RTE_ETHDEV_DEBUG
- RTE_ETHDEV_DEBUG_RX
- RTE_ETHDEV_DEBUG_TX

The original RTE_LIBRTE_ETHDEV_DEBUG has been replaced by RTE_ETHDEV_DEBUG
in the ethdev library as old name is a little bit redundant.

Also, all the build options are documented at programming guide
"3.1 Driver Option", so users can easily find them.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 doc/guides/nics/build_and_test.rst | 20 ++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h     | 16 ++++++++--------
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/doc/guides/nics/build_and_test.rst b/doc/guides/nics/build_and_test.rst
index e83dd4628c..4d7f10f6b0 100644
--- a/doc/guides/nics/build_and_test.rst
+++ b/doc/guides/nics/build_and_test.rst
@@ -26,6 +26,26 @@ This will also build testpmd.
 Detailed instructions are available
 in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
 
+The ethdev layer supports below compile options for debug purpose:
+
+- ``RTE_ETHDEV_DEBUG`` (default **disabled**)
+
+  Build with debug code on Rx and Tx path.
+
+- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
+
+  Build with debug code on Rx path.
+
+- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
+
+  Build with debug code on Tx path.
+
+.. Note::
+
+   The ethdev library use above options to wrap debug code to trace invalid parameters
+   on data path APIs, so performance downgrade is expected when enabling those options.
+   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.
+
 Running testpmd in Linux
 ------------------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 059a061072..a80f96a37d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -4877,7 +4877,7 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	uint16_t nb_rx;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_RX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
 
@@ -5011,11 +5011,11 @@ rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev;
 	void *rxq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_RX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_RX)
 	if (queue_id >= dev->data->nb_rx_queues)
 		return -ENODEV;
 #endif
@@ -5068,11 +5068,11 @@ static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
 	struct rte_eth_dev *dev;
 	void *txq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_TX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_TX)
 	if (queue_id >= dev->data->nb_tx_queues)
 		return -ENODEV;
 #endif
@@ -5154,7 +5154,7 @@ rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_TX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
 
@@ -5252,7 +5252,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_TX)
 	if (!rte_eth_dev_is_valid_port(port_id)) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX port_id=%u\n", port_id);
 		rte_errno = ENODEV;
@@ -5262,7 +5262,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 
 	dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_TX)
 	if (queue_id >= dev->data->nb_tx_queues) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
 		rte_errno = EINVAL;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v3 2/9] net: replace build option
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 1/9] " Qi Zhang
@ 2021-03-17 11:15   ` Qi Zhang
  2021-03-17 21:47     ` Ferruh Yigit
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 3/9] net/fm10k: refine debug " Qi Zhang
                     ` (6 subsequent siblings)
  8 siblings, 1 reply; 81+ messages in thread
From: Qi Zhang @ 2021-03-17 11:15 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

Replace RTE_LIBRTE_ETHDEV_DEBUG with RTE_ETHDEV_DEBUG.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ark/ark_logs.h                   | 2 +-
 drivers/net/atlantic/atl_rxtx.c              | 2 +-
 drivers/net/e1000/em_rxtx.c                  | 2 +-
 drivers/net/e1000/igb_rxtx.c                 | 2 +-
 drivers/net/ena/ena_ethdev.c                 | 2 +-
 drivers/net/enic/enic_rxtx.c                 | 2 +-
 drivers/net/fm10k/fm10k_rxtx.c               | 2 +-
 drivers/net/hinic/hinic_pmd_tx.c             | 2 +-
 drivers/net/hns3/hns3_rxtx.c                 | 4 ++--
 drivers/net/i40e/i40e_rxtx.c                 | 2 +-
 drivers/net/iavf/iavf_rxtx.c                 | 2 +-
 drivers/net/ice/ice_rxtx.c                   | 2 +-
 drivers/net/igc/igc_txrx.c                   | 2 +-
 drivers/net/ixgbe/ixgbe_rxtx.c               | 2 +-
 drivers/net/qede/qede_rxtx.c                 | 4 ++--
 drivers/net/softnic/rte_eth_softnic.c        | 2 +-
 drivers/net/softnic/rte_eth_softnic_thread.c | 2 +-
 drivers/net/txgbe/txgbe_rxtx.c               | 2 +-
 drivers/net/virtio/virtio_rxtx.c             | 2 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c           | 2 +-
 20 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ark/ark_logs.h b/drivers/net/ark/ark_logs.h
index ca46d86c99..1043e85b07 100644
--- a/drivers/net/ark/ark_logs.h
+++ b/drivers/net/ark/ark_logs.h
@@ -25,7 +25,7 @@ extern int ark_logtype;
 
 
 /* Debug macro to enable core debug code */
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 #define ARK_DEBUG_CORE 1
 #else
 #define ARK_DEBUG_CORE 0
diff --git a/drivers/net/atlantic/atl_rxtx.c b/drivers/net/atlantic/atl_rxtx.c
index 7d367c9306..2d75536d6f 100644
--- a/drivers/net/atlantic/atl_rxtx.c
+++ b/drivers/net/atlantic/atl_rxtx.c
@@ -821,7 +821,7 @@ atl_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index db5d1222ce..dc8cc3a22e 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -626,7 +626,7 @@ eth_em_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 1500d2ffff..4ab94dfeac 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -641,7 +641,7 @@ eth_igb_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 9aa51c9dcf..0086ff6828 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2313,7 +2313,7 @@ eth_ena_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index a2a02227e3..90c147ab4c 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -443,7 +443,7 @@ uint16_t enic_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			rte_errno = ENOTSUP;
 			return i;
 		}
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 8585c5b9e4..fbf07bc225 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -710,7 +710,7 @@ fm10k_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/hinic/hinic_pmd_tx.c b/drivers/net/hinic/hinic_pmd_tx.c
index 669f82389c..c8ab9831cd 100644
--- a/drivers/net/hinic/hinic_pmd_tx.c
+++ b/drivers/net/hinic/hinic_pmd_tx.c
@@ -974,7 +974,7 @@ static inline int hinic_tx_offload_pkt_prepare(struct rte_mbuf *m,
 	    !(ol_flags & PKT_TX_TUNNEL_VXLAN)))
 		return -ENOTSUP;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 	if (rte_validate_tx_offload(m) != 0)
 		return -EINVAL;
 #endif
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 00167c4bd5..be0ae045bf 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -3439,7 +3439,7 @@ hns3_check_tso_pkt_valid(struct rte_mbuf *m)
 	return 0;
 }
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 static inline int
 hns3_vld_vlan_chk(struct hns3_tx_queue *txq, struct rte_mbuf *m)
 {
@@ -3486,7 +3486,7 @@ hns3_prep_pkt_proc(struct hns3_tx_queue *tx_queue, struct rte_mbuf *m)
 {
 	int ret;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 	ret = rte_validate_tx_offload(m);
 	if (ret != 0) {
 		rte_errno = -ret;
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 61cb204be2..4c0f558195 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1525,7 +1525,7 @@ i40e_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 8fafe4579b..69d83dbbfc 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2335,7 +2335,7 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 530c206f4f..8785baa71a 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -3243,7 +3243,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index c0a5d5e84f..21a658861c 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -1434,7 +1434,7 @@ eth_igc_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 7d23bab290..78a66a554b 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -995,7 +995,7 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 87f52d7254..9fb8da3948 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -2154,7 +2154,7 @@ qede_xmit_prep_pkts(__rte_unused void *p_txq, struct rte_mbuf **tx_pkts,
 	uint64_t ol_flags;
 	struct rte_mbuf *m;
 	uint16_t i;
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 	int ret;
 #endif
 
@@ -2194,7 +2194,7 @@ qede_xmit_prep_pkts(__rte_unused void *p_txq, struct rte_mbuf **tx_pkts,
 			break;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 99d8468c94..6e6dad199c 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -700,7 +700,7 @@ rte_pmd_softnic_manage(uint16_t port_id)
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	struct pmd_internals *softnic;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 #endif
 
diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c
index a8c26a5b23..ec5e0feca5 100644
--- a/drivers/net/softnic/rte_eth_softnic_thread.c
+++ b/drivers/net/softnic/rte_eth_softnic_thread.c
@@ -3055,7 +3055,7 @@ rte_pmd_softnic_run(uint16_t port_id)
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 #endif
 
diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index a70bf0b9c6..3bac2a136d 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -1037,7 +1037,7 @@ txgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = ret;
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 40283001b0..77183e6968 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -1691,7 +1691,7 @@ virtio_xmit_pkts_prepare(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts,
 	for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
 		struct rte_mbuf *m = tx_pkts[nb_tx];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		error = rte_validate_tx_offload(m);
 		if (unlikely(error)) {
 			rte_errno = -error;
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 5cf53d4de8..c2af0d877c 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -373,7 +373,7 @@ vmxnet3_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v3 3/9] net/fm10k: refine debug build option
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 1/9] " Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 2/9] net: replace " Qi Zhang
@ 2021-03-17 11:15   ` Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 4/9] net/e1000: " Qi Zhang
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-17 11:15 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_FM10K_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_FM10K_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_FM10K_DEBUG_TX_FREE and RTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c |  7 ++-----
 drivers/net/fm10k/fm10k_logs.h   | 13 ++-----------
 drivers/net/fm10k/fm10k_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index fd471c415e..0a557acbef 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3287,12 +3287,9 @@ RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_LOG_REGISTER(fm10k_logtype_init, pmd.net.fm10k.init, NOTICE);
 RTE_LOG_REGISTER(fm10k_logtype_driver, pmd.net.fm10k.driver, NOTICE);
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(fm10k_logtype_rx, pmd.net.fm10k.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(fm10k_logtype_tx, pmd.net.fm10k.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-RTE_LOG_REGISTER(fm10k_logtype_tx_free, pmd.net.fm10k.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h
index 9ae743d806..4f039f8beb 100644
--- a/drivers/net/fm10k/fm10k_logs.h
+++ b/drivers/net/fm10k/fm10k_logs.h
@@ -14,7 +14,7 @@ extern int fm10k_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-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
-
 extern int fm10k_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index fbf07bc225..0a9a27aa5a 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -16,7 +16,7 @@
 #define rte_packet_prefetch(p)  do {} while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 static inline void dump_rxd(union fm10k_rx_desc *rxd)
 {
 	PMD_RX_LOG(DEBUG, "+----------------|----------------+");
@@ -115,7 +115,7 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 		rte_pktmbuf_pkt_len(mbuf) = desc.w.length;
@@ -229,7 +229,7 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 
@@ -710,7 +710,7 @@ fm10k_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v3 4/9] net/e1000: refine debug build option
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
                     ` (2 preceding siblings ...)
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 3/9] net/fm10k: refine debug " Qi Zhang
@ 2021-03-17 11:15   ` Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 5/9] net/i40e: " Qi Zhang
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-17 11:15 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_E1000_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_E1000_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_E1000_DEBUG_TX_FREE and RTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/e1000/e1000_logs.c | 17 ++++-----------
 drivers/net/e1000/e1000_logs.h | 13 ++----------
 drivers/net/e1000/em_rxtx.c    | 38 +++++++++++++++++-----------------
 drivers/net/e1000/igb_rxtx.c   |  2 +-
 4 files changed, 26 insertions(+), 44 deletions(-)

diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 231f5c03ef..84ea0f9d4b 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -8,15 +8,12 @@
 int e1000_logtype_init;
 int e1000_logtype_driver;
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 int e1000_logtype_rx;
 #endif
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_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;
@@ -34,23 +31,17 @@ e1000_igb_init_log(void)
 	if (e1000_logtype_driver >= 0)
 		rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
 	if (e1000_logtype_rx >= 0)
 		rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 	e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
 	if (e1000_logtype_tx >= 0)
 		rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-	e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
-	if (e1000_logtype_tx_free >= 0)
-		rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
-#endif
-
 	e1000_log_initialized = 1;
 }
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 2612134f38..86f546b0f9 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -15,7 +15,7 @@ extern int e1000_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_rx,	\
@@ -24,7 +24,7 @@ extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_tx,	\
@@ -33,15 +33,6 @@ extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-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)
-#endif
-
 extern int e1000_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, e1000_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index dc8cc3a22e..dfd8f2fd00 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -311,10 +311,10 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (! (txr[desc_to_clean_to].upper.fields.status & E1000_TXD_STAT_DD))
 	{
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -327,11 +327,11 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)", nb_tx_to_clean,
-			last_desc_cleaned, desc_to_clean_to, txq->port_id,
-			txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)", nb_tx_to_clean,
+		   last_desc_cleaned, desc_to_clean_to, txq->port_id,
+		   txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -457,11 +457,11 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		while (unlikely (nb_used > txq->nb_tx_free)) {
-			PMD_TX_FREE_LOG(DEBUG, "Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG, "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (em_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -579,10 +579,10 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id=%4u "
-					"(port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id=%4u "
+				   "(port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= E1000_TXD_CMD_RS;
 
@@ -626,7 +626,7 @@ eth_em_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 4ab94dfeac..45da4ed9d2 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -641,7 +641,7 @@ eth_igb_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v3 5/9] net/i40e: refine debug build option
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
                     ` (3 preceding siblings ...)
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 4/9] net/e1000: " Qi Zhang
@ 2021-03-17 11:15   ` Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 6/9] net/iavf: " Qi Zhang
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-17 11:15 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_I40E_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_I40E_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_I40E_DEBUG_TX_FREE and RTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  7 ++-----
 drivers/net/i40e/i40e_logs.h   | 13 ++-----------
 drivers/net/i40e/i40e_rxtx.c   | 16 ++++++++--------
 3 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index d7cd049891..e529ca0998 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12373,15 +12373,12 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
 
 RTE_LOG_REGISTER(i40e_logtype_init, pmd.net.i40e.init, NOTICE);
 RTE_LOG_REGISTER(i40e_logtype_driver, pmd.net.i40e.driver, NOTICE);
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(i40e_logtype_rx, pmd.net.i40e.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(i40e_logtype_tx, pmd.net.i40e.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-RTE_LOG_REGISTER(i40e_logtype_tx_free, pmd.net.i40e.tx_free, DEBUG);
-#endif
 
 RTE_PMD_REGISTER_PARAM_STRING(net_i40e,
 			      ETH_I40E_FLOATING_VEB_ARG "=1"
diff --git a/drivers/net/i40e/i40e_logs.h b/drivers/net/i40e/i40e_logs.h
index dac3267eb4..eebe6c5559 100644
--- a/drivers/net/i40e/i40e_logs.h
+++ b/drivers/net/i40e/i40e_logs.h
@@ -11,7 +11,7 @@ extern int i40e_logtype_init;
 		__func__, ##args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_rx,	\
@@ -20,7 +20,7 @@ extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_tx,	\
@@ -29,15 +29,6 @@ extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-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)
-#endif
-
 extern int i40e_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, i40e_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 4c0f558195..3c7686c3f4 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -372,9 +372,9 @@ i40e_xmit_cleanup(struct i40e_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-			"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -1253,10 +1253,10 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_used);
 
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= I40E_TX_DESC_CMD_RS;
 
@@ -1525,7 +1525,7 @@ i40e_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v3 6/9] net/iavf: refine debug build option
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
                     ` (4 preceding siblings ...)
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 5/9] net/i40e: " Qi Zhang
@ 2021-03-17 11:15   ` Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 7/9] net/ice: " Qi Zhang
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-17 11:15 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IAVF_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IAVF_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IAVF_DEBUG_TX_FREE and RTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c |  7 ++-----
 drivers/net/iavf/iavf_log.h    | 13 ++-----------
 drivers/net/iavf/iavf_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 4d37722022..86bc5fcf3f 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -2360,12 +2360,9 @@ RTE_PMD_REGISTER_KMOD_DEP(net_iavf, "* igb_uio | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(net_iavf, "cap=dcf");
 RTE_LOG_REGISTER(iavf_logtype_init, pmd.net.iavf.init, NOTICE);
 RTE_LOG_REGISTER(iavf_logtype_driver, pmd.net.iavf.driver, NOTICE);
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(iavf_logtype_rx, pmd.net.iavf.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(iavf_logtype_tx, pmd.net.iavf.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-RTE_LOG_REGISTER(iavf_logtype_tx_free, pmd.net.iavf.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/iavf/iavf_log.h b/drivers/net/iavf/iavf_log.h
index 1088ec75f5..ff66ab0ccf 100644
--- a/drivers/net/iavf/iavf_log.h
+++ b/drivers/net/iavf/iavf_log.h
@@ -21,7 +21,7 @@ extern int iavf_logtype_driver;
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>")
 
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_rx,	\
@@ -30,7 +30,7 @@ extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_tx,	\
@@ -39,13 +39,4 @@ extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-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
-
 #endif /* _IAVF_LOG_H_ */
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 69d83dbbfc..84df0989af 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -1979,9 +1979,9 @@ iavf_xmit_cleanup(struct iavf_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(IAVF_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(IAVF_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -2335,7 +2335,7 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v3 7/9] net/ice: refine debug build option
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
                     ` (5 preceding siblings ...)
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 6/9] net/iavf: " Qi Zhang
@ 2021-03-17 11:15   ` Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 8/9] net/ixgbe: " Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 9/9] net/igc: " Qi Zhang
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-17 11:15 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_ICE_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_ICE_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ICE_DEBUG_TX_FREE and RTE_ETHDEV_DEBUG
   into RTE_LIBRTE_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.c |  7 ++-----
 drivers/net/ice/ice_logs.h   | 13 ++-----------
 drivers/net/ice/ice_rxtx.c   | 20 ++++++++++----------
 3 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 8999d441ac..d370b72d80 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -5366,12 +5366,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ice,
 
 RTE_LOG_REGISTER(ice_logtype_init, pmd.net.ice.init, NOTICE);
 RTE_LOG_REGISTER(ice_logtype_driver, pmd.net.ice.driver, NOTICE);
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ice_logtype_rx, pmd.net.ice.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ice_logtype_tx, pmd.net.ice.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ice_logtype_tx_free, pmd.net.ice.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ice/ice_logs.h b/drivers/net/ice/ice_logs.h
index aab7da5f7b..e79980fb63 100644
--- a/drivers/net/ice/ice_logs.h
+++ b/drivers/net/ice/ice_logs.h
@@ -14,7 +14,7 @@ extern int ice_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-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
-
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ice_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 8785baa71a..0827db9c9e 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2436,11 +2436,11 @@ ice_xmit_cleanup(struct ice_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (!(txd[desc_to_clean_to].cmd_type_offset_bsz &
 	    rte_cpu_to_le_64(ICE_TX_DESC_DTYPE_DESC_DONE))) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d) value=0x%"PRIx64"\n",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id,
-				txd[desc_to_clean_to].cmd_type_offset_bsz);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d) value=0x%"PRIx64"\n",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id,
+			   txd[desc_to_clean_to].cmd_type_offset_bsz);
 		/* Failed to clean any descriptors */
 		return -1;
 	}
@@ -2731,10 +2731,10 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		/* set RS bit on the last descriptor of one packet */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= ICE_TX_DESC_CMD_RS;
 
@@ -3243,7 +3243,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v3 8/9] net/ixgbe: refine debug build option
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
                     ` (6 preceding siblings ...)
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 7/9] net/ice: " Qi Zhang
@ 2021-03-17 11:15   ` Qi Zhang
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 9/9] net/igc: " Qi Zhang
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-17 11:15 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IXGBE_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IXGBE_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IXGBE_DEBUG_TX_FREE and RTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h   | 13 +------
 drivers/net/ixgbe/ixgbe_rxtx.c   | 64 ++++++++++++++++----------------
 3 files changed, 36 insertions(+), 48 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 761a0f26bb..4e948a260f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -8455,12 +8455,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf,
 RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.init, NOTICE);
 RTE_LOG_REGISTER(ixgbe_logtype_driver, pmd.net.ixgbe.driver, NOTICE);
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ixgbe_logtype_rx, pmd.net.ixgbe.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ixgbe_logtype_tx, pmd.net.ixgbe.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ixgbe_logtype_tx_free, pmd.net.ixgbe.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ixgbe/ixgbe_logs.h b/drivers/net/ixgbe/ixgbe_logs.h
index 2a279d1098..00ef797ca1 100644
--- a/drivers/net/ixgbe/ixgbe_logs.h
+++ b/drivers/net/ixgbe/ixgbe_logs.h
@@ -12,7 +12,7 @@ extern int ixgbe_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx,	\
@@ -21,7 +21,7 @@ extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx,	\
@@ -30,15 +30,6 @@ extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-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)
-#endif
-
 extern int ixgbe_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 78a66a554b..d69f36e977 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -583,11 +583,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	status = txr[desc_to_clean_to].wb.status;
 	if (!(status & rte_cpu_to_le_32(IXGBE_TXD_STAT_DD))) {
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -600,11 +600,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)",
-			nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
-			txq->port_id, txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)",
+		   nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
+		   txq->port_id, txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -750,12 +750,12 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		if (nb_used > txq->nb_tx_free) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (ixgbe_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -766,17 +766,17 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 			/* nb_used better be <= txq->tx_rs_thresh */
 			if (unlikely(nb_used > txq->tx_rs_thresh)) {
-				PMD_TX_FREE_LOG(DEBUG,
-					"The number of descriptors needed to "
-					"transmit the packet exceeds the "
-					"RS bit threshold. This will impact "
-					"performance."
-					"nb_used=%4u nb_free=%4u "
-					"tx_rs_thresh=%4u. "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->tx_rs_thresh,
-					txq->port_id, txq->queue_id);
+				PMD_TX_LOG(DEBUG,
+					   "The number of descriptors needed to "
+					   "transmit the packet exceeds the "
+					   "RS bit threshold. This will impact "
+					   "performance."
+					   "nb_used=%4u nb_free=%4u "
+					   "tx_rs_thresh=%4u. "
+					   "(port=%d queue=%d)",
+					   nb_used, txq->nb_tx_free,
+					   txq->tx_rs_thresh,
+					   txq->port_id, txq->queue_id);
 				/*
 				 * Loop here until there are enough TX
 				 * descriptors or until the ring cannot be
@@ -920,10 +920,10 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= IXGBE_TXD_CMD_RS;
 
@@ -995,7 +995,7 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			return i;
 		}
 
-#ifdef RTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v3 9/9] net/igc: refine debug build option
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
                     ` (7 preceding siblings ...)
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 8/9] net/ixgbe: " Qi Zhang
@ 2021-03-17 11:15   ` Qi Zhang
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-17 11:15 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 6457c4d180..11071a32b5 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -20,14 +20,14 @@ extern int igc_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index 21a658861c..f092709c02 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -1434,7 +1434,7 @@ eth_igc_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* Re: [dpdk-dev] [PATCH v3 2/9] net: replace build option
  2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 2/9] net: replace " Qi Zhang
@ 2021-03-17 21:47     ` Ferruh Yigit
  2021-03-17 22:00       ` Thomas Monjalon
  0 siblings, 1 reply; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-17 21:47 UTC (permalink / raw)
  To: Qi Zhang, Thomas Monjalon, Andrew Rybchenko
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang

On 3/17/2021 11:15 AM, Qi Zhang wrote:
> Replace RTE_LIBRTE_ETHDEV_DEBUG with RTE_ETHDEV_DEBUG.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

Hi Qi, Thomas,

I see Thomas mentioned 'LIBRTE_' is redundant but not sure about renaming the 
existing compile time flag without notice.

The flag is to be used for users, it is not internal, and it may be already used 
in some scripts and automation etc, this rename can break them.

'LIBRTE_' is already used commonly, I think all library flags has it, do we 
really need to drop it from this current one? Even if we drop it, what about 
keeping it as alias for backward compatibility?

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

* Re: [dpdk-dev] [PATCH v3 2/9] net: replace build option
  2021-03-17 21:47     ` Ferruh Yigit
@ 2021-03-17 22:00       ` Thomas Monjalon
  2021-03-18  0:58         ` Zhang, Qi Z
  0 siblings, 1 reply; 81+ messages in thread
From: Thomas Monjalon @ 2021-03-17 22:00 UTC (permalink / raw)
  To: Qi Zhang, Andrew Rybchenko, Ferruh Yigit
  Cc: dev, bruce.richardson, xiao.w.wang, jingjing.wu, beilei.xing,
	jia.guo, qiming.yang, haiyue.wang

17/03/2021 22:47, Ferruh Yigit:
> On 3/17/2021 11:15 AM, Qi Zhang wrote:
> > Replace RTE_LIBRTE_ETHDEV_DEBUG with RTE_ETHDEV_DEBUG.
> > 
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> Hi Qi, Thomas,
> 
> I see Thomas mentioned 'LIBRTE_' is redundant but not sure about renaming the 
> existing compile time flag without notice.
> 
> The flag is to be used for users, it is not internal, and it may be already used 
> in some scripts and automation etc, this rename can break them.
> 
> 'LIBRTE_' is already used commonly, I think all library flags has it, do we 
> really need to drop it from this current one? Even if we drop it, what about 
> keeping it as alias for backward compatibility?

Yes I did not ask for removing now :)
Let's keep old name as alias and start using the new name
(if you agree with the new name without LIBRTE_).



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

* Re: [dpdk-dev] [PATCH v3 2/9] net: replace build option
  2021-03-17 22:00       ` Thomas Monjalon
@ 2021-03-18  0:58         ` Zhang, Qi Z
  0 siblings, 0 replies; 81+ messages in thread
From: Zhang, Qi Z @ 2021-03-18  0:58 UTC (permalink / raw)
  To: Thomas Monjalon, Andrew Rybchenko, Yigit, Ferruh
  Cc: dev, Richardson, Bruce, Wang, Xiao W, Wu, Jingjing, Xing, Beilei,
	Guo, Jia, Yang, Qiming, Wang, Haiyue



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Thursday, March 18, 2021 6:01 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Andrew Rybchenko
> <arybchenko@solarflare.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>; Wang,
> Xiao W <xiao.w.wang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Xing,
> Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>
> Subject: Re: [PATCH v3 2/9] net: replace build option
> 
> 17/03/2021 22:47, Ferruh Yigit:
> > On 3/17/2021 11:15 AM, Qi Zhang wrote:
> > > Replace RTE_LIBRTE_ETHDEV_DEBUG with RTE_ETHDEV_DEBUG.
> > >
> > > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> >
> > Hi Qi, Thomas,
> >
> > I see Thomas mentioned 'LIBRTE_' is redundant but not sure about
> > renaming the existing compile time flag without notice.
> >
> > The flag is to be used for users, it is not internal, and it may be
> > already used in some scripts and automation etc, this rename can break
> them.
> >
> > 'LIBRTE_' is already used commonly, I think all library flags has it,
> > do we really need to drop it from this current one? Even if we drop
> > it, what about keeping it as alias for backward compatibility?
> 
> Yes I did not ask for removing now :)
> Let's keep old name as alias and start using the new name (if you agree with
> the new name without LIBRTE_).

OK, adding an alias makes sense to me

Thanks
Qi


> 


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

* [dpdk-dev] [PATCH v4 0/8] ether: refine debug build option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (10 preceding siblings ...)
  2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
@ 2021-03-18  1:42 ` Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 1/8] " Qi Zhang
                     ` (7 more replies)
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
  13 siblings, 8 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-18  1:42 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

Patch 1/8: introduces new compile options for data path debug in ether
layer, PMD can choose to reuse them to avoid maintain their own.

- RTE_ETHDEV_DEBUG
- RTE_ETHDEV_DEBUG_RX
- RTE_ETHDEV_DEBUG_TX

The undocumented RTE_LIBRTE_ETHDEV_DEBUG will a alias to
RTE_ETHDEV_DEBUG for backward compatibility.

Patch 2/8 - 8/8: refine the build option for Intel PMDs by using the
new build options

v4:
- Alias RTE_LIBRTE_ETHDEV_DEBUG to RTE_ETHDEV_DEBUG in ethdev library
  for backward compatibility.
- Not replace RTE_LIBRTE_ETHDEV_DEBUG in all PMDs.

v3:
- rename "RTE_LIBRTE_ETHDEV_xxx" to "RTE_ETHDEV_xxx"
- move document from "overview.rst" page to "build_and_test.rst"
- fix grammar issues.

v2:
- fix some coding style issues.

Qi Zhang (8):
  ether: refine debug build option
  net/fm10k: refine debug build option
  net/e1000: refine debug build option
  net/i40e: refine debug build option
  net/iavf: refine debug build option
  net/ice: refine debug build option
  net/ixgbe: refine debug build option
  net/igc: refine debug build option

 doc/guides/nics/build_and_test.rst | 20 ++++++++++
 drivers/net/e1000/e1000_logs.c     | 17 ++------
 drivers/net/e1000/e1000_logs.h     | 13 +-----
 drivers/net/e1000/em_rxtx.c        | 38 +++++++++---------
 drivers/net/e1000/igb_rxtx.c       |  2 +-
 drivers/net/fm10k/fm10k_ethdev.c   |  7 +---
 drivers/net/fm10k/fm10k_logs.h     | 13 +-----
 drivers/net/fm10k/fm10k_rxtx.c     |  8 ++--
 drivers/net/i40e/i40e_ethdev.c     |  7 +---
 drivers/net/i40e/i40e_logs.h       | 13 +-----
 drivers/net/i40e/i40e_rxtx.c       | 16 ++++----
 drivers/net/iavf/iavf_ethdev.c     |  7 +---
 drivers/net/iavf/iavf_log.h        | 13 +-----
 drivers/net/iavf/iavf_rxtx.c       |  8 ++--
 drivers/net/ice/ice_ethdev.c       |  7 +---
 drivers/net/ice/ice_logs.h         | 13 +-----
 drivers/net/ice/ice_rxtx.c         | 20 +++++-----
 drivers/net/igc/igc_logs.h         |  4 +-
 drivers/net/igc/igc_txrx.c         |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c   |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h     | 13 +-----
 drivers/net/ixgbe/ixgbe_rxtx.c     | 64 +++++++++++++++---------------
 lib/librte_ethdev/rte_ethdev.h     | 21 ++++++----
 23 files changed, 140 insertions(+), 193 deletions(-)

-- 
2.26.2


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

* [dpdk-dev] [PATCH v4 1/8] ether: refine debug build option
  2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
@ 2021-03-18  1:42   ` Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 2/8] net/fm10k: " Qi Zhang
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-18  1:42 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

The patch introduces below build options for data path debug, so PMD
can choose to reuse them to avoid maintain their own.

- RTE_ETHDEV_DEBUG
- RTE_ETHDEV_DEBUG_RX
- RTE_ETHDEV_DEBUG_TX

All the build options are documented at programming guide
"3.1 Driver Option", so users can easily find them.

The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
RTE_ETHDEV_DEBUG for backward compatibility.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 doc/guides/nics/build_and_test.rst | 20 ++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h     | 21 +++++++++++++--------
 2 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/doc/guides/nics/build_and_test.rst b/doc/guides/nics/build_and_test.rst
index e83dd4628c..4d7f10f6b0 100644
--- a/doc/guides/nics/build_and_test.rst
+++ b/doc/guides/nics/build_and_test.rst
@@ -26,6 +26,26 @@ This will also build testpmd.
 Detailed instructions are available
 in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
 
+The ethdev layer supports below compile options for debug purpose:
+
+- ``RTE_ETHDEV_DEBUG`` (default **disabled**)
+
+  Build with debug code on Rx and Tx path.
+
+- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
+
+  Build with debug code on Rx path.
+
+- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
+
+  Build with debug code on Tx path.
+
+.. Note::
+
+   The ethdev library use above options to wrap debug code to trace invalid parameters
+   on data path APIs, so performance downgrade is expected when enabling those options.
+   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.
+
 Running testpmd in Linux
 ------------------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 059a061072..7a65d99ff4 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -148,6 +148,11 @@ extern "C" {
 /* Use this macro to check if LRO API is supported */
 #define RTE_ETHDEV_HAS_LRO_SUPPORT
 
+/* Alias RTE_LIBRTE_ETHDEV_DEBUG to RTE_ETHDEV_DEBUG for backward compatibility. */
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#define RTE_ETHDEV_DEBUG
+#endif
+
 #include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_interrupts.h>
@@ -4877,7 +4882,7 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	uint16_t nb_rx;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_RX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
 
@@ -5011,11 +5016,11 @@ rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev;
 	void *rxq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_RX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_RX)
 	if (queue_id >= dev->data->nb_rx_queues)
 		return -ENODEV;
 #endif
@@ -5068,11 +5073,11 @@ static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
 	struct rte_eth_dev *dev;
 	void *txq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_TX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_TX)
 	if (queue_id >= dev->data->nb_tx_queues)
 		return -ENODEV;
 #endif
@@ -5154,7 +5159,7 @@ rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_TX)
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
 
@@ -5252,7 +5257,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_TX)
 	if (!rte_eth_dev_is_valid_port(port_id)) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX port_id=%u\n", port_id);
 		rte_errno = ENODEV;
@@ -5262,7 +5267,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 
 	dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#if defined(RTE_ETHDEV_DEBUG) || defined(RTE_ETHDEV_DEBUG_TX)
 	if (queue_id >= dev->data->nb_tx_queues) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
 		rte_errno = EINVAL;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v4 2/8] net/fm10k: refine debug build option
  2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 1/8] " Qi Zhang
@ 2021-03-18  1:42   ` Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 3/8] net/e1000: " Qi Zhang
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-18  1:42 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_FM10K_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_FM10K_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_FM10K_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c |  7 ++-----
 drivers/net/fm10k/fm10k_logs.h   | 13 ++-----------
 drivers/net/fm10k/fm10k_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index fd471c415e..0a557acbef 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3287,12 +3287,9 @@ RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_LOG_REGISTER(fm10k_logtype_init, pmd.net.fm10k.init, NOTICE);
 RTE_LOG_REGISTER(fm10k_logtype_driver, pmd.net.fm10k.driver, NOTICE);
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(fm10k_logtype_rx, pmd.net.fm10k.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(fm10k_logtype_tx, pmd.net.fm10k.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-RTE_LOG_REGISTER(fm10k_logtype_tx_free, pmd.net.fm10k.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h
index 9ae743d806..4f039f8beb 100644
--- a/drivers/net/fm10k/fm10k_logs.h
+++ b/drivers/net/fm10k/fm10k_logs.h
@@ -14,7 +14,7 @@ extern int fm10k_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-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
-
 extern int fm10k_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 8585c5b9e4..0a9a27aa5a 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -16,7 +16,7 @@
 #define rte_packet_prefetch(p)  do {} while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 static inline void dump_rxd(union fm10k_rx_desc *rxd)
 {
 	PMD_RX_LOG(DEBUG, "+----------------|----------------+");
@@ -115,7 +115,7 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 		rte_pktmbuf_pkt_len(mbuf) = desc.w.length;
@@ -229,7 +229,7 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 
@@ -710,7 +710,7 @@ fm10k_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v4 3/8] net/e1000: refine debug build option
  2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 1/8] " Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 2/8] net/fm10k: " Qi Zhang
@ 2021-03-18  1:42   ` Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 4/8] net/i40e: " Qi Zhang
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-18  1:42 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_E1000_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_E1000_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_E1000_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/e1000/e1000_logs.c | 17 ++++-----------
 drivers/net/e1000/e1000_logs.h | 13 ++----------
 drivers/net/e1000/em_rxtx.c    | 38 +++++++++++++++++-----------------
 drivers/net/e1000/igb_rxtx.c   |  2 +-
 4 files changed, 26 insertions(+), 44 deletions(-)

diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 231f5c03ef..84ea0f9d4b 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -8,15 +8,12 @@
 int e1000_logtype_init;
 int e1000_logtype_driver;
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 int e1000_logtype_rx;
 #endif
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_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;
@@ -34,23 +31,17 @@ e1000_igb_init_log(void)
 	if (e1000_logtype_driver >= 0)
 		rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
 	if (e1000_logtype_rx >= 0)
 		rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 	e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
 	if (e1000_logtype_tx >= 0)
 		rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-	e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
-	if (e1000_logtype_tx_free >= 0)
-		rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
-#endif
-
 	e1000_log_initialized = 1;
 }
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 2612134f38..86f546b0f9 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -15,7 +15,7 @@ extern int e1000_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_rx,	\
@@ -24,7 +24,7 @@ extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_tx,	\
@@ -33,15 +33,6 @@ extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-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)
-#endif
-
 extern int e1000_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, e1000_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index db5d1222ce..dfd8f2fd00 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -311,10 +311,10 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (! (txr[desc_to_clean_to].upper.fields.status & E1000_TXD_STAT_DD))
 	{
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -327,11 +327,11 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)", nb_tx_to_clean,
-			last_desc_cleaned, desc_to_clean_to, txq->port_id,
-			txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)", nb_tx_to_clean,
+		   last_desc_cleaned, desc_to_clean_to, txq->port_id,
+		   txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -457,11 +457,11 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		while (unlikely (nb_used > txq->nb_tx_free)) {
-			PMD_TX_FREE_LOG(DEBUG, "Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG, "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (em_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -579,10 +579,10 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id=%4u "
-					"(port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id=%4u "
+				   "(port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= E1000_TXD_CMD_RS;
 
@@ -626,7 +626,7 @@ eth_em_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 1500d2ffff..45da4ed9d2 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -641,7 +641,7 @@ eth_igb_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v4 4/8] net/i40e: refine debug build option
  2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
                     ` (2 preceding siblings ...)
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 3/8] net/e1000: " Qi Zhang
@ 2021-03-18  1:42   ` Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 5/8] net/iavf: " Qi Zhang
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-18  1:42 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_I40E_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_I40E_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_I40E_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  7 ++-----
 drivers/net/i40e/i40e_logs.h   | 13 ++-----------
 drivers/net/i40e/i40e_rxtx.c   | 16 ++++++++--------
 3 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index d7cd049891..e529ca0998 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12373,15 +12373,12 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
 
 RTE_LOG_REGISTER(i40e_logtype_init, pmd.net.i40e.init, NOTICE);
 RTE_LOG_REGISTER(i40e_logtype_driver, pmd.net.i40e.driver, NOTICE);
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(i40e_logtype_rx, pmd.net.i40e.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(i40e_logtype_tx, pmd.net.i40e.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-RTE_LOG_REGISTER(i40e_logtype_tx_free, pmd.net.i40e.tx_free, DEBUG);
-#endif
 
 RTE_PMD_REGISTER_PARAM_STRING(net_i40e,
 			      ETH_I40E_FLOATING_VEB_ARG "=1"
diff --git a/drivers/net/i40e/i40e_logs.h b/drivers/net/i40e/i40e_logs.h
index dac3267eb4..eebe6c5559 100644
--- a/drivers/net/i40e/i40e_logs.h
+++ b/drivers/net/i40e/i40e_logs.h
@@ -11,7 +11,7 @@ extern int i40e_logtype_init;
 		__func__, ##args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_rx,	\
@@ -20,7 +20,7 @@ extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_tx,	\
@@ -29,15 +29,6 @@ extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-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)
-#endif
-
 extern int i40e_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, i40e_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 61cb204be2..3c7686c3f4 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -372,9 +372,9 @@ i40e_xmit_cleanup(struct i40e_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-			"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -1253,10 +1253,10 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_used);
 
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= I40E_TX_DESC_CMD_RS;
 
@@ -1525,7 +1525,7 @@ i40e_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v4 5/8] net/iavf: refine debug build option
  2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
                     ` (3 preceding siblings ...)
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 4/8] net/i40e: " Qi Zhang
@ 2021-03-18  1:42   ` Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 6/8] net/ice: " Qi Zhang
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-18  1:42 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IAVF_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IAVF_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IAVF_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c |  7 ++-----
 drivers/net/iavf/iavf_log.h    | 13 ++-----------
 drivers/net/iavf/iavf_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 4d37722022..86bc5fcf3f 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -2360,12 +2360,9 @@ RTE_PMD_REGISTER_KMOD_DEP(net_iavf, "* igb_uio | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(net_iavf, "cap=dcf");
 RTE_LOG_REGISTER(iavf_logtype_init, pmd.net.iavf.init, NOTICE);
 RTE_LOG_REGISTER(iavf_logtype_driver, pmd.net.iavf.driver, NOTICE);
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(iavf_logtype_rx, pmd.net.iavf.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(iavf_logtype_tx, pmd.net.iavf.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-RTE_LOG_REGISTER(iavf_logtype_tx_free, pmd.net.iavf.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/iavf/iavf_log.h b/drivers/net/iavf/iavf_log.h
index 1088ec75f5..ff66ab0ccf 100644
--- a/drivers/net/iavf/iavf_log.h
+++ b/drivers/net/iavf/iavf_log.h
@@ -21,7 +21,7 @@ extern int iavf_logtype_driver;
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>")
 
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_rx,	\
@@ -30,7 +30,7 @@ extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_tx,	\
@@ -39,13 +39,4 @@ extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-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
-
 #endif /* _IAVF_LOG_H_ */
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 8fafe4579b..84df0989af 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -1979,9 +1979,9 @@ iavf_xmit_cleanup(struct iavf_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(IAVF_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(IAVF_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -2335,7 +2335,7 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v4 6/8] net/ice: refine debug build option
  2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
                     ` (4 preceding siblings ...)
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 5/8] net/iavf: " Qi Zhang
@ 2021-03-18  1:42   ` Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 7/8] net/ixgbe: " Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 8/8] net/igc: " Qi Zhang
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-18  1:42 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_ICE_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_ICE_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ICE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.c |  7 ++-----
 drivers/net/ice/ice_logs.h   | 13 ++-----------
 drivers/net/ice/ice_rxtx.c   | 20 ++++++++++----------
 3 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 8999d441ac..d370b72d80 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -5366,12 +5366,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ice,
 
 RTE_LOG_REGISTER(ice_logtype_init, pmd.net.ice.init, NOTICE);
 RTE_LOG_REGISTER(ice_logtype_driver, pmd.net.ice.driver, NOTICE);
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ice_logtype_rx, pmd.net.ice.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ice_logtype_tx, pmd.net.ice.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ice_logtype_tx_free, pmd.net.ice.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ice/ice_logs.h b/drivers/net/ice/ice_logs.h
index aab7da5f7b..e79980fb63 100644
--- a/drivers/net/ice/ice_logs.h
+++ b/drivers/net/ice/ice_logs.h
@@ -14,7 +14,7 @@ extern int ice_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-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
-
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ice_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 530c206f4f..0827db9c9e 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2436,11 +2436,11 @@ ice_xmit_cleanup(struct ice_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (!(txd[desc_to_clean_to].cmd_type_offset_bsz &
 	    rte_cpu_to_le_64(ICE_TX_DESC_DTYPE_DESC_DONE))) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d) value=0x%"PRIx64"\n",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id,
-				txd[desc_to_clean_to].cmd_type_offset_bsz);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d) value=0x%"PRIx64"\n",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id,
+			   txd[desc_to_clean_to].cmd_type_offset_bsz);
 		/* Failed to clean any descriptors */
 		return -1;
 	}
@@ -2731,10 +2731,10 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		/* set RS bit on the last descriptor of one packet */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= ICE_TX_DESC_CMD_RS;
 
@@ -3243,7 +3243,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v4 7/8] net/ixgbe: refine debug build option
  2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
                     ` (5 preceding siblings ...)
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 6/8] net/ice: " Qi Zhang
@ 2021-03-18  1:42   ` Qi Zhang
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 8/8] net/igc: " Qi Zhang
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-18  1:42 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IXGBE_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IXGBE_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IXGBE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h   | 13 +------
 drivers/net/ixgbe/ixgbe_rxtx.c   | 64 ++++++++++++++++----------------
 3 files changed, 36 insertions(+), 48 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 761a0f26bb..4e948a260f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -8455,12 +8455,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf,
 RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.init, NOTICE);
 RTE_LOG_REGISTER(ixgbe_logtype_driver, pmd.net.ixgbe.driver, NOTICE);
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ixgbe_logtype_rx, pmd.net.ixgbe.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ixgbe_logtype_tx, pmd.net.ixgbe.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ixgbe_logtype_tx_free, pmd.net.ixgbe.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ixgbe/ixgbe_logs.h b/drivers/net/ixgbe/ixgbe_logs.h
index 2a279d1098..00ef797ca1 100644
--- a/drivers/net/ixgbe/ixgbe_logs.h
+++ b/drivers/net/ixgbe/ixgbe_logs.h
@@ -12,7 +12,7 @@ extern int ixgbe_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx,	\
@@ -21,7 +21,7 @@ extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx,	\
@@ -30,15 +30,6 @@ extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-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)
-#endif
-
 extern int ixgbe_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 7d23bab290..d69f36e977 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -583,11 +583,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	status = txr[desc_to_clean_to].wb.status;
 	if (!(status & rte_cpu_to_le_32(IXGBE_TXD_STAT_DD))) {
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -600,11 +600,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)",
-			nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
-			txq->port_id, txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)",
+		   nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
+		   txq->port_id, txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -750,12 +750,12 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		if (nb_used > txq->nb_tx_free) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (ixgbe_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -766,17 +766,17 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 			/* nb_used better be <= txq->tx_rs_thresh */
 			if (unlikely(nb_used > txq->tx_rs_thresh)) {
-				PMD_TX_FREE_LOG(DEBUG,
-					"The number of descriptors needed to "
-					"transmit the packet exceeds the "
-					"RS bit threshold. This will impact "
-					"performance."
-					"nb_used=%4u nb_free=%4u "
-					"tx_rs_thresh=%4u. "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->tx_rs_thresh,
-					txq->port_id, txq->queue_id);
+				PMD_TX_LOG(DEBUG,
+					   "The number of descriptors needed to "
+					   "transmit the packet exceeds the "
+					   "RS bit threshold. This will impact "
+					   "performance."
+					   "nb_used=%4u nb_free=%4u "
+					   "tx_rs_thresh=%4u. "
+					   "(port=%d queue=%d)",
+					   nb_used, txq->nb_tx_free,
+					   txq->tx_rs_thresh,
+					   txq->port_id, txq->queue_id);
 				/*
 				 * Loop here until there are enough TX
 				 * descriptors or until the ring cannot be
@@ -920,10 +920,10 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= IXGBE_TXD_CMD_RS;
 
@@ -995,7 +995,7 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v4 8/8] net/igc: refine debug build option
  2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
                     ` (6 preceding siblings ...)
  2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 7/8] net/ixgbe: " Qi Zhang
@ 2021-03-18  1:42   ` Qi Zhang
  7 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-18  1:42 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 6457c4d180..11071a32b5 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -20,14 +20,14 @@ extern int igc_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index c0a5d5e84f..f092709c02 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -1434,7 +1434,7 @@ eth_igc_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* Re: [dpdk-dev] [PATCH v2 1/8] ether: refine debug compile option
  2021-03-16 16:37         ` Ferruh Yigit
@ 2021-03-22 17:24           ` Ferruh Yigit
  2021-03-23  8:43             ` Zhang, Qi Z
  0 siblings, 1 reply; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-22 17:24 UTC (permalink / raw)
  To: Thomas Monjalon, Qi Zhang, Andrew Rybchenko
  Cc: dev, xiao.w.wang, jingjing.wu, beilei.xing, jia.guo, qiming.yang,
	haiyue.wang, bruce.richardson

On 3/16/2021 4:37 PM, Ferruh Yigit wrote:
> On 3/16/2021 1:39 PM, Thomas Monjalon wrote:
>> 16/03/2021 14:05, Ferruh Yigit:
>>> On 3/12/2021 12:12 PM, Qi Zhang wrote:
>>>> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option to wrap
>>>> data path debug code. As .config has been removed since the meson build,
>>>> It is not friendly for new DPDK users to notice those debug options.
>>>>
>>>> The patch introduces below compile options for specific Rx/Tx data path
>>>> debug, so PMD can choose to reuse them to avoid maintain their own.
>>>>
>>>> - RTE_LIBRTE_ETHDEV_DEBUG_RX
>>>> - RTE_LIBRTE_ETHDEV_DEBUG_TX
>>>>
>>>> Also, all the compile options are documented on the overview page, so
>>>> users can easily find them.
> 
> <...>
> 
>>>> +
>>>> +- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
>>>> +
>>>> +  Compile with debug code on data path.
>>
>> What is data path if not Rx or Tx?
>>
>>>> +
>>>> +- ``RTE_LIBRTE_ETHDEV_DEBUG_RX`` (default **disabled**)
>>>> +
>>>> +  Compile with debug code on Rx data path.
>>>> +
>>>> +- ``RTE_LIBRTE_ETHDEV_DEBUG_TX`` (default **disabled**)
>>>> +
>>>> +  Compile with debug code on Tx data path.
>>
>> In general, I think "LIBRTE_" is redundant and useless as macro prefix.
>>
> 
> 
> 'RTE_LIBRTE_ETHDEV_DEBUG' already exits, it enables datapath debug without 
> distinguishing Rx or Tx.
> 
> When we have _RX and _TX macro variants now, it may be possible to
> 1- get rid of 'RTE_LIBRTE_ETHDEV_DEBUG' macro and continue with fine grained RX 
> & TX
> 2- Use 'RTE_LIBRTE_ETHDEV_DEBUG' as an alias to enable both RX & TX
> 3- Keep 'RTE_LIBRTE_ETHDEV_DEBUG' for ethdev layer datapath debug, and RX & TX 
> variants for PMDs.
> 
> I think (3) can be more backward compatible, and can be helpful to separate 
> ethdev layer and PMD debugging, but no so strong opinion.

Hi Qi,

Reminder of above discussion, it is not addressed in v4. What do you think 
option 3 above?

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

* Re: [dpdk-dev] [PATCH v2 1/8] ether: refine debug compile option
  2021-03-22 17:24           ` Ferruh Yigit
@ 2021-03-23  8:43             ` Zhang, Qi Z
  0 siblings, 0 replies; 81+ messages in thread
From: Zhang, Qi Z @ 2021-03-23  8:43 UTC (permalink / raw)
  To: Yigit, Ferruh, Thomas Monjalon, Andrew Rybchenko
  Cc: dev, Wang, Xiao W, Wu, Jingjing, Xing, Beilei, Guo, Jia, Yang,
	Qiming, Wang, Haiyue, Richardson, Bruce



> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Tuesday, March 23, 2021 1:24 AM
> To: Thomas Monjalon <thomas@monjalon.net>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>
> Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Guo, Jia
> <jia.guo@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/8] ether: refine debug compile option
> 
> On 3/16/2021 4:37 PM, Ferruh Yigit wrote:
> > On 3/16/2021 1:39 PM, Thomas Monjalon wrote:
> >> 16/03/2021 14:05, Ferruh Yigit:
> >>> On 3/12/2021 12:12 PM, Qi Zhang wrote:
> >>>> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option
> to
> >>>> wrap data path debug code. As .config has been removed since the
> >>>> meson build, It is not friendly for new DPDK users to notice those debug
> options.
> >>>>
> >>>> The patch introduces below compile options for specific Rx/Tx data
> >>>> path debug, so PMD can choose to reuse them to avoid maintain their
> own.
> >>>>
> >>>> - RTE_LIBRTE_ETHDEV_DEBUG_RX
> >>>> - RTE_LIBRTE_ETHDEV_DEBUG_TX
> >>>>
> >>>> Also, all the compile options are documented on the overview page,
> >>>> so users can easily find them.
> >
> > <...>
> >
> >>>> +
> >>>> +- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
> >>>> +
> >>>> +  Compile with debug code on data path.
> >>
> >> What is data path if not Rx or Tx?
> >>
> >>>> +
> >>>> +- ``RTE_LIBRTE_ETHDEV_DEBUG_RX`` (default **disabled**)
> >>>> +
> >>>> +  Compile with debug code on Rx data path.
> >>>> +
> >>>> +- ``RTE_LIBRTE_ETHDEV_DEBUG_TX`` (default **disabled**)
> >>>> +
> >>>> +  Compile with debug code on Tx data path.
> >>
> >> In general, I think "LIBRTE_" is redundant and useless as macro prefix.
> >>
> >
> >
> > 'RTE_LIBRTE_ETHDEV_DEBUG' already exits, it enables datapath debug
> > without distinguishing Rx or Tx.
> >
> > When we have _RX and _TX macro variants now, it may be possible to
> > 1- get rid of 'RTE_LIBRTE_ETHDEV_DEBUG' macro and continue with fine
> > grained RX & TX
> > 2- Use 'RTE_LIBRTE_ETHDEV_DEBUG' as an alias to enable both RX & TX
> > 3- Keep 'RTE_LIBRTE_ETHDEV_DEBUG' for ethdev layer datapath debug, and
> > RX & TX variants for PMDs.
> >
> > I think (3) can be more backward compatible, and can be helpful to
> > separate ethdev layer and PMD debugging, but no so strong opinion.
> 
> Hi Qi,
> 
> Reminder of above discussion, it is not addressed in v4. What do you think
> option 3 above?

As discussed with Ferruh, we are agree to take option 1), which means

1. RTE_ETHDEV_DEBUG will be removed, as user can use to use _RX, _TX directly.

2. Now alias RTE_LIBRTE_ETHDEV_DEBUG to RTE_ETHDEV_RX and RTE_ETHDEV_TX for backward compatibility.

3. we will not take option 2, because, is may cause different behavior when rte_ethdev.h is included a PMD source file or not.

I will send V5 base on it, and let 's continued the discussion base on that if more inputs.

Thanks
Qi




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

* [dpdk-dev] [PATCH v5 0/8] ether: refine debug build option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (11 preceding siblings ...)
  2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
@ 2021-03-23 11:07 ` Qi Zhang
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 1/8] " Qi Zhang
                     ` (9 more replies)
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
  13 siblings, 10 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-23 11:07 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

Patch 1/8: introduces new compile options for data path debug in ether
layer, PMD can choose to reuse them to avoid maintain their own.

- RTE_ETHDEV_DEBUG_RX
- RTE_ETHDEV_DEBUG_TX

The undocumented RTE_LIBRTE_ETHDEV_DEBUG will a alias to
both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
compatibility.

Patch 2/8 - 8/8: refine the build option for Intel PMDs by using the
new build options

Qi Zhang (8):
  ether: refine debug build option
  net/fm10k: refine debug build option
  net/e1000: refine debug build option
  net/i40e: refine debug build option
  net/iavf: refine debug build option
  net/ice: refine debug build option
  net/ixgbe: refine debug build option
  net/igc: refine debug build option

 doc/guides/nics/build_and_test.rst | 16 ++++++++
 drivers/net/e1000/e1000_logs.c     | 17 ++------
 drivers/net/e1000/e1000_logs.h     | 13 +-----
 drivers/net/e1000/em_rxtx.c        | 38 +++++++++---------
 drivers/net/e1000/igb_rxtx.c       |  2 +-
 drivers/net/fm10k/fm10k_ethdev.c   |  7 +---
 drivers/net/fm10k/fm10k_logs.h     | 13 +-----
 drivers/net/fm10k/fm10k_rxtx.c     |  8 ++--
 drivers/net/i40e/i40e_ethdev.c     |  7 +---
 drivers/net/i40e/i40e_logs.h       | 13 +-----
 drivers/net/i40e/i40e_rxtx.c       | 16 ++++----
 drivers/net/iavf/iavf_ethdev.c     |  7 +---
 drivers/net/iavf/iavf_log.h        | 13 +-----
 drivers/net/iavf/iavf_rxtx.c       |  8 ++--
 drivers/net/ice/ice_ethdev.c       |  7 +---
 drivers/net/ice/ice_logs.h         | 13 +-----
 drivers/net/ice/ice_rxtx.c         | 20 +++++-----
 drivers/net/igc/igc_logs.h         |  4 +-
 drivers/net/igc/igc_txrx.c         |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c   |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h     | 13 +-----
 drivers/net/ixgbe/ixgbe_rxtx.c     | 64 +++++++++++++++---------------
 lib/librte_ethdev/rte_ethdev.h     | 22 ++++++----
 23 files changed, 137 insertions(+), 193 deletions(-)

-- 
2.26.2


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

* [dpdk-dev] [PATCH v5 1/8] ether: refine debug build option
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
@ 2021-03-23 11:07   ` Qi Zhang
  2021-03-23 14:44     ` Ferruh Yigit
  2021-03-23 21:14     ` Thomas Monjalon
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 2/8] net/fm10k: " Qi Zhang
                     ` (8 subsequent siblings)
  9 siblings, 2 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-23 11:07 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

The patch introduces below build options for data path debug, so PMD
can choose to reuse them to avoid maintain their own.

- RTE_ETHDEV_DEBUG_RX
- RTE_ETHDEV_DEBUG_TX

All the build options are documented at programming guide
"3.1 Driver Option", so users can easily find them.

The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
compatibility.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/doc/guides/nics/build_and_test.rst b/doc/guides/nics/build_and_test.rst
index e83dd4628c..d68f9563e0 100644
--- a/doc/guides/nics/build_and_test.rst
+++ b/doc/guides/nics/build_and_test.rst
@@ -26,6 +26,22 @@ This will also build testpmd.
 Detailed instructions are available
 in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
 
+The ethdev layer supports below compile options for debug purpose:
+
+- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
+
+  Build with debug code on Rx path.
+
+- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
+
+  Build with debug code on Tx path.
+
+.. Note::
+
+   The ethdev library use above options to wrap debug code to trace invalid parameters
+   on data path APIs, so performance downgrade is expected when enabling those options.
+   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.
+
 Running testpmd in Linux
 ------------------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index efda3137f7..6c7c72890f 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -148,6 +148,12 @@ extern "C" {
 /* Use this macro to check if LRO API is supported */
 #define RTE_ETHDEV_HAS_LRO_SUPPORT
 
+/* Alias RTE_LIBRTE_ETHDEV_DEBUG for backward compatibility. */
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#define RTE_ETHDEV_DEBUG_RX
+#define RTE_ETHDEV_DEBUG_TX
+#endif
+
 #include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_interrupts.h>
@@ -4941,7 +4947,7 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	uint16_t nb_rx;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_RX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
 
@@ -5075,11 +5081,11 @@ rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev;
 	void *rxq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_RX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_RX
 	if (queue_id >= dev->data->nb_rx_queues)
 		return -ENODEV;
 #endif
@@ -5132,11 +5138,11 @@ static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
 	struct rte_eth_dev *dev;
 	void *txq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	if (queue_id >= dev->data->nb_tx_queues)
 		return -ENODEV;
 #endif
@@ -5218,7 +5224,7 @@ rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
 
@@ -5316,7 +5322,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	if (!rte_eth_dev_is_valid_port(port_id)) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX port_id=%u\n", port_id);
 		rte_errno = ENODEV;
@@ -5326,7 +5332,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 
 	dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	if (queue_id >= dev->data->nb_tx_queues) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
 		rte_errno = EINVAL;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v5 2/8] net/fm10k: refine debug build option
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 1/8] " Qi Zhang
@ 2021-03-23 11:07   ` Qi Zhang
  2021-03-23 14:45     ` Ferruh Yigit
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 3/8] net/e1000: " Qi Zhang
                     ` (7 subsequent siblings)
  9 siblings, 1 reply; 81+ messages in thread
From: Qi Zhang @ 2021-03-23 11:07 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_FM10K_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_FM10K_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_FM10K_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c |  7 ++-----
 drivers/net/fm10k/fm10k_logs.h   | 13 ++-----------
 drivers/net/fm10k/fm10k_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index fd471c415e..0a557acbef 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3287,12 +3287,9 @@ RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_LOG_REGISTER(fm10k_logtype_init, pmd.net.fm10k.init, NOTICE);
 RTE_LOG_REGISTER(fm10k_logtype_driver, pmd.net.fm10k.driver, NOTICE);
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(fm10k_logtype_rx, pmd.net.fm10k.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(fm10k_logtype_tx, pmd.net.fm10k.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-RTE_LOG_REGISTER(fm10k_logtype_tx_free, pmd.net.fm10k.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h
index 9ae743d806..4f039f8beb 100644
--- a/drivers/net/fm10k/fm10k_logs.h
+++ b/drivers/net/fm10k/fm10k_logs.h
@@ -14,7 +14,7 @@ extern int fm10k_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-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
-
 extern int fm10k_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 8585c5b9e4..0a9a27aa5a 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -16,7 +16,7 @@
 #define rte_packet_prefetch(p)  do {} while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 static inline void dump_rxd(union fm10k_rx_desc *rxd)
 {
 	PMD_RX_LOG(DEBUG, "+----------------|----------------+");
@@ -115,7 +115,7 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 		rte_pktmbuf_pkt_len(mbuf) = desc.w.length;
@@ -229,7 +229,7 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 
@@ -710,7 +710,7 @@ fm10k_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v5 3/8] net/e1000: refine debug build option
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 1/8] " Qi Zhang
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 2/8] net/fm10k: " Qi Zhang
@ 2021-03-23 11:07   ` Qi Zhang
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 4/8] net/i40e: " Qi Zhang
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-23 11:07 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_E1000_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_E1000_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_E1000_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/e1000/e1000_logs.c | 17 ++++-----------
 drivers/net/e1000/e1000_logs.h | 13 ++----------
 drivers/net/e1000/em_rxtx.c    | 38 +++++++++++++++++-----------------
 drivers/net/e1000/igb_rxtx.c   |  2 +-
 4 files changed, 26 insertions(+), 44 deletions(-)

diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 231f5c03ef..84ea0f9d4b 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -8,15 +8,12 @@
 int e1000_logtype_init;
 int e1000_logtype_driver;
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 int e1000_logtype_rx;
 #endif
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_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;
@@ -34,23 +31,17 @@ e1000_igb_init_log(void)
 	if (e1000_logtype_driver >= 0)
 		rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
 	if (e1000_logtype_rx >= 0)
 		rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 	e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
 	if (e1000_logtype_tx >= 0)
 		rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-	e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
-	if (e1000_logtype_tx_free >= 0)
-		rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
-#endif
-
 	e1000_log_initialized = 1;
 }
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 2612134f38..86f546b0f9 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -15,7 +15,7 @@ extern int e1000_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_rx,	\
@@ -24,7 +24,7 @@ extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_tx,	\
@@ -33,15 +33,6 @@ extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-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)
-#endif
-
 extern int e1000_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, e1000_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index db5d1222ce..dfd8f2fd00 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -311,10 +311,10 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (! (txr[desc_to_clean_to].upper.fields.status & E1000_TXD_STAT_DD))
 	{
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -327,11 +327,11 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)", nb_tx_to_clean,
-			last_desc_cleaned, desc_to_clean_to, txq->port_id,
-			txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)", nb_tx_to_clean,
+		   last_desc_cleaned, desc_to_clean_to, txq->port_id,
+		   txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -457,11 +457,11 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		while (unlikely (nb_used > txq->nb_tx_free)) {
-			PMD_TX_FREE_LOG(DEBUG, "Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG, "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (em_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -579,10 +579,10 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id=%4u "
-					"(port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id=%4u "
+				   "(port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= E1000_TXD_CMD_RS;
 
@@ -626,7 +626,7 @@ eth_em_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 1500d2ffff..45da4ed9d2 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -641,7 +641,7 @@ eth_igb_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v5 4/8] net/i40e: refine debug build option
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
                     ` (2 preceding siblings ...)
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 3/8] net/e1000: " Qi Zhang
@ 2021-03-23 11:07   ` Qi Zhang
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 5/8] net/iavf: " Qi Zhang
                     ` (5 subsequent siblings)
  9 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-23 11:07 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_I40E_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_I40E_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_I40E_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  7 ++-----
 drivers/net/i40e/i40e_logs.h   | 13 ++-----------
 drivers/net/i40e/i40e_rxtx.c   | 16 ++++++++--------
 3 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 9b86bcdc69..38d43c8dc6 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12380,15 +12380,12 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
 
 RTE_LOG_REGISTER(i40e_logtype_init, pmd.net.i40e.init, NOTICE);
 RTE_LOG_REGISTER(i40e_logtype_driver, pmd.net.i40e.driver, NOTICE);
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(i40e_logtype_rx, pmd.net.i40e.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(i40e_logtype_tx, pmd.net.i40e.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-RTE_LOG_REGISTER(i40e_logtype_tx_free, pmd.net.i40e.tx_free, DEBUG);
-#endif
 
 RTE_PMD_REGISTER_PARAM_STRING(net_i40e,
 			      ETH_I40E_FLOATING_VEB_ARG "=1"
diff --git a/drivers/net/i40e/i40e_logs.h b/drivers/net/i40e/i40e_logs.h
index dac3267eb4..eebe6c5559 100644
--- a/drivers/net/i40e/i40e_logs.h
+++ b/drivers/net/i40e/i40e_logs.h
@@ -11,7 +11,7 @@ extern int i40e_logtype_init;
 		__func__, ##args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_rx,	\
@@ -20,7 +20,7 @@ extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_tx,	\
@@ -29,15 +29,6 @@ extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-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)
-#endif
-
 extern int i40e_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, i40e_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 61cb204be2..3c7686c3f4 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -372,9 +372,9 @@ i40e_xmit_cleanup(struct i40e_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-			"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -1253,10 +1253,10 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_used);
 
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= I40E_TX_DESC_CMD_RS;
 
@@ -1525,7 +1525,7 @@ i40e_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v5 5/8] net/iavf: refine debug build option
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
                     ` (3 preceding siblings ...)
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 4/8] net/i40e: " Qi Zhang
@ 2021-03-23 11:07   ` Qi Zhang
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 6/8] net/ice: " Qi Zhang
                     ` (4 subsequent siblings)
  9 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-23 11:07 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IAVF_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IAVF_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IAVF_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c |  7 ++-----
 drivers/net/iavf/iavf_log.h    | 13 ++-----------
 drivers/net/iavf/iavf_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 4d37722022..86bc5fcf3f 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -2360,12 +2360,9 @@ RTE_PMD_REGISTER_KMOD_DEP(net_iavf, "* igb_uio | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(net_iavf, "cap=dcf");
 RTE_LOG_REGISTER(iavf_logtype_init, pmd.net.iavf.init, NOTICE);
 RTE_LOG_REGISTER(iavf_logtype_driver, pmd.net.iavf.driver, NOTICE);
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(iavf_logtype_rx, pmd.net.iavf.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(iavf_logtype_tx, pmd.net.iavf.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-RTE_LOG_REGISTER(iavf_logtype_tx_free, pmd.net.iavf.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/iavf/iavf_log.h b/drivers/net/iavf/iavf_log.h
index 1088ec75f5..ff66ab0ccf 100644
--- a/drivers/net/iavf/iavf_log.h
+++ b/drivers/net/iavf/iavf_log.h
@@ -21,7 +21,7 @@ extern int iavf_logtype_driver;
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>")
 
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_rx,	\
@@ -30,7 +30,7 @@ extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_tx,	\
@@ -39,13 +39,4 @@ extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-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
-
 #endif /* _IAVF_LOG_H_ */
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 8fafe4579b..84df0989af 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -1979,9 +1979,9 @@ iavf_xmit_cleanup(struct iavf_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(IAVF_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(IAVF_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -2335,7 +2335,7 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v5 6/8] net/ice: refine debug build option
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
                     ` (4 preceding siblings ...)
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 5/8] net/iavf: " Qi Zhang
@ 2021-03-23 11:07   ` Qi Zhang
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 7/8] net/ixgbe: " Qi Zhang
                     ` (3 subsequent siblings)
  9 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-23 11:07 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_ICE_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_ICE_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ICE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.c |  7 ++-----
 drivers/net/ice/ice_logs.h   | 13 ++-----------
 drivers/net/ice/ice_rxtx.c   | 20 ++++++++++----------
 3 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 9c9b84a938..06169321cf 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -5376,12 +5376,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ice,
 
 RTE_LOG_REGISTER(ice_logtype_init, pmd.net.ice.init, NOTICE);
 RTE_LOG_REGISTER(ice_logtype_driver, pmd.net.ice.driver, NOTICE);
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ice_logtype_rx, pmd.net.ice.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ice_logtype_tx, pmd.net.ice.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ice_logtype_tx_free, pmd.net.ice.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ice/ice_logs.h b/drivers/net/ice/ice_logs.h
index aab7da5f7b..e79980fb63 100644
--- a/drivers/net/ice/ice_logs.h
+++ b/drivers/net/ice/ice_logs.h
@@ -14,7 +14,7 @@ extern int ice_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-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
-
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ice_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 530c206f4f..0827db9c9e 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2436,11 +2436,11 @@ ice_xmit_cleanup(struct ice_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (!(txd[desc_to_clean_to].cmd_type_offset_bsz &
 	    rte_cpu_to_le_64(ICE_TX_DESC_DTYPE_DESC_DONE))) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d) value=0x%"PRIx64"\n",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id,
-				txd[desc_to_clean_to].cmd_type_offset_bsz);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d) value=0x%"PRIx64"\n",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id,
+			   txd[desc_to_clean_to].cmd_type_offset_bsz);
 		/* Failed to clean any descriptors */
 		return -1;
 	}
@@ -2731,10 +2731,10 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		/* set RS bit on the last descriptor of one packet */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= ICE_TX_DESC_CMD_RS;
 
@@ -3243,7 +3243,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v5 7/8] net/ixgbe: refine debug build option
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
                     ` (5 preceding siblings ...)
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 6/8] net/ice: " Qi Zhang
@ 2021-03-23 11:07   ` Qi Zhang
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 8/8] net/igc: " Qi Zhang
                     ` (2 subsequent siblings)
  9 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-23 11:07 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IXGBE_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IXGBE_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IXGBE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h   | 13 +------
 drivers/net/ixgbe/ixgbe_rxtx.c   | 64 ++++++++++++++++----------------
 3 files changed, 36 insertions(+), 48 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 8a9a21e7c2..62cd2ecc22 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -8462,12 +8462,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf,
 RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.init, NOTICE);
 RTE_LOG_REGISTER(ixgbe_logtype_driver, pmd.net.ixgbe.driver, NOTICE);
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ixgbe_logtype_rx, pmd.net.ixgbe.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ixgbe_logtype_tx, pmd.net.ixgbe.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ixgbe_logtype_tx_free, pmd.net.ixgbe.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ixgbe/ixgbe_logs.h b/drivers/net/ixgbe/ixgbe_logs.h
index 2a279d1098..00ef797ca1 100644
--- a/drivers/net/ixgbe/ixgbe_logs.h
+++ b/drivers/net/ixgbe/ixgbe_logs.h
@@ -12,7 +12,7 @@ extern int ixgbe_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx,	\
@@ -21,7 +21,7 @@ extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx,	\
@@ -30,15 +30,6 @@ extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-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)
-#endif
-
 extern int ixgbe_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 7d23bab290..d69f36e977 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -583,11 +583,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	status = txr[desc_to_clean_to].wb.status;
 	if (!(status & rte_cpu_to_le_32(IXGBE_TXD_STAT_DD))) {
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -600,11 +600,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)",
-			nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
-			txq->port_id, txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)",
+		   nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
+		   txq->port_id, txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -750,12 +750,12 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		if (nb_used > txq->nb_tx_free) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (ixgbe_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -766,17 +766,17 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 			/* nb_used better be <= txq->tx_rs_thresh */
 			if (unlikely(nb_used > txq->tx_rs_thresh)) {
-				PMD_TX_FREE_LOG(DEBUG,
-					"The number of descriptors needed to "
-					"transmit the packet exceeds the "
-					"RS bit threshold. This will impact "
-					"performance."
-					"nb_used=%4u nb_free=%4u "
-					"tx_rs_thresh=%4u. "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->tx_rs_thresh,
-					txq->port_id, txq->queue_id);
+				PMD_TX_LOG(DEBUG,
+					   "The number of descriptors needed to "
+					   "transmit the packet exceeds the "
+					   "RS bit threshold. This will impact "
+					   "performance."
+					   "nb_used=%4u nb_free=%4u "
+					   "tx_rs_thresh=%4u. "
+					   "(port=%d queue=%d)",
+					   nb_used, txq->nb_tx_free,
+					   txq->tx_rs_thresh,
+					   txq->port_id, txq->queue_id);
 				/*
 				 * Loop here until there are enough TX
 				 * descriptors or until the ring cannot be
@@ -920,10 +920,10 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= IXGBE_TXD_CMD_RS;
 
@@ -995,7 +995,7 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v5 8/8] net/igc: refine debug build option
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
                     ` (6 preceding siblings ...)
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 7/8] net/ixgbe: " Qi Zhang
@ 2021-03-23 11:07   ` Qi Zhang
  2021-03-24 19:27     ` Ferruh Yigit
  2021-03-23 11:08   ` [dpdk-dev] [PATCH v5 0/8] ether: " Zhang, Qi Z
  2021-03-23 14:47   ` Ferruh Yigit
  9 siblings, 1 reply; 81+ messages in thread
From: Qi Zhang @ 2021-03-23 11:07 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 6457c4d180..11071a32b5 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -20,14 +20,14 @@ extern int igc_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index c0a5d5e84f..f092709c02 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -1434,7 +1434,7 @@ eth_igc_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* Re: [dpdk-dev] [PATCH v5 0/8] ether: refine debug build option
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
                     ` (7 preceding siblings ...)
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 8/8] net/igc: " Qi Zhang
@ 2021-03-23 11:08   ` Zhang, Qi Z
  2021-03-23 14:47   ` Ferruh Yigit
  9 siblings, 0 replies; 81+ messages in thread
From: Zhang, Qi Z @ 2021-03-23 11:08 UTC (permalink / raw)
  To: Yigit, Ferruh
  Cc: dev, thomas, Richardson, Bruce, Wang, Xiao W, Wu, Jingjing, Xing,
	Beilei, Guo, Jia, Yang, Qiming, Wang, Haiyue

Sorry, forgot adding change log....

v5:
- Remove RTE_ETHDEV_DEBUG
- Alias RTE_LIBRTE_ETHDEV_DEBUG to RTE_ETHDEV_DEBUG_RX|TX for backward compatibility.

v4:
- Alias RTE_LIBRTE_ETHDEV_DEBUG to RTE_ETHDEV_DEBUG in ethdev library
  for backward compatibility.
- Not replace RTE_LIBRTE_ETHDEV_DEBUG in all PMDs.

v3:
- rename "RTE_LIBRTE_ETHDEV_xxx" to "RTE_ETHDEV_xxx"
- move document from "overview.rst" page to "build_and_test.rst"
- fix grammar issues.

v2:
- fix some coding style issues.

> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Tuesday, March 23, 2021 7:08 PM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; thomas@monjalon.net; Richardson, Bruce
> <bruce.richardson@intel.com>; Wang, Xiao W <xiao.w.wang@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Guo, Jia
> <jia.guo@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH v5 0/8] ether: refine debug build option
> 
> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
> data path debug code. As .config has been removed since the meson build, It is
> not friendly for new DPDK users to notice those debug options.
> 
> Patch 1/8: introduces new compile options for data path debug in ether layer,
> PMD can choose to reuse them to avoid maintain their own.
> 
> - RTE_ETHDEV_DEBUG_RX
> - RTE_ETHDEV_DEBUG_TX
> 
> The undocumented RTE_LIBRTE_ETHDEV_DEBUG will a alias to both
> RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
> compatibility.
> 
> Patch 2/8 - 8/8: refine the build option for Intel PMDs by using the new build
> options
> 
> Qi Zhang (8):
>   ether: refine debug build option
>   net/fm10k: refine debug build option
>   net/e1000: refine debug build option
>   net/i40e: refine debug build option
>   net/iavf: refine debug build option
>   net/ice: refine debug build option
>   net/ixgbe: refine debug build option
>   net/igc: refine debug build option
> 
>  doc/guides/nics/build_and_test.rst | 16 ++++++++
>  drivers/net/e1000/e1000_logs.c     | 17 ++------
>  drivers/net/e1000/e1000_logs.h     | 13 +-----
>  drivers/net/e1000/em_rxtx.c        | 38 +++++++++---------
>  drivers/net/e1000/igb_rxtx.c       |  2 +-
>  drivers/net/fm10k/fm10k_ethdev.c   |  7 +---
>  drivers/net/fm10k/fm10k_logs.h     | 13 +-----
>  drivers/net/fm10k/fm10k_rxtx.c     |  8 ++--
>  drivers/net/i40e/i40e_ethdev.c     |  7 +---
>  drivers/net/i40e/i40e_logs.h       | 13 +-----
>  drivers/net/i40e/i40e_rxtx.c       | 16 ++++----
>  drivers/net/iavf/iavf_ethdev.c     |  7 +---
>  drivers/net/iavf/iavf_log.h        | 13 +-----
>  drivers/net/iavf/iavf_rxtx.c       |  8 ++--
>  drivers/net/ice/ice_ethdev.c       |  7 +---
>  drivers/net/ice/ice_logs.h         | 13 +-----
>  drivers/net/ice/ice_rxtx.c         | 20 +++++-----
>  drivers/net/igc/igc_logs.h         |  4 +-
>  drivers/net/igc/igc_txrx.c         |  2 +-
>  drivers/net/ixgbe/ixgbe_ethdev.c   |  7 +---
>  drivers/net/ixgbe/ixgbe_logs.h     | 13 +-----
>  drivers/net/ixgbe/ixgbe_rxtx.c     | 64 +++++++++++++++---------------
>  lib/librte_ethdev/rte_ethdev.h     | 22 ++++++----
>  23 files changed, 137 insertions(+), 193 deletions(-)
> 
> --
> 2.26.2


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

* Re: [dpdk-dev] [PATCH v5 1/8] ether: refine debug build option
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 1/8] " Qi Zhang
@ 2021-03-23 14:44     ` Ferruh Yigit
  2021-03-23 21:14     ` Thomas Monjalon
  1 sibling, 0 replies; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-23 14:44 UTC (permalink / raw)
  To: Qi Zhang
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang

On 3/23/2021 11:07 AM, Qi Zhang wrote:
> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
> data path debug code. As .config has been removed since the meson build,
> It is not friendly for new DPDK users to notice those debug options.
> 
> The patch introduces below build options for data path debug, so PMD
> can choose to reuse them to avoid maintain their own.
> 
> - RTE_ETHDEV_DEBUG_RX
> - RTE_ETHDEV_DEBUG_TX
> 
> All the build options are documented at programming guide
> "3.1 Driver Option", so users can easily find them.
> 
> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
> compatibility.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

ethdev: ...

can fix while merging.


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

* Re: [dpdk-dev] [PATCH v5 2/8] net/fm10k: refine debug build option
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 2/8] net/fm10k: " Qi Zhang
@ 2021-03-23 14:45     ` Ferruh Yigit
  0 siblings, 0 replies; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-23 14:45 UTC (permalink / raw)
  To: Qi Zhang
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang

On 3/23/2021 11:07 AM, Qi Zhang wrote:
> 1. replace RTE_LIBRTE_FM10K_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
> 2. replace RTE_LIBRTE_FM10K_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.

s/whth/with

can fix while merging

> 3. merge RTE_LIBRTE_FM10K_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
>     into RTE_ETHDEV_DEBUG_TX
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>



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

* Re: [dpdk-dev] [PATCH v5 0/8] ether: refine debug build option
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
                     ` (8 preceding siblings ...)
  2021-03-23 11:08   ` [dpdk-dev] [PATCH v5 0/8] ether: " Zhang, Qi Z
@ 2021-03-23 14:47   ` Ferruh Yigit
  9 siblings, 0 replies; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-23 14:47 UTC (permalink / raw)
  To: Qi Zhang, Thomas Monjalon, Andrew Rybchenko
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang

On 3/23/2021 11:07 AM, Qi Zhang wrote:
> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
> data path debug code. As .config has been removed since the meson build,
> It is not friendly for new DPDK users to notice those debug options.
> 
> Patch 1/8: introduces new compile options for data path debug in ether
> layer, PMD can choose to reuse them to avoid maintain their own.
> 
> - RTE_ETHDEV_DEBUG_RX
> - RTE_ETHDEV_DEBUG_TX
> 
> The undocumented RTE_LIBRTE_ETHDEV_DEBUG will a alias to
> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
> compatibility.
> 
> Patch 2/8 - 8/8: refine the build option for Intel PMDs by using the
> new build options
> 
> Qi Zhang (8):
>    ether: refine debug build option
>    net/fm10k: refine debug build option
>    net/e1000: refine debug build option
>    net/i40e: refine debug build option
>    net/iavf: refine debug build option
>    net/ice: refine debug build option
>    net/ixgbe: refine debug build option
>    net/igc: refine debug build option
> 

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

Thomas, Andrew, if there is no objection I am planning to merge it soon.

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

* Re: [dpdk-dev] [PATCH v5 1/8] ether: refine debug build option
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 1/8] " Qi Zhang
  2021-03-23 14:44     ` Ferruh Yigit
@ 2021-03-23 21:14     ` Thomas Monjalon
  1 sibling, 0 replies; 81+ messages in thread
From: Thomas Monjalon @ 2021-03-23 21:14 UTC (permalink / raw)
  To: Qi Zhang
  Cc: ferruh.yigit, dev, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, andrew.rybchenko

23/03/2021 12:07, Qi Zhang:
> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
> data path debug code. As .config has been removed since the meson build,
> It is not friendly for new DPDK users to notice those debug options.
> 
> The patch introduces below build options for data path debug, so PMD
> can choose to reuse them to avoid maintain their own.
> 
> - RTE_ETHDEV_DEBUG_RX
> - RTE_ETHDEV_DEBUG_TX
> 
> All the build options are documented at programming guide
> "3.1 Driver Option", so users can easily find them.
> 
> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
> compatibility.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
[...]
> +The ethdev layer supports below compile options for debug purpose:

As suggested by Bruce, "build options" is a better term.

> +
> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
> +
> +  Build with debug code on Rx path.
> +
> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
> +
> +  Build with debug code on Tx path.
> +
> +.. Note::
> +
> +   The ethdev library use above options to wrap debug code to trace invalid parameters
> +   on data path APIs, so performance downgrade is expected when enabling those options.
> +   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.

Acked-by: Thomas Monjalon <thomas@monjalon.net>



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

* Re: [dpdk-dev] [PATCH v5 8/8] net/igc: refine debug build option
  2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 8/8] net/igc: " Qi Zhang
@ 2021-03-24 19:27     ` Ferruh Yigit
  2021-03-24 20:31       ` David Marchand
  0 siblings, 1 reply; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-24 19:27 UTC (permalink / raw)
  To: Qi Zhang
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Chen, Zhaoyan,
	Aaron Conole

On 3/23/2021 11:07 AM, Qi Zhang wrote:
> 1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
> 2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
> 3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

CI is reporting a build error [1], I don't reproduce the error and I assume it 
is false positive but can you please check it?

Also cc'ed Zhaoyan & Aaron for the possible CI issue.

[1]
http://mails.dpdk.org/archives/test-report/2021-March/184153.html

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

* Re: [dpdk-dev] [PATCH v5 8/8] net/igc: refine debug build option
  2021-03-24 19:27     ` Ferruh Yigit
@ 2021-03-24 20:31       ` David Marchand
  2021-03-25 15:43         ` Ferruh Yigit
  0 siblings, 1 reply; 81+ messages in thread
From: David Marchand @ 2021-03-24 20:31 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Qi Zhang, dev, Thomas Monjalon, Bruce Richardson, Xiao Wang,
	Jingjing Wu, Beilei Xing, Jeff Guo, Qiming Yang, Wang, Haiyue,
	Chen, Zhaoyan, Aaron Conole

On Wed, Mar 24, 2021 at 8:27 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 3/23/2021 11:07 AM, Qi Zhang wrote:
> > 1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
> > 2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
> > 3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>
> CI is reporting a build error [1], I don't reproduce the error and I assume it
> is false positive but can you please check it?
>
> Also cc'ed Zhaoyan & Aaron for the possible CI issue.
>
> [1]
> http://mails.dpdk.org/archives/test-report/2021-March/184153.html
>

Not sure what gcc+debug target is, but I guess it passes the old config item.
The compat stuff should be placed in rte_config.h (or something
similar to config/rte_compatibility_defines.h) and not in
lib/librte_ethdev/rte_ethdev.h.

To reproduce:
$ meson configure $HOME/builds/build-gcc-static/
-Dc_args="-DRTE_LIBRTE_ETHDEV_DEBUG=1"
$ ./devtools/test-meson-builds.sh
...
FAILED: drivers/librte_net_e1000.so.21.2
gcc  -o drivers/librte_net_e1000.so.21.2
drivers/librte_net_e1000.so.21.2.p/meson-generated_.._rte_net_e1000.pmd.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_base.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_80003es2lan.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82540.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82541.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82542.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82543.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82571.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82575.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_api.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_i210.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_ich8lan.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_mac.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_manage.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_mbx.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_nvm.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_osdep.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_phy.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_vf.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_e1000_logs.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_ethdev.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_ethdev.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_flow.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_pf.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o
-I/home/dmarchan/intel-ipsec-mb/install/include
-L/home/dmarchan/intel-ipsec-mb/install/lib -Wl,--as-needed
-Wl,--no-undefined -shared -fPIC -Wl,--start-group
-Wl,-soname,librte_net_e1000.so.21 -Wl,--no-as-needed -pthread -lm
-ldl -lnuma -lfdt lib/librte_ethdev.so.21.2 lib/librte_eal.so.21.2
lib/librte_kvargs.so.21.2 lib/librte_telemetry.so.21.2
lib/librte_net.so.21.2 lib/librte_mbuf.so.21.2
lib/librte_mempool.so.21.2 lib/librte_ring.so.21.2
lib/librte_meter.so.21.2 drivers/librte_bus_pci.so.21.2
lib/librte_pci.so.21.2 drivers/librte_bus_vdev.so.21.2
-Wl,--version-script=/home/dmarchan/dpdk/drivers/net/e1000/version.map
/usr/lib64/libbsd.so -Wl,--end-group
'-Wl,-rpath,$ORIGIN/../lib:$ORIGIN/'
-Wl,-rpath-link,/home/dmarchan/builds/build-gcc-static/lib
-Wl,-rpath-link,/home/dmarchan/builds/build-gcc-static/drivers
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:
in function `eth_em_xmit_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:400:
undefined reference to `e1000_logtype_tx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:
in function `rte_prefetch0':
/home/dmarchan/builds/build-gcc-static/../../dpdk/lib/librte_eal/x86/include/rte_prefetch.h:17:
undefined reference to `e1000_logtype_tx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:
in function `em_xmit_cleanup':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:314:
undefined reference to `e1000_logtype_tx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:
in function `eth_em_recv_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:743:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:751:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:836:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:
in function `eth_em_recv_scattered_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:923:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:931:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:1081:
more undefined references to `e1000_logtype_rx' follow
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o:
in function `eth_igb_xmit_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:409:
undefined reference to `e1000_logtype_tx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o:
in function `rte_prefetch0':
/home/dmarchan/builds/build-gcc-static/../../dpdk/lib/librte_eal/x86/include/rte_prefetch.h:17:
undefined reference to `e1000_logtype_tx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o:
in function `eth_igb_recv_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:871:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:879:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:974:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o:
in function `eth_igb_recv_scattered_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:1062:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:1070:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o:/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:1236:
more undefined references to `e1000_logtype_rx' follow
collect2: error: ld returned 1 exit status
[1113/2466] Compiling C object
lib/librte_pipeline.a.p/librte_pipeline_rte_table_action.c.o



-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH v5 8/8] net/igc: refine debug build option
  2021-03-24 20:31       ` David Marchand
@ 2021-03-25 15:43         ` Ferruh Yigit
  2021-03-30 14:06           ` Ferruh Yigit
  0 siblings, 1 reply; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-25 15:43 UTC (permalink / raw)
  To: David Marchand
  Cc: Qi Zhang, dev, Thomas Monjalon, Bruce Richardson, Xiao Wang,
	Jingjing Wu, Beilei Xing, Jeff Guo, Qiming Yang, Wang, Haiyue,
	Chen, Zhaoyan, Aaron Conole

On 3/24/2021 8:31 PM, David Marchand wrote:
> On Wed, Mar 24, 2021 at 8:27 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>> On 3/23/2021 11:07 AM, Qi Zhang wrote:
>>> 1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
>>> 2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
>>> 3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX
>>>
>>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>>
>> CI is reporting a build error [1], I don't reproduce the error and I assume it
>> is false positive but can you please check it?
>>
>> Also cc'ed Zhaoyan & Aaron for the possible CI issue.
>>
>> [1]
>> http://mails.dpdk.org/archives/test-report/2021-March/184153.html
>>
> 
> Not sure what gcc+debug target is, but I guess it passes the old config item.
> The compat stuff should be placed in rte_config.h (or something
> similar to config/rte_compatibility_defines.h) and not in
> lib/librte_ethdev/rte_ethdev.h.
> 
> To reproduce:
> $ meson configure $HOME/builds/build-gcc-static/
> -Dc_args="-DRTE_LIBRTE_ETHDEV_DEBUG=1"
> $ ./devtools/test-meson-builds.sh

Thanks for the steps, I can reproduce it. The alias is not working because 
'rte_ethdev.h' where the alias is defined is not included in this path.

Following update should fix it, what do you think?


  diff --git a/drivers/net/e1000/base/meson.build 
b/drivers/net/e1000/base/meson.build
  index d13f693d3eb8..a9f92cbc4770 100644
  --- a/drivers/net/e1000/base/meson.build
  +++ b/drivers/net/e1000/base/meson.build
  @@ -33,6 +33,6 @@ foreach flag: error_cflags
   endforeach

   base_lib = static_library('e1000_base', sources,
  -       dependencies: static_rte_eal,
  +       dependencies: [static_rte_eal,static_rte_ethdev],
          c_args: c_args)
   base_objs = base_lib.extract_all_objects()
  diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
  index 86f546b0f9ed..210c3447c66c 100644
  --- a/drivers/net/e1000/e1000_logs.h
  +++ b/drivers/net/e1000/e1000_logs.h
  @@ -7,6 +7,9 @@

   #include <rte_log.h>

  +/* included because of RTE_LIBRTE_ETHDEV_DEBUG alias */
  +#include <rte_ethdev.h>
  +
   extern int e1000_logtype_init;

   #define PMD_INIT_LOG(level, fmt, args...) \

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

* Re: [dpdk-dev] [PATCH v5 8/8] net/igc: refine debug build option
  2021-03-25 15:43         ` Ferruh Yigit
@ 2021-03-30 14:06           ` Ferruh Yigit
  0 siblings, 0 replies; 81+ messages in thread
From: Ferruh Yigit @ 2021-03-30 14:06 UTC (permalink / raw)
  To: Qi Zhang
  Cc: dev, Thomas Monjalon, Bruce Richardson, Xiao Wang, Jingjing Wu,
	Beilei Xing, Jeff Guo, Qiming Yang, Wang, Haiyue, Chen, Zhaoyan,
	David Marchand, Aaron Conole

On 3/25/2021 3:43 PM, Ferruh Yigit wrote:
> On 3/24/2021 8:31 PM, David Marchand wrote:
>> On Wed, Mar 24, 2021 at 8:27 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>>
>>> On 3/23/2021 11:07 AM, Qi Zhang wrote:
>>>> 1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
>>>> 2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
>>>> 3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX
>>>>
>>>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>>>
>>> CI is reporting a build error [1], I don't reproduce the error and I assume it
>>> is false positive but can you please check it?
>>>
>>> Also cc'ed Zhaoyan & Aaron for the possible CI issue.
>>>
>>> [1]
>>> http://mails.dpdk.org/archives/test-report/2021-March/184153.html
>>>
>>
>> Not sure what gcc+debug target is, but I guess it passes the old config item.
>> The compat stuff should be placed in rte_config.h (or something
>> similar to config/rte_compatibility_defines.h) and not in
>> lib/librte_ethdev/rte_ethdev.h.
>>
>> To reproduce:
>> $ meson configure $HOME/builds/build-gcc-static/
>> -Dc_args="-DRTE_LIBRTE_ETHDEV_DEBUG=1"
>> $ ./devtools/test-meson-builds.sh
> 
> Thanks for the steps, I can reproduce it. The alias is not working because 
> 'rte_ethdev.h' where the alias is defined is not included in this path.
> 
> Following update should fix it, what do you think?
> 
> 
> diff --git a/drivers/net/e1000/base/meson.build 
> b/drivers/net/e1000/base/meson.build
> index d13f693d3eb8..a9f92cbc4770 100644
> --- a/drivers/net/e1000/base/meson.build
> +++ b/drivers/net/e1000/base/meson.build
> @@ -33,6 +33,6 @@ foreach flag: error_cflags
>   endforeach
> 
>   base_lib = static_library('e1000_base', sources,
> -       dependencies: static_rte_eal,
> +       dependencies: [static_rte_eal,static_rte_ethdev],
>          c_args: c_args)
>   base_objs = base_lib.extract_all_objects()
> diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
> index 86f546b0f9ed..210c3447c66c 100644
> --- a/drivers/net/e1000/e1000_logs.h
> +++ b/drivers/net/e1000/e1000_logs.h
> @@ -7,6 +7,9 @@
> 
>   #include <rte_log.h>
> 
> +/* included because of RTE_LIBRTE_ETHDEV_DEBUG alias */
> +#include <rte_ethdev.h>
> +
>   extern int e1000_logtype_init;
> 
>   #define PMD_INIT_LOG(level, fmt, args...) \

Hi Qi,

Can you make a new version with above fix if it makes sense?

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

* [dpdk-dev] [PATCH v6 0/8] ether: refine debug build option
  2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
                   ` (12 preceding siblings ...)
  2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
@ 2021-03-31  9:52 ` Qi Zhang
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 1/8] " Qi Zhang
                     ` (8 more replies)
  13 siblings, 9 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-31  9:52 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

Patch 1/8: introduces new compile options for data path debug in ether
layer, PMD can choose to reuse them to avoid maintain their own.

- RTE_ETHDEV_DEBUG_RX
- RTE_ETHDEV_DEBUG_TX

The undocumented RTE_LIBRTE_ETHDEV_DEBUG will a alias to
both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
compatibility.

Patch 2/8 - 8/8: refine the build option for Intel PMDs by using the
new build options

v6:
- fix build issue for -Dc_args="-DRTE_LIBRTE_ETHDEV_DEBUG=1"
- s/compile/build/  

v5:
- Remove RTE_ETHDEV_DEBUG
- Alias RTE_LIBRTE_ETHDEV_DEBUG to RTE_ETHDEV_DEBUG_RX|TX for backward
  compatibility.

v4:
- Alias RTE_LIBRTE_ETHDEV_DEBUG to RTE_ETHDEV_DEBUG in ethdev library
  for backward compatibility.
- Not replace RTE_LIBRTE_ETHDEV_DEBUG in all PMDs.

v3:
- rename "RTE_LIBRTE_ETHDEV_xxx" to "RTE_ETHDEV_xxx"
- move document from "overview.rst" page to "build_and_test.rst"
- fix grammar issues.

v2:
- fix some coding style issues.


Qi Zhang (8):
  ether: refine debug build option
  net/fm10k: refine debug build option
  net/e1000: refine debug build option
  net/i40e: refine debug build option
  net/iavf: refine debug build option
  net/ice: refine debug build option
  net/ixgbe: refine debug build option
  net/igc: refine debug build option

 doc/guides/nics/build_and_test.rst | 16 ++++++++
 drivers/net/e1000/e1000_logs.c     | 18 +++------
 drivers/net/e1000/e1000_logs.h     | 13 +-----
 drivers/net/e1000/em_rxtx.c        | 38 +++++++++---------
 drivers/net/e1000/igb_rxtx.c       |  2 +-
 drivers/net/fm10k/fm10k_ethdev.c   |  7 +---
 drivers/net/fm10k/fm10k_logs.h     | 13 +-----
 drivers/net/fm10k/fm10k_rxtx.c     |  8 ++--
 drivers/net/i40e/i40e_ethdev.c     |  7 +---
 drivers/net/i40e/i40e_logs.h       | 13 +-----
 drivers/net/i40e/i40e_rxtx.c       | 16 ++++----
 drivers/net/iavf/iavf_ethdev.c     |  7 +---
 drivers/net/iavf/iavf_log.h        | 13 +-----
 drivers/net/iavf/iavf_rxtx.c       |  8 ++--
 drivers/net/ice/ice_ethdev.c       |  7 +---
 drivers/net/ice/ice_logs.h         | 13 +-----
 drivers/net/ice/ice_rxtx.c         | 20 +++++-----
 drivers/net/igc/igc_logs.h         |  4 +-
 drivers/net/igc/igc_txrx.c         |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c   |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h     | 13 +-----
 drivers/net/ixgbe/ixgbe_rxtx.c     | 64 +++++++++++++++---------------
 lib/librte_ethdev/rte_ethdev.h     | 22 ++++++----
 23 files changed, 138 insertions(+), 193 deletions(-)

-- 
2.26.2


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

* [dpdk-dev] [PATCH v6 1/8] ether: refine debug build option
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
@ 2021-03-31  9:52   ` Qi Zhang
  2021-04-01 14:30     ` Ferruh Yigit
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 2/8] net/fm10k: " Qi Zhang
                     ` (7 subsequent siblings)
  8 siblings, 1 reply; 81+ messages in thread
From: Qi Zhang @ 2021-03-31  9:52 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

The patch introduces below build options for data path debug, so PMD
can choose to reuse them to avoid maintain their own.

- RTE_ETHDEV_DEBUG_RX
- RTE_ETHDEV_DEBUG_TX

All the build options are documented at programming guide
"3.1 Driver Option", so users can easily find them.

The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
compatibility.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/doc/guides/nics/build_and_test.rst b/doc/guides/nics/build_and_test.rst
index e83dd4628c..e8b29c2277 100644
--- a/doc/guides/nics/build_and_test.rst
+++ b/doc/guides/nics/build_and_test.rst
@@ -26,6 +26,22 @@ This will also build testpmd.
 Detailed instructions are available
 in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
 
+The ethdev layer supports below build options for debug purpose:
+
+- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
+
+  Build with debug code on Rx path.
+
+- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
+
+  Build with debug code on Tx path.
+
+.. Note::
+
+   The ethdev library use above options to wrap debug code to trace invalid parameters
+   on data path APIs, so performance downgrade is expected when enabling those options.
+   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.
+
 Running testpmd in Linux
 ------------------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index efda3137f7..6c7c72890f 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -148,6 +148,12 @@ extern "C" {
 /* Use this macro to check if LRO API is supported */
 #define RTE_ETHDEV_HAS_LRO_SUPPORT
 
+/* Alias RTE_LIBRTE_ETHDEV_DEBUG for backward compatibility. */
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#define RTE_ETHDEV_DEBUG_RX
+#define RTE_ETHDEV_DEBUG_TX
+#endif
+
 #include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_interrupts.h>
@@ -4941,7 +4947,7 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	uint16_t nb_rx;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_RX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
 
@@ -5075,11 +5081,11 @@ rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev;
 	void *rxq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_RX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_RX
 	if (queue_id >= dev->data->nb_rx_queues)
 		return -ENODEV;
 #endif
@@ -5132,11 +5138,11 @@ static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
 	struct rte_eth_dev *dev;
 	void *txq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	if (queue_id >= dev->data->nb_tx_queues)
 		return -ENODEV;
 #endif
@@ -5218,7 +5224,7 @@ rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
 
@@ -5316,7 +5322,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	if (!rte_eth_dev_is_valid_port(port_id)) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX port_id=%u\n", port_id);
 		rte_errno = ENODEV;
@@ -5326,7 +5332,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 
 	dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	if (queue_id >= dev->data->nb_tx_queues) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
 		rte_errno = EINVAL;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v6 2/8] net/fm10k: refine debug build option
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 1/8] " Qi Zhang
@ 2021-03-31  9:52   ` Qi Zhang
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 3/8] net/e1000: " Qi Zhang
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-31  9:52 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_FM10K_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_FM10K_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_FM10K_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c |  7 ++-----
 drivers/net/fm10k/fm10k_logs.h   | 13 ++-----------
 drivers/net/fm10k/fm10k_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index fd471c415e..0a557acbef 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3287,12 +3287,9 @@ RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_LOG_REGISTER(fm10k_logtype_init, pmd.net.fm10k.init, NOTICE);
 RTE_LOG_REGISTER(fm10k_logtype_driver, pmd.net.fm10k.driver, NOTICE);
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(fm10k_logtype_rx, pmd.net.fm10k.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(fm10k_logtype_tx, pmd.net.fm10k.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-RTE_LOG_REGISTER(fm10k_logtype_tx_free, pmd.net.fm10k.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h
index 9ae743d806..4f039f8beb 100644
--- a/drivers/net/fm10k/fm10k_logs.h
+++ b/drivers/net/fm10k/fm10k_logs.h
@@ -14,7 +14,7 @@ extern int fm10k_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int fm10k_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int fm10k_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_TX_FREE
-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
-
 extern int fm10k_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, fm10k_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 8585c5b9e4..0a9a27aa5a 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -16,7 +16,7 @@
 #define rte_packet_prefetch(p)  do {} while (0)
 #endif
 
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 static inline void dump_rxd(union fm10k_rx_desc *rxd)
 {
 	PMD_RX_LOG(DEBUG, "+----------------|----------------+");
@@ -115,7 +115,7 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 		rte_pktmbuf_pkt_len(mbuf) = desc.w.length;
@@ -229,7 +229,7 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			break;
 		mbuf = q->sw_ring[next_dd];
 		desc = q->hw_ring[next_dd];
-#ifdef RTE_LIBRTE_FM10K_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 		dump_rxd(&desc);
 #endif
 
@@ -710,7 +710,7 @@ fm10k_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v6 3/8] net/e1000: refine debug build option
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 1/8] " Qi Zhang
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 2/8] net/fm10k: " Qi Zhang
@ 2021-03-31  9:52   ` Qi Zhang
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 4/8] net/i40e: " Qi Zhang
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-31  9:52 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_E1000_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_E1000_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_E1000_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/e1000/e1000_logs.c | 17 ++++-----------
 drivers/net/e1000/e1000_logs.h | 13 ++----------
 drivers/net/e1000/em_rxtx.c    | 38 +++++++++++++++++-----------------
 drivers/net/e1000/igb_rxtx.c   |  2 +-
 4 files changed, 26 insertions(+), 44 deletions(-)

diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 231f5c03ef..84ea0f9d4b 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -8,15 +8,12 @@
 int e1000_logtype_init;
 int e1000_logtype_driver;
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 int e1000_logtype_rx;
 #endif
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_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;
@@ -34,23 +31,17 @@ e1000_igb_init_log(void)
 	if (e1000_logtype_driver >= 0)
 		rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 	e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
 	if (e1000_logtype_rx >= 0)
 		rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 	e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
 	if (e1000_logtype_tx >= 0)
 		rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-	e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
-	if (e1000_logtype_tx_free >= 0)
-		rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
-#endif
-
 	e1000_log_initialized = 1;
 }
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 2612134f38..86f546b0f9 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -15,7 +15,7 @@ extern int e1000_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_rx,	\
@@ -24,7 +24,7 @@ extern int e1000_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, e1000_logtype_tx,	\
@@ -33,15 +33,6 @@ extern int e1000_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
-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)
-#endif
-
 extern int e1000_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, e1000_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index db5d1222ce..dfd8f2fd00 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -311,10 +311,10 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (! (txr[desc_to_clean_to].upper.fields.status & E1000_TXD_STAT_DD))
 	{
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -327,11 +327,11 @@ em_xmit_cleanup(struct em_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)", nb_tx_to_clean,
-			last_desc_cleaned, desc_to_clean_to, txq->port_id,
-			txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)", nb_tx_to_clean,
+		   last_desc_cleaned, desc_to_clean_to, txq->port_id,
+		   txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -457,11 +457,11 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		while (unlikely (nb_used > txq->nb_tx_free)) {
-			PMD_TX_FREE_LOG(DEBUG, "Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG, "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (em_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -579,10 +579,10 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id=%4u "
-					"(port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id=%4u "
+				   "(port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= E1000_TXD_CMD_RS;
 
@@ -626,7 +626,7 @@ eth_em_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 1500d2ffff..45da4ed9d2 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -641,7 +641,7 @@ eth_igb_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v6 4/8] net/i40e: refine debug build option
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
                     ` (2 preceding siblings ...)
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 3/8] net/e1000: " Qi Zhang
@ 2021-03-31  9:52   ` Qi Zhang
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 5/8] net/iavf: " Qi Zhang
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-31  9:52 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_I40E_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_I40E_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_I40E_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  7 ++-----
 drivers/net/i40e/i40e_logs.h   | 13 ++-----------
 drivers/net/i40e/i40e_rxtx.c   | 16 ++++++++--------
 3 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index fcf150e127..2076717324 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12448,15 +12448,12 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
 
 RTE_LOG_REGISTER(i40e_logtype_init, pmd.net.i40e.init, NOTICE);
 RTE_LOG_REGISTER(i40e_logtype_driver, pmd.net.i40e.driver, NOTICE);
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(i40e_logtype_rx, pmd.net.i40e.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(i40e_logtype_tx, pmd.net.i40e.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-RTE_LOG_REGISTER(i40e_logtype_tx_free, pmd.net.i40e.tx_free, DEBUG);
-#endif
 
 RTE_PMD_REGISTER_PARAM_STRING(net_i40e,
 			      ETH_I40E_FLOATING_VEB_ARG "=1"
diff --git a/drivers/net/i40e/i40e_logs.h b/drivers/net/i40e/i40e_logs.h
index dac3267eb4..eebe6c5559 100644
--- a/drivers/net/i40e/i40e_logs.h
+++ b/drivers/net/i40e/i40e_logs.h
@@ -11,7 +11,7 @@ extern int i40e_logtype_init;
 		__func__, ##args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_rx,	\
@@ -20,7 +20,7 @@ extern int i40e_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, i40e_logtype_tx,	\
@@ -29,15 +29,6 @@ extern int i40e_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_I40E_DEBUG_TX_FREE
-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)
-#endif
-
 extern int i40e_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, i40e_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 61cb204be2..3c7686c3f4 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -372,9 +372,9 @@ i40e_xmit_cleanup(struct i40e_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-			"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -1253,10 +1253,10 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_used);
 
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= I40E_TX_DESC_CMD_RS;
 
@@ -1525,7 +1525,7 @@ i40e_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v6 5/8] net/iavf: refine debug build option
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
                     ` (3 preceding siblings ...)
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 4/8] net/i40e: " Qi Zhang
@ 2021-03-31  9:52   ` Qi Zhang
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 6/8] net/ice: " Qi Zhang
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-31  9:52 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IAVF_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IAVF_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IAVF_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c |  7 ++-----
 drivers/net/iavf/iavf_log.h    | 13 ++-----------
 drivers/net/iavf/iavf_rxtx.c   |  8 ++++----
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 869c4a1988..51cad48069 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -2352,12 +2352,9 @@ RTE_PMD_REGISTER_KMOD_DEP(net_iavf, "* igb_uio | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(net_iavf, "cap=dcf");
 RTE_LOG_REGISTER(iavf_logtype_init, pmd.net.iavf.init, NOTICE);
 RTE_LOG_REGISTER(iavf_logtype_driver, pmd.net.iavf.driver, NOTICE);
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(iavf_logtype_rx, pmd.net.iavf.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(iavf_logtype_tx, pmd.net.iavf.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-RTE_LOG_REGISTER(iavf_logtype_tx_free, pmd.net.iavf.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/iavf/iavf_log.h b/drivers/net/iavf/iavf_log.h
index 1088ec75f5..ff66ab0ccf 100644
--- a/drivers/net/iavf/iavf_log.h
+++ b/drivers/net/iavf/iavf_log.h
@@ -21,7 +21,7 @@ extern int iavf_logtype_driver;
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>")
 
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_rx,	\
@@ -30,7 +30,7 @@ extern int iavf_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, iavf_logtype_tx,	\
@@ -39,13 +39,4 @@ extern int iavf_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
-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
-
 #endif /* _IAVF_LOG_H_ */
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index caf14a2323..541b4446e8 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2004,9 +2004,9 @@ iavf_xmit_cleanup(struct iavf_tx_queue *txq)
 	if ((txd[desc_to_clean_to].cmd_type_offset_bsz &
 			rte_cpu_to_le_64(IAVF_TXD_QW1_DTYPE_MASK)) !=
 			rte_cpu_to_le_64(IAVF_TX_DESC_DTYPE_DESC_DONE)) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d)", desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d)", desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		return -1;
 	}
 
@@ -2360,7 +2360,7 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v6 6/8] net/ice: refine debug build option
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
                     ` (4 preceding siblings ...)
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 5/8] net/iavf: " Qi Zhang
@ 2021-03-31  9:52   ` Qi Zhang
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 7/8] net/ixgbe: " Qi Zhang
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-31  9:52 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_ICE_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_ICE_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ICE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_LIBRTE_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.c |  7 ++-----
 drivers/net/ice/ice_logs.h   | 13 ++-----------
 drivers/net/ice/ice_rxtx.c   | 20 ++++++++++----------
 3 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index f0dc543575..5082c227bf 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -5360,12 +5360,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ice,
 
 RTE_LOG_REGISTER(ice_logtype_init, pmd.net.ice.init, NOTICE);
 RTE_LOG_REGISTER(ice_logtype_driver, pmd.net.ice.driver, NOTICE);
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ice_logtype_rx, pmd.net.ice.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ice_logtype_tx, pmd.net.ice.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ice_logtype_tx_free, pmd.net.ice.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ice/ice_logs.h b/drivers/net/ice/ice_logs.h
index aab7da5f7b..e79980fb63 100644
--- a/drivers/net/ice/ice_logs.h
+++ b/drivers/net/ice/ice_logs.h
@@ -14,7 +14,7 @@ extern int ice_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_rx,	\
@@ -23,7 +23,7 @@ extern int ice_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ice_logtype_tx,	\
@@ -32,15 +32,6 @@ extern int ice_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_ICE_DEBUG_TX_FREE
-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
-
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ice_logtype_driver, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 530c206f4f..0827db9c9e 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2436,11 +2436,11 @@ ice_xmit_cleanup(struct ice_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	if (!(txd[desc_to_clean_to].cmd_type_offset_bsz &
 	    rte_cpu_to_le_64(ICE_TX_DESC_DTYPE_DESC_DONE))) {
-		PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done "
-				"(port=%d queue=%d) value=0x%"PRIx64"\n",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id,
-				txd[desc_to_clean_to].cmd_type_offset_bsz);
+		PMD_TX_LOG(DEBUG, "TX descriptor %4u is not done "
+			   "(port=%d queue=%d) value=0x%"PRIx64"\n",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id,
+			   txd[desc_to_clean_to].cmd_type_offset_bsz);
 		/* Failed to clean any descriptors */
 		return -1;
 	}
@@ -2731,10 +2731,10 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		/* set RS bit on the last descriptor of one packet */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			td_cmd |= ICE_TX_DESC_CMD_RS;
 
@@ -3243,7 +3243,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v6 7/8] net/ixgbe: refine debug build option
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
                     ` (5 preceding siblings ...)
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 6/8] net/ice: " Qi Zhang
@ 2021-03-31  9:52   ` Qi Zhang
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 8/8] net/igc: " Qi Zhang
  2021-04-01 14:11   ` [dpdk-dev] [PATCH v6 0/8] ether: " Ferruh Yigit
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-31  9:52 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IXGBE_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IXGBE_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_IXGBE_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG
   into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  7 +---
 drivers/net/ixgbe/ixgbe_logs.h   | 13 +------
 drivers/net/ixgbe/ixgbe_rxtx.c   | 64 ++++++++++++++++----------------
 3 files changed, 36 insertions(+), 48 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 31faff066c..2d308be48a 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -8452,12 +8452,9 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf,
 RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.init, NOTICE);
 RTE_LOG_REGISTER(ixgbe_logtype_driver, pmd.net.ixgbe.driver, NOTICE);
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 RTE_LOG_REGISTER(ixgbe_logtype_rx, pmd.net.ixgbe.rx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 RTE_LOG_REGISTER(ixgbe_logtype_tx, pmd.net.ixgbe.tx, DEBUG);
 #endif
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-RTE_LOG_REGISTER(ixgbe_logtype_tx_free, pmd.net.ixgbe.tx_free, DEBUG);
-#endif
diff --git a/drivers/net/ixgbe/ixgbe_logs.h b/drivers/net/ixgbe/ixgbe_logs.h
index 2a279d1098..00ef797ca1 100644
--- a/drivers/net/ixgbe/ixgbe_logs.h
+++ b/drivers/net/ixgbe/ixgbe_logs.h
@@ -12,7 +12,7 @@ extern int ixgbe_logtype_init;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx,	\
@@ -21,7 +21,7 @@ extern int ixgbe_logtype_rx;
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...)			\
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx,	\
@@ -30,15 +30,6 @@ extern int ixgbe_logtype_tx;
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE
-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)
-#endif
-
 extern int ixgbe_logtype_driver;
 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ixgbe_logtype_driver, "%s(): " fmt, \
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 7d23bab290..d69f36e977 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -583,11 +583,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 	desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
 	status = txr[desc_to_clean_to].wb.status;
 	if (!(status & rte_cpu_to_le_32(IXGBE_TXD_STAT_DD))) {
-		PMD_TX_FREE_LOG(DEBUG,
-				"TX descriptor %4u is not done"
-				"(port=%d queue=%d)",
-				desc_to_clean_to,
-				txq->port_id, txq->queue_id);
+		PMD_TX_LOG(DEBUG,
+			   "TX descriptor %4u is not done"
+			   "(port=%d queue=%d)",
+			   desc_to_clean_to,
+			   txq->port_id, txq->queue_id);
 		/* Failed to clean any descriptors, better luck next time */
 		return -(1);
 	}
@@ -600,11 +600,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
 		nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
 						last_desc_cleaned);
 
-	PMD_TX_FREE_LOG(DEBUG,
-			"Cleaning %4u TX descriptors: %4u to %4u "
-			"(port=%d queue=%d)",
-			nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
-			txq->port_id, txq->queue_id);
+	PMD_TX_LOG(DEBUG,
+		   "Cleaning %4u TX descriptors: %4u to %4u "
+		   "(port=%d queue=%d)",
+		   nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
+		   txq->port_id, txq->queue_id);
 
 	/*
 	 * The last descriptor to clean is done, so that means all the
@@ -750,12 +750,12 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		 * nb_used better be less than or equal to txq->tx_rs_thresh
 		 */
 		if (nb_used > txq->nb_tx_free) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Not enough free TX descriptors "
-					"nb_used=%4u nb_free=%4u "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Not enough free TX descriptors "
+				   "nb_used=%4u nb_free=%4u "
+				   "(port=%d queue=%d)",
+				   nb_used, txq->nb_tx_free,
+				   txq->port_id, txq->queue_id);
 
 			if (ixgbe_xmit_cleanup(txq) != 0) {
 				/* Could not clean any descriptors */
@@ -766,17 +766,17 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 			/* nb_used better be <= txq->tx_rs_thresh */
 			if (unlikely(nb_used > txq->tx_rs_thresh)) {
-				PMD_TX_FREE_LOG(DEBUG,
-					"The number of descriptors needed to "
-					"transmit the packet exceeds the "
-					"RS bit threshold. This will impact "
-					"performance."
-					"nb_used=%4u nb_free=%4u "
-					"tx_rs_thresh=%4u. "
-					"(port=%d queue=%d)",
-					nb_used, txq->nb_tx_free,
-					txq->tx_rs_thresh,
-					txq->port_id, txq->queue_id);
+				PMD_TX_LOG(DEBUG,
+					   "The number of descriptors needed to "
+					   "transmit the packet exceeds the "
+					   "RS bit threshold. This will impact "
+					   "performance."
+					   "nb_used=%4u nb_free=%4u "
+					   "tx_rs_thresh=%4u. "
+					   "(port=%d queue=%d)",
+					   nb_used, txq->nb_tx_free,
+					   txq->tx_rs_thresh,
+					   txq->port_id, txq->queue_id);
 				/*
 				 * Loop here until there are enough TX
 				 * descriptors or until the ring cannot be
@@ -920,10 +920,10 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* Set RS bit only on threshold packets' last descriptor */
 		if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-			PMD_TX_FREE_LOG(DEBUG,
-					"Setting RS bit on TXD id="
-					"%4u (port=%d queue=%d)",
-					tx_last, txq->port_id, txq->queue_id);
+			PMD_TX_LOG(DEBUG,
+				   "Setting RS bit on TXD id="
+				   "%4u (port=%d queue=%d)",
+				   tx_last, txq->port_id, txq->queue_id);
 
 			cmd_type_len |= IXGBE_TXD_CMD_RS;
 
@@ -995,7 +995,7 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* [dpdk-dev] [PATCH v6 8/8] net/igc: refine debug build option
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
                     ` (6 preceding siblings ...)
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 7/8] net/ixgbe: " Qi Zhang
@ 2021-03-31  9:52   ` Qi Zhang
  2021-04-01 14:11   ` [dpdk-dev] [PATCH v6 0/8] ether: " Ferruh Yigit
  8 siblings, 0 replies; 81+ messages in thread
From: Qi Zhang @ 2021-03-31  9:52 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang, Qi Zhang

1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/e1000/e1000_logs.c | 1 +
 drivers/net/igc/igc_logs.h     | 4 ++--
 drivers/net/igc/igc_txrx.c     | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
index 84ea0f9d4b..5835a0d62d 100644
--- a/drivers/net/e1000/e1000_logs.c
+++ b/drivers/net/e1000/e1000_logs.c
@@ -2,6 +2,7 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <rte_ethdev.h>
 #include "e1000_logs.h"
 
 /* declared as extern in e1000_logs.h */
diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 6457c4d180..11071a32b5 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -20,14 +20,14 @@ extern int igc_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index c0a5d5e84f..f092709c02 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -1434,7 +1434,7 @@ eth_igc_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;
-- 
2.26.2


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

* Re: [dpdk-dev] [PATCH v6 0/8] ether: refine debug build option
  2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
                     ` (7 preceding siblings ...)
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 8/8] net/igc: " Qi Zhang
@ 2021-04-01 14:11   ` Ferruh Yigit
  8 siblings, 0 replies; 81+ messages in thread
From: Ferruh Yigit @ 2021-04-01 14:11 UTC (permalink / raw)
  To: Qi Zhang
  Cc: dev, thomas, bruce.richardson, xiao.w.wang, jingjing.wu,
	beilei.xing, jia.guo, qiming.yang, haiyue.wang

On 3/31/2021 10:52 AM, Qi Zhang wrote:
> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
> data path debug code. As .config has been removed since the meson build,
> It is not friendly for new DPDK users to notice those debug options.
> 
> Patch 1/8: introduces new compile options for data path debug in ether
> layer, PMD can choose to reuse them to avoid maintain their own.
> 
> - RTE_ETHDEV_DEBUG_RX
> - RTE_ETHDEV_DEBUG_TX
> 
> The undocumented RTE_LIBRTE_ETHDEV_DEBUG will a alias to
> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
> compatibility.
> 
> Patch 2/8 - 8/8: refine the build option for Intel PMDs by using the
> new build options
> 
> v6:
> - fix build issue for -Dc_args="-DRTE_LIBRTE_ETHDEV_DEBUG=1"
> - s/compile/build/
> 
> v5:
> - Remove RTE_ETHDEV_DEBUG
> - Alias RTE_LIBRTE_ETHDEV_DEBUG to RTE_ETHDEV_DEBUG_RX|TX for backward
>    compatibility.
> 
> v4:
> - Alias RTE_LIBRTE_ETHDEV_DEBUG to RTE_ETHDEV_DEBUG in ethdev library
>    for backward compatibility.
> - Not replace RTE_LIBRTE_ETHDEV_DEBUG in all PMDs.
> 
> v3:
> - rename "RTE_LIBRTE_ETHDEV_xxx" to "RTE_ETHDEV_xxx"
> - move document from "overview.rst" page to "build_and_test.rst"
> - fix grammar issues.
> 
> v2:
> - fix some coding style issues.
> 
> 
> Qi Zhang (8):
>    ether: refine debug build option
>    net/fm10k: refine debug build option
>    net/e1000: refine debug build option
>    net/i40e: refine debug build option
>    net/iavf: refine debug build option
>    net/ice: refine debug build option
>    net/ixgbe: refine debug build option
>    net/igc: refine debug build option
> 

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

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

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

* Re: [dpdk-dev] [PATCH v6 1/8] ether: refine debug build option
  2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 1/8] " Qi Zhang
@ 2021-04-01 14:30     ` Ferruh Yigit
  2021-05-05 11:45       ` Ferruh Yigit
  0 siblings, 1 reply; 81+ messages in thread
From: Ferruh Yigit @ 2021-04-01 14:30 UTC (permalink / raw)
  To: Shahed Shaikh, Rasesh Mody, Devendra Singh Rawat, Igor Russkikh,
	Maxime Coquelin, Chenbo Xia, Stephen Hemminger, Long Li,
	Steven Webster, Matt Peters, Jerin Jacob, Maciej Czekaj,
	Yong Wang, Heinrich Kuhn, Shijith Thotton,
	Srisivasubramanian Srinivasan, Jiawen Wu, Jian Wang,
	Marcin Wojtas, Michal Krawczyk, Guy Tzalik, Evgeny Schemeilin,
	Igor Chauskin
  Cc: dev, thomas, bruce.richardson, Qi Zhang, Thomas Monjalon,
	Andrew Rybchenko

On 3/31/2021 10:52 AM, Qi Zhang wrote:
> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
> data path debug code. As .config has been removed since the meson build,
> It is not friendly for new DPDK users to notice those debug options.
> 
> The patch introduces below build options for data path debug, so PMD
> can choose to reuse them to avoid maintain their own.
> 
> - RTE_ETHDEV_DEBUG_RX
> - RTE_ETHDEV_DEBUG_TX
> 
> All the build options are documented at programming guide
> "3.1 Driver Option", so users can easily find them.
> 
> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
> compatibility.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>   doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
>   lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
>   2 files changed, 30 insertions(+), 8 deletions(-)
> 
> diff --git a/doc/guides/nics/build_and_test.rst b/doc/guides/nics/build_and_test.rst
> index e83dd4628c..e8b29c2277 100644
> --- a/doc/guides/nics/build_and_test.rst
> +++ b/doc/guides/nics/build_and_test.rst
> @@ -26,6 +26,22 @@ This will also build testpmd.
>   Detailed instructions are available
>   in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
>   
> +The ethdev layer supports below build options for debug purpose:
> +
> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
> +
> +  Build with debug code on Rx path.
> +
> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
> +
> +  Build with debug code on Tx path.
> +
> +.. Note::
> +
> +   The ethdev library use above options to wrap debug code to trace invalid parameters
> +   on data path APIs, so performance downgrade is expected when enabling those options.
> +   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.
> +

Following drivers are other users of the PMD specific compile flag for the Rx/Tx 
datapath debug logs [1], maintainers of those PMDs cc'ed, can you please plan 
switching to the RTE_ETHDEV_DEBUG_RX / RTE_ETHDEV_DEBUG_TX macros?

[1]:
- bnx2x:  RTE_LIBRTE_BNX2X_DEBUG_RX / RTE_LIBRTE_BNX2X_DEBUG_TX
- qede:   RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
- virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX / RTE_LIBRTE_VIRTIO_DEBUG_TX
- netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX / RTE_LIBRTE_NETVSC_DEBUG_TX
- avp:    RTE_LIBRTE_AVP_DEBUG_RX / RTE_LIBRTE_AVP_DEBUG_TX
- thunderx: RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX / 			
		RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX
- vmxnet3: RTE_LIBRTE_VMXNET3_DEBUG_RX / RTE_LIBRTE_VMXNET3_DEBUG_TX
- nfp:     RTE_LIBRTE_NFP_NET_DEBUG_RX / RTE_LIBRTE_NFP_NET_DEBUG_TX
- liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
- txgbe:   RTE_LIBRTE_TXGBE_DEBUG_RX / RTE_LIBRTE_TXGBE_DEBUG_TX
- ena:     RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX



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

* Re: [dpdk-dev] [PATCH v6 1/8] ether: refine debug build option
  2021-04-01 14:30     ` Ferruh Yigit
@ 2021-05-05 11:45       ` Ferruh Yigit
  2021-05-05 12:21         ` Michał Krawczyk
  0 siblings, 1 reply; 81+ messages in thread
From: Ferruh Yigit @ 2021-05-05 11:45 UTC (permalink / raw)
  To: Shahed Shaikh, Rasesh Mody, Devendra Singh Rawat, Igor Russkikh,
	Maxime Coquelin, Chenbo Xia, Stephen Hemminger, Long Li,
	Steven Webster, Matt Peters, Jerin Jacob, Maciej Czekaj,
	Yong Wang, Heinrich Kuhn, Shijith Thotton,
	Srisivasubramanian Srinivasan, Jiawen Wu, Jian Wang,
	Marcin Wojtas, Michal Krawczyk, Guy Tzalik, Evgeny Schemeilin,
	Igor Chauskin
  Cc: dev, thomas, bruce.richardson, Qi Zhang, Andrew Rybchenko

On 4/1/2021 3:30 PM, Ferruh Yigit wrote:
> On 3/31/2021 10:52 AM, Qi Zhang wrote:
>> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
>> data path debug code. As .config has been removed since the meson build,
>> It is not friendly for new DPDK users to notice those debug options.
>>
>> The patch introduces below build options for data path debug, so PMD
>> can choose to reuse them to avoid maintain their own.
>>
>> - RTE_ETHDEV_DEBUG_RX
>> - RTE_ETHDEV_DEBUG_TX
>>
>> All the build options are documented at programming guide
>> "3.1 Driver Option", so users can easily find them.
>>
>> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
>> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
>> compatibility.
>>
>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>> ---
>>   doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
>>   lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
>>   2 files changed, 30 insertions(+), 8 deletions(-)
>>
>> diff --git a/doc/guides/nics/build_and_test.rst
>> b/doc/guides/nics/build_and_test.rst
>> index e83dd4628c..e8b29c2277 100644
>> --- a/doc/guides/nics/build_and_test.rst
>> +++ b/doc/guides/nics/build_and_test.rst
>> @@ -26,6 +26,22 @@ This will also build testpmd.
>>   Detailed instructions are available
>>   in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
>>   +The ethdev layer supports below build options for debug purpose:
>> +
>> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
>> +
>> +  Build with debug code on Rx path.
>> +
>> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
>> +
>> +  Build with debug code on Tx path.
>> +
>> +.. Note::
>> +
>> +   The ethdev library use above options to wrap debug code to trace invalid
>> parameters
>> +   on data path APIs, so performance downgrade is expected when enabling
>> those options.
>> +   Each PMD can decide to reuse them to wrap their own debug code in the
>> Rx/Tx path.
>> +
> 
> Following drivers are other users of the PMD specific compile flag for the Rx/Tx
> datapath debug logs [1], maintainers of those PMDs cc'ed, can you please plan
> switching to the RTE_ETHDEV_DEBUG_RX / RTE_ETHDEV_DEBUG_TX macros?
> 
> [1]:
> - bnx2x:  RTE_LIBRTE_BNX2X_DEBUG_RX / RTE_LIBRTE_BNX2X_DEBUG_TX
> - qede:   RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
> - virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX / RTE_LIBRTE_VIRTIO_DEBUG_TX
> - netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX / RTE_LIBRTE_NETVSC_DEBUG_TX
> - avp:    RTE_LIBRTE_AVP_DEBUG_RX / RTE_LIBRTE_AVP_DEBUG_TX
> - thunderx: RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX /            
>         RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX
> - vmxnet3: RTE_LIBRTE_VMXNET3_DEBUG_RX / RTE_LIBRTE_VMXNET3_DEBUG_TX
> - nfp:     RTE_LIBRTE_NFP_NET_DEBUG_RX / RTE_LIBRTE_NFP_NET_DEBUG_TX
> - liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
> - txgbe:   RTE_LIBRTE_TXGBE_DEBUG_RX / RTE_LIBRTE_TXGBE_DEBUG_TX
> - ena:     RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX
> 
> 
Reminder of this one.

Can it be possible to schedule this task for v20.08?

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

* Re: [dpdk-dev] [PATCH v6 1/8] ether: refine debug build option
  2021-05-05 11:45       ` Ferruh Yigit
@ 2021-05-05 12:21         ` Michał Krawczyk
  2021-05-05 14:38           ` Ferruh Yigit
  0 siblings, 1 reply; 81+ messages in thread
From: Michał Krawczyk @ 2021-05-05 12:21 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Shahed Shaikh, Rasesh Mody, Devendra Singh Rawat, Igor Russkikh,
	Maxime Coquelin, Chenbo Xia, Stephen Hemminger, Long Li,
	Steven Webster, Matt Peters, Jerin Jacob, Maciej Czekaj,
	Yong Wang, Heinrich Kuhn, Shijith Thotton,
	Srisivasubramanian Srinivasan, Jiawen Wu, Jian Wang,
	Marcin Wojtas, Guy Tzalik, Evgeny Schemeilin, Igor Chauskin, dev,
	Thomas Monjalon, bruce.richardson, Qi Zhang, Andrew Rybchenko

śr., 5 maj 2021 o 13:45 Ferruh Yigit <ferruh.yigit@intel.com> napisał(a):
>
> On 4/1/2021 3:30 PM, Ferruh Yigit wrote:
> > On 3/31/2021 10:52 AM, Qi Zhang wrote:
> >> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
> >> data path debug code. As .config has been removed since the meson build,
> >> It is not friendly for new DPDK users to notice those debug options.
> >>
> >> The patch introduces below build options for data path debug, so PMD
> >> can choose to reuse them to avoid maintain their own.
> >>
> >> - RTE_ETHDEV_DEBUG_RX
> >> - RTE_ETHDEV_DEBUG_TX
> >>
> >> All the build options are documented at programming guide
> >> "3.1 Driver Option", so users can easily find them.
> >>
> >> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
> >> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
> >> compatibility.
> >>
> >> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> >> ---
> >>   doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
> >>   lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
> >>   2 files changed, 30 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/doc/guides/nics/build_and_test.rst
> >> b/doc/guides/nics/build_and_test.rst
> >> index e83dd4628c..e8b29c2277 100644
> >> --- a/doc/guides/nics/build_and_test.rst
> >> +++ b/doc/guides/nics/build_and_test.rst
> >> @@ -26,6 +26,22 @@ This will also build testpmd.
> >>   Detailed instructions are available
> >>   in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
> >>   +The ethdev layer supports below build options for debug purpose:
> >> +
> >> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
> >> +
> >> +  Build with debug code on Rx path.
> >> +
> >> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
> >> +
> >> +  Build with debug code on Tx path.
> >> +
> >> +.. Note::
> >> +
> >> +   The ethdev library use above options to wrap debug code to trace invalid
> >> parameters
> >> +   on data path APIs, so performance downgrade is expected when enabling
> >> those options.
> >> +   Each PMD can decide to reuse them to wrap their own debug code in the
> >> Rx/Tx path.
> >> +
> >
> > Following drivers are other users of the PMD specific compile flag for the Rx/Tx
> > datapath debug logs [1], maintainers of those PMDs cc'ed, can you please plan
> > switching to the RTE_ETHDEV_DEBUG_RX / RTE_ETHDEV_DEBUG_TX macros?
> >
> > [1]:
> > - bnx2x:  RTE_LIBRTE_BNX2X_DEBUG_RX / RTE_LIBRTE_BNX2X_DEBUG_TX
> > - qede:   RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
> > - virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX / RTE_LIBRTE_VIRTIO_DEBUG_TX
> > - netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX / RTE_LIBRTE_NETVSC_DEBUG_TX
> > - avp:    RTE_LIBRTE_AVP_DEBUG_RX / RTE_LIBRTE_AVP_DEBUG_TX
> > - thunderx: RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX /
> >         RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX
> > - vmxnet3: RTE_LIBRTE_VMXNET3_DEBUG_RX / RTE_LIBRTE_VMXNET3_DEBUG_TX
> > - nfp:     RTE_LIBRTE_NFP_NET_DEBUG_RX / RTE_LIBRTE_NFP_NET_DEBUG_TX
> > - liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
> > - txgbe:   RTE_LIBRTE_TXGBE_DEBUG_RX / RTE_LIBRTE_TXGBE_DEBUG_TX
> > - ena:     RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX
> >
> >
> Reminder of this one.
>
> Can it be possible to schedule this task for v20.08?

Hi Ferruh,

we'll schedule this task for v20.08 for the ENA PMD.

Thanks,
Michal

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

* Re: [dpdk-dev] [PATCH v6 1/8] ether: refine debug build option
  2021-05-05 12:21         ` Michał Krawczyk
@ 2021-05-05 14:38           ` Ferruh Yigit
  2021-05-06 11:09             ` [dpdk-dev] [EXT] " Rasesh Mody
  0 siblings, 1 reply; 81+ messages in thread
From: Ferruh Yigit @ 2021-05-05 14:38 UTC (permalink / raw)
  To: Michał Krawczyk
  Cc: Shahed Shaikh, Rasesh Mody, Devendra Singh Rawat, Igor Russkikh,
	Maxime Coquelin, Chenbo Xia, Stephen Hemminger, Long Li,
	Steven Webster, Matt Peters, Jerin Jacob, Maciej Czekaj,
	Yong Wang, Heinrich Kuhn, Shijith Thotton,
	Srisivasubramanian Srinivasan, Jiawen Wu, Jian Wang,
	Marcin Wojtas, Guy Tzalik, Evgeny Schemeilin, Igor Chauskin, dev,
	Thomas Monjalon, bruce.richardson, Qi Zhang, Andrew Rybchenko

On 5/5/2021 1:21 PM, Michał Krawczyk wrote:
> śr., 5 maj 2021 o 13:45 Ferruh Yigit <ferruh.yigit@intel.com> napisał(a):
>>
>> On 4/1/2021 3:30 PM, Ferruh Yigit wrote:
>>> On 3/31/2021 10:52 AM, Qi Zhang wrote:
>>>> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
>>>> data path debug code. As .config has been removed since the meson build,
>>>> It is not friendly for new DPDK users to notice those debug options.
>>>>
>>>> The patch introduces below build options for data path debug, so PMD
>>>> can choose to reuse them to avoid maintain their own.
>>>>
>>>> - RTE_ETHDEV_DEBUG_RX
>>>> - RTE_ETHDEV_DEBUG_TX
>>>>
>>>> All the build options are documented at programming guide
>>>> "3.1 Driver Option", so users can easily find them.
>>>>
>>>> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
>>>> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
>>>> compatibility.
>>>>
>>>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>>>> ---
>>>>   doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
>>>>   lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
>>>>   2 files changed, 30 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/doc/guides/nics/build_and_test.rst
>>>> b/doc/guides/nics/build_and_test.rst
>>>> index e83dd4628c..e8b29c2277 100644
>>>> --- a/doc/guides/nics/build_and_test.rst
>>>> +++ b/doc/guides/nics/build_and_test.rst
>>>> @@ -26,6 +26,22 @@ This will also build testpmd.
>>>>   Detailed instructions are available
>>>>   in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
>>>>   +The ethdev layer supports below build options for debug purpose:
>>>> +
>>>> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
>>>> +
>>>> +  Build with debug code on Rx path.
>>>> +
>>>> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
>>>> +
>>>> +  Build with debug code on Tx path.
>>>> +
>>>> +.. Note::
>>>> +
>>>> +   The ethdev library use above options to wrap debug code to trace invalid
>>>> parameters
>>>> +   on data path APIs, so performance downgrade is expected when enabling
>>>> those options.
>>>> +   Each PMD can decide to reuse them to wrap their own debug code in the
>>>> Rx/Tx path.
>>>> +
>>>
>>> Following drivers are other users of the PMD specific compile flag for the Rx/Tx
>>> datapath debug logs [1], maintainers of those PMDs cc'ed, can you please plan
>>> switching to the RTE_ETHDEV_DEBUG_RX / RTE_ETHDEV_DEBUG_TX macros?
>>>
>>> [1]:
>>> - bnx2x:  RTE_LIBRTE_BNX2X_DEBUG_RX / RTE_LIBRTE_BNX2X_DEBUG_TX
>>> - qede:   RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
>>> - virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX / RTE_LIBRTE_VIRTIO_DEBUG_TX
>>> - netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX / RTE_LIBRTE_NETVSC_DEBUG_TX
>>> - avp:    RTE_LIBRTE_AVP_DEBUG_RX / RTE_LIBRTE_AVP_DEBUG_TX
>>> - thunderx: RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX /
>>>         RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX
>>> - vmxnet3: RTE_LIBRTE_VMXNET3_DEBUG_RX / RTE_LIBRTE_VMXNET3_DEBUG_TX
>>> - nfp:     RTE_LIBRTE_NFP_NET_DEBUG_RX / RTE_LIBRTE_NFP_NET_DEBUG_TX
>>> - liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
>>> - txgbe:   RTE_LIBRTE_TXGBE_DEBUG_RX / RTE_LIBRTE_TXGBE_DEBUG_TX
>>> - ena:     RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX
>>>
>>>
>> Reminder of this one.
>>
>> Can it be possible to schedule this task for v20.08?
> 
> Hi Ferruh,
> 
> we'll schedule this task for v20.08 for the ENA PMD.
> 

Oops, I mean v21.08 obviously.


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

* Re: [dpdk-dev] [EXT] Re: [PATCH v6 1/8] ether: refine debug build option
  2021-05-05 14:38           ` Ferruh Yigit
@ 2021-05-06 11:09             ` Rasesh Mody
  0 siblings, 0 replies; 81+ messages in thread
From: Rasesh Mody @ 2021-05-06 11:09 UTC (permalink / raw)
  To: Ferruh Yigit, Michał Krawczyk
  Cc: Shahed Shaikh, Devendra Singh Rawat, Igor Russkikh,
	Maxime Coquelin, Chenbo Xia, Stephen Hemminger, Long Li,
	Steven Webster, Matt Peters, Jerin Jacob Kollanukkaran,
	Maciej Czekaj [C],
	Yong Wang, Heinrich Kuhn, Shijith Thotton,
	Srisivasubramanian Srinivasan, Jiawen Wu, Jian Wang,
	Marcin Wojtas, Guy Tzalik, Evgeny Schemeilin, Igor Chauskin, dev,
	Thomas Monjalon, bruce.richardson, Qi Zhang, Andrew Rybchenko

> From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
> Sent: Wednesday, May 5, 2021 8:09 PM
> 
> On 5/5/2021 1:21 PM, Michał Krawczyk wrote:
> > śr., 5 maj 2021 o 13:45 Ferruh Yigit <ferruh.yigit@intel.com> napisał(a):
> >>
> >> On 4/1/2021 3:30 PM, Ferruh Yigit wrote:
> >>> On 3/31/2021 10:52 AM, Qi Zhang wrote:
> >>>> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option
> to wrap
> >>>> data path debug code. As .config has been removed since the meson
> >>>> build, It is not friendly for new DPDK users to notice those debug
> options.
> >>>>
> >>>> The patch introduces below build options for data path debug, so
> >>>> PMD can choose to reuse them to avoid maintain their own.
> >>>>
> >>>> - RTE_ETHDEV_DEBUG_RX
> >>>> - RTE_ETHDEV_DEBUG_TX
> >>>>
> >>>> All the build options are documented at programming guide
> >>>> "3.1 Driver Option", so users can easily find them.
> >>>>
> >>>> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
> >>>> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for
> backward
> >>>> compatibility.
> >>>>
> >>>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> >>>> ---
> >>>>   doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
> >>>>   lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
> >>>>   2 files changed, 30 insertions(+), 8 deletions(-)
> >>>>
> >>>> diff --git a/doc/guides/nics/build_and_test.rst
> >>>> b/doc/guides/nics/build_and_test.rst
> >>>> index e83dd4628c..e8b29c2277 100644
> >>>> --- a/doc/guides/nics/build_and_test.rst
> >>>> +++ b/doc/guides/nics/build_and_test.rst
> >>>> @@ -26,6 +26,22 @@ This will also build testpmd.
> >>>>   Detailed instructions are available
> >>>>   in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
> >>>>   +The ethdev layer supports below build options for debug purpose:
> >>>> +
> >>>> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
> >>>> +
> >>>> +  Build with debug code on Rx path.
> >>>> +
> >>>> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
> >>>> +
> >>>> +  Build with debug code on Tx path.
> >>>> +
> >>>> +.. Note::
> >>>> +
> >>>> +   The ethdev library use above options to wrap debug code to
> >>>> + trace invalid
> >>>> parameters
> >>>> +   on data path APIs, so performance downgrade is expected when
> >>>> + enabling
> >>>> those options.
> >>>> +   Each PMD can decide to reuse them to wrap their own debug code
> >>>> + in the
> >>>> Rx/Tx path.
> >>>> +
> >>>
> >>> Following drivers are other users of the PMD specific compile flag
> >>> for the Rx/Tx datapath debug logs [1], maintainers of those PMDs
> >>> cc'ed, can you please plan switching to the RTE_ETHDEV_DEBUG_RX /
> RTE_ETHDEV_DEBUG_TX macros?
> >>>
> >>> [1]:
> >>> - bnx2x:  RTE_LIBRTE_BNX2X_DEBUG_RX /
> RTE_LIBRTE_BNX2X_DEBUG_TX
> >>> - qede:   RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
> >>> - virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX /
> RTE_LIBRTE_VIRTIO_DEBUG_TX
> >>> - netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX /
> RTE_LIBRTE_NETVSC_DEBUG_TX
> >>> - avp:    RTE_LIBRTE_AVP_DEBUG_RX / RTE_LIBRTE_AVP_DEBUG_TX
> >>> - thunderx: RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX /
> >>>         RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX
> >>> - vmxnet3: RTE_LIBRTE_VMXNET3_DEBUG_RX /
> RTE_LIBRTE_VMXNET3_DEBUG_TX
> >>> - nfp:     RTE_LIBRTE_NFP_NET_DEBUG_RX /
> RTE_LIBRTE_NFP_NET_DEBUG_TX
> >>> - liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
> >>> - txgbe:   RTE_LIBRTE_TXGBE_DEBUG_RX /
> RTE_LIBRTE_TXGBE_DEBUG_TX
> >>> - ena:     RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX
> >>>
> >>>
> >> Reminder of this one.
> >>
> >> Can it be possible to schedule this task for v20.08?
> >
> > Hi Ferruh,
> >
> > we'll schedule this task for v20.08 for the ENA PMD.
> >
> 
> Oops, I mean v21.08 obviously.
>

Hi Ferruh,
For bnx2x and qede PMD, we can schedule this for v21.08.
Thanks,
Rasesh


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

end of thread, other threads:[~2021-05-06 11:09 UTC | newest]

Thread overview: 81+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 12:16 [dpdk-dev] [PATCH 0/8] ether: refine debug compile option Qi Zhang
2021-03-10 12:16 ` [dpdk-dev] [PATCH 1/8] " Qi Zhang
2021-03-10 12:16 ` [dpdk-dev] [PATCH 2/8] net/fm10k: " Qi Zhang
2021-03-10 12:16 ` [dpdk-dev] [PATCH 3/8] net/e1000: " Qi Zhang
2021-03-10 12:16 ` [dpdk-dev] [PATCH 4/8] net/i40e: " Qi Zhang
2021-03-10 12:16 ` [dpdk-dev] [PATCH 5/8] net/iavf: " Qi Zhang
2021-03-10 12:16 ` [dpdk-dev] [PATCH 6/8] net/ice: " Qi Zhang
2021-03-10 12:16 ` [dpdk-dev] [PATCH 7/8] net/ixgbe: " Qi Zhang
2021-03-10 12:16 ` [dpdk-dev] [PATCH 8/8] net/igc: " Qi Zhang
2021-03-10 12:35 ` [dpdk-dev] [PATCH 0/8] ether: " Ferruh Yigit
2021-03-12 12:12 ` [dpdk-dev] [PATCH v2 " Qi Zhang
2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 1/8] " Qi Zhang
2021-03-16 13:05     ` Ferruh Yigit
2021-03-16 13:39       ` Thomas Monjalon
2021-03-16 14:12         ` Bruce Richardson
2021-03-16 23:29           ` Zhang, Qi Z
2021-03-16 16:37         ` Ferruh Yigit
2021-03-22 17:24           ` Ferruh Yigit
2021-03-23  8:43             ` Zhang, Qi Z
2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 2/8] net/fm10k: " Qi Zhang
2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 3/8] net/e1000: " Qi Zhang
2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 4/8] net/i40e: " Qi Zhang
2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 5/8] net/iavf: " Qi Zhang
2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 6/8] net/ice: " Qi Zhang
2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 7/8] net/ixgbe: " Qi Zhang
2021-03-12 12:12   ` [dpdk-dev] [PATCH v2 8/8] net/igc: " Qi Zhang
2021-03-17 11:15 ` [dpdk-dev] [PATCH v3 0/9] ether: refine debug build option Qi Zhang
2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 1/9] " Qi Zhang
2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 2/9] net: replace " Qi Zhang
2021-03-17 21:47     ` Ferruh Yigit
2021-03-17 22:00       ` Thomas Monjalon
2021-03-18  0:58         ` Zhang, Qi Z
2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 3/9] net/fm10k: refine debug " Qi Zhang
2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 4/9] net/e1000: " Qi Zhang
2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 5/9] net/i40e: " Qi Zhang
2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 6/9] net/iavf: " Qi Zhang
2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 7/9] net/ice: " Qi Zhang
2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 8/9] net/ixgbe: " Qi Zhang
2021-03-17 11:15   ` [dpdk-dev] [PATCH v3 9/9] net/igc: " Qi Zhang
2021-03-18  1:42 ` [dpdk-dev] [PATCH v4 0/8] ether: " Qi Zhang
2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 1/8] " Qi Zhang
2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 2/8] net/fm10k: " Qi Zhang
2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 3/8] net/e1000: " Qi Zhang
2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 4/8] net/i40e: " Qi Zhang
2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 5/8] net/iavf: " Qi Zhang
2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 6/8] net/ice: " Qi Zhang
2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 7/8] net/ixgbe: " Qi Zhang
2021-03-18  1:42   ` [dpdk-dev] [PATCH v4 8/8] net/igc: " Qi Zhang
2021-03-23 11:07 ` [dpdk-dev] [PATCH v5 0/8] ether: " Qi Zhang
2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 1/8] " Qi Zhang
2021-03-23 14:44     ` Ferruh Yigit
2021-03-23 21:14     ` Thomas Monjalon
2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 2/8] net/fm10k: " Qi Zhang
2021-03-23 14:45     ` Ferruh Yigit
2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 3/8] net/e1000: " Qi Zhang
2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 4/8] net/i40e: " Qi Zhang
2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 5/8] net/iavf: " Qi Zhang
2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 6/8] net/ice: " Qi Zhang
2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 7/8] net/ixgbe: " Qi Zhang
2021-03-23 11:07   ` [dpdk-dev] [PATCH v5 8/8] net/igc: " Qi Zhang
2021-03-24 19:27     ` Ferruh Yigit
2021-03-24 20:31       ` David Marchand
2021-03-25 15:43         ` Ferruh Yigit
2021-03-30 14:06           ` Ferruh Yigit
2021-03-23 11:08   ` [dpdk-dev] [PATCH v5 0/8] ether: " Zhang, Qi Z
2021-03-23 14:47   ` Ferruh Yigit
2021-03-31  9:52 ` [dpdk-dev] [PATCH v6 " Qi Zhang
2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 1/8] " Qi Zhang
2021-04-01 14:30     ` Ferruh Yigit
2021-05-05 11:45       ` Ferruh Yigit
2021-05-05 12:21         ` Michał Krawczyk
2021-05-05 14:38           ` Ferruh Yigit
2021-05-06 11:09             ` [dpdk-dev] [EXT] " Rasesh Mody
2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 2/8] net/fm10k: " Qi Zhang
2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 3/8] net/e1000: " Qi Zhang
2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 4/8] net/i40e: " Qi Zhang
2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 5/8] net/iavf: " Qi Zhang
2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 6/8] net/ice: " Qi Zhang
2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 7/8] net/ixgbe: " Qi Zhang
2021-03-31  9:52   ` [dpdk-dev] [PATCH v6 8/8] net/igc: " Qi Zhang
2021-04-01 14:11   ` [dpdk-dev] [PATCH v6 0/8] ether: " Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git