Skip to contentSkip to conversation

ether: refine debug compile option

PATCH Superseded Qi Zhang 7 participants 81 messages Mar 10, 2021 – May 6, 2021

Subsystems (2)
lore
Share & tools
lore

Qi Zhang

author
#0 lore raw

cover ether: refine debug compile option

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(-)
Signature · 1 line
2.26.2
author
#1 lore raw

PATCH 1/8 ether: refine debug compile option

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.

---
 doc/guides/nics/overview.rst   | 20 ++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h | 16 ++++++++--------
 2 files changed, 28 insertions(+), 8 deletions(-)
doc/guides/nics/overview.rst +20 -0
index 20cd52b097..20cf54ef32 100644
@@ -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.
lib/librte_ethdev/rte_ethdev.h +8 -8
index 059a061072..335831129f 100644
@@ -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;
Signature · 1 line
2.26.2
author
#2 lore raw

PATCH 2/8 net/fm10k: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/fm10k/fm10k_ethdev.c +2 -5
index fd471c415e..c6c6b0d111 100644
@@ -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
drivers/net/fm10k/fm10k_logs.h +2 -11
index 9ae743d806..36ada34d8f 100644
@@ -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, \
drivers/net/fm10k/fm10k_rxtx.c +4 -4
index 8585c5b9e4..ac9a35d6c3 100644
@@ -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;
Signature · 1 line
2.26.2
author
#3 lore raw

PATCH 3/8 net/e1000: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/e1000/e1000_logs.c +4 -13
index 231f5c03ef..f4b5a545f6 100644
@@ -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;
 }
drivers/net/e1000/e1000_logs.h +2 -11
index 2612134f38..c989033392 100644
@@ -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, \
drivers/net/e1000/em_rxtx.c +19 -19
index db5d1222ce..47a02b6cf4 100644
@@ -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;
drivers/net/e1000/igb_rxtx.c +1 -1
index 1500d2ffff..5749650f95 100644
@@ -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;
Signature · 1 line
2.26.2
author
#4 lore raw

PATCH 4/8 net/i40e: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/i40e/i40e_ethdev.c +2 -5
index d7cd049891..afd88c36d2 100644
@@ -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"
drivers/net/i40e/i40e_logs.h +2 -11
index dac3267eb4..e747fa8681 100644
@@ -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, \
drivers/net/i40e/i40e_rxtx.c +8 -8
index 61cb204be2..e5eecf03de 100644
@@ -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;
Signature · 1 line
2.26.2
author
#5 lore raw

PATCH 5/8 net/iavf: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/iavf/iavf_ethdev.c +2 -5
index 4d37722022..863160135f 100644
@@ -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
drivers/net/iavf/iavf_log.h +2 -11
index 1088ec75f5..c83f09cc25 100644
@@ -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_ */
drivers/net/iavf/iavf_rxtx.c +4 -4
index 8fafe4579b..c4611c0431 100644
@@ -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;
Signature · 1 line
2.26.2
author
#6 lore raw

PATCH 6/8 net/ice: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/ice/ice_ethdev.c +2 -5
index 8999d441ac..3de7e513f9 100644
@@ -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
drivers/net/ice/ice_logs.h +2 -11
index aab7da5f7b..8e2463b69f 100644
@@ -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)
drivers/net/ice/ice_rxtx.c +10 -10
index 530c206f4f..74fbd46f47 100644
@@ -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;
Signature · 1 line
2.26.2
author
#7 lore raw

PATCH 7/8 net/ixgbe: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -5
index 761a0f26bb..f48db42c0d 100644
@@ -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
drivers/net/ixgbe/ixgbe_logs.h +2 -11
index 2a279d1098..983adeffe0 100644
@@ -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, \
drivers/net/ixgbe/ixgbe_rxtx.c +32 -32

100 lines not on this page · raw message

Signature · 1 line
2.26.2
author
#8 lore raw

PATCH 8/8 net/igc: refine debug compile option

In reply to 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

---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/igc/igc_logs.h +2 -2
index 6457c4d180..a67a79b900 100644
@@ -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
drivers/net/igc/igc_txrx.c +1 -1
index c0a5d5e84f..2c632786b9 100644
@@ -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;
Signature · 1 line
2.26.2
#9 lore raw
In reply to Qi Zhang
Quoted 11 lines · 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

+1 to have common flag and documentation

Quoted 11 lines

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

<...>

author
#10 lore raw

v2 cover ether: refine debug compile option

In reply to 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(-)
Signature · 1 line
2.26.2
author
#11 lore raw

PATCH v2 1/8 ether: refine debug compile option

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.

---
 doc/guides/nics/overview.rst   | 20 ++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h | 16 ++++++++--------
 2 files changed, 28 insertions(+), 8 deletions(-)
doc/guides/nics/overview.rst +20 -0
index 20cd52b097..20cf54ef32 100644
@@ -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.
lib/librte_ethdev/rte_ethdev.h +8 -8
index 059a061072..e4352c0c32 100644
@@ -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;
Signature · 1 line
2.26.2
#12 lore raw
Quoted 37 lines · 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.

---
  doc/guides/nics/overview.rst   | 20 ++++++++++++++++++++
  lib/librte_ethdev/rte_ethdev.h | 16 ++++++++--------
  2 files changed, 28 insertions(+), 8 deletions(-)
doc/guides/nics/overview.rst +10 -0
index 20cd52b097..20cf54ef32 100644
@@ -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.

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 54

Quoted 10 lines
doc/guides/nics/overview.rst +10 -0
+
+- ``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"?

#13 lore raw

16/03/2021 14:05, Ferruh Yigit:

Quoted 5 lines · Qi Zhang
Quoted 4 lines

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.

Quoted 8 lines
Quoted 8 lines

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

Quoted 4 lines

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 32

Quoted 4 lines
doc/guides/nics/overview.rst +1 -0
@@ -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/

Quoted 4 lines

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 40

Quoted 4 lines
doc/guides/nics/overview.rst +4 -0
+
+- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
+
+  Compile with debug code on data path.

What is data path if not Rx or Tx?

Quoted 8 lines

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 48

Quoted 8 lines
doc/guides/nics/overview.rst +8 -0
+
+- ``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.

Quoted 4 lines

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 52

Quoted 4 lines
doc/guides/nics/overview.rst +4 -0
+
+.. Note::
+
+   The lib_ethdev use above options to wrap debug code to trace invalid parameters on

s/lib_ethdev/ethdev library/

Quoted 1 line

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 53

Quoted 1 line
doc/guides/nics/overview.rst +1 -0
+   data path APIs, so performance downgrade is expected when enable those options.

s/enable/enabling/

Quoted 1 line

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 54

Quoted 1 line
doc/guides/nics/overview.rst +1 -0
+   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.

Quoted 3 lines

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

#14 lore raw
Quoted 12 lines · Thomas Monjalon

16/03/2021 14:05, Ferruh Yigit:

Quoted 11 lines · Qi Zhang
Quoted 10 lines

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

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

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

#15 lore raw
Quoted 33 lines

-----Original Message-----
From: Richardson, Bruce <[email protected]>
Sent: Tuesday, March 16, 2021 10:13 PM
To: Thomas Monjalon <[email protected]>
Cc: Zhang, Qi Z <[email protected]>; Andrew Rybchenko <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; Wang, Xiao W <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Yang, Qiming <[email protected]>; Wang, Haiyue <[email protected]>
Subject: Re: [PATCH v2 1/8] ether: refine debug compile option

Quoted 3 lines · Thomas Monjalon

16/03/2021 14:05, Ferruh Yigit:

Quoted 2 lines · Qi Zhang
Quoted 1 line

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option

to

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

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.

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

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

Quoted 8 lines
Quoted 4 lines

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!

#16 lore raw
In reply to Thomas Monjalon
Quoted 14 lines · Thomas Monjalon

16/03/2021 14:05, Ferruh Yigit:

Quoted 13 lines · Qi Zhang
Quoted 12 lines

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.

<...>

Quoted 7 lines
Quoted 4 lines

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 40

Quoted 4 lines
doc/guides/nics/overview.rst +4 -0
+
+- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
+
+  Compile with debug code on data path.

What is data path if not Rx or Tx?

Quoted 11 lines
Quoted 8 lines

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 48

Quoted 8 lines
doc/guides/nics/overview.rst +8 -0
+
+- ``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.

#17 lore raw
Quoted 38 lines · Ferruh Yigit
Quoted 14 lines · Thomas Monjalon

16/03/2021 14:05, Ferruh Yigit:

Quoted 13 lines · Qi Zhang
Quoted 12 lines

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.

<...>

Quoted 7 lines
Quoted 4 lines

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 40

Quoted 4 lines
doc/guides/nics/overview.rst +4 -0
+
+- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
+
+  Compile with debug code on data path.

What is data path if not Rx or Tx?

Quoted 11 lines
Quoted 8 lines

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 48

Quoted 8 lines
doc/guides/nics/overview.rst +8 -0
+
+- ``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.

Quoted 8 lines

'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?

#18 lore raw
Quoted 65 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Tuesday, March 23, 2021 1:24 AM
To: Thomas Monjalon <[email protected]>; Zhang, Qi Z <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; Wang, Xiao W <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Yang, Qiming <[email protected]>; Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2 1/8] ether: refine debug compile option

Quoted 4 lines · Ferruh Yigit
Quoted 3 lines · Thomas Monjalon

16/03/2021 14:05, Ferruh Yigit:

Quoted 2 lines · Qi Zhang
Quoted 1 line

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as compile option

to

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

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.

Quoted 39 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

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

<...>

Quoted 7 lines
Quoted 4 lines

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 40

Quoted 4 lines
doc/guides/nics/overview.rst +4 -0
+
+- ``RTE_LIBRTE_ETHDEV_DEBUG`` (default **disabled**)
+
+  Compile with debug code on data path.

What is data path if not Rx or Tx?

Quoted 11 lines
Quoted 8 lines

doc/guides/nics/overview.rst More details about features can be found in :doc:`features`. · line 48

Quoted 8 lines
doc/guides/nics/overview.rst +8 -0
+
+- ``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.

Quoted 7 lines
Quoted 2 lines

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

author
#19 lore raw

PATCH v2 2/8 net/fm10k: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/fm10k/fm10k_ethdev.c +2 -5
index fd471c415e..c6c6b0d111 100644
@@ -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
drivers/net/fm10k/fm10k_logs.h +2 -11
index 9ae743d806..36ada34d8f 100644
@@ -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, \
drivers/net/fm10k/fm10k_rxtx.c +4 -4
index 8585c5b9e4..ac9a35d6c3 100644
@@ -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;
Signature · 1 line
2.26.2
author
#20 lore raw

PATCH v2 3/8 net/e1000: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/e1000/e1000_logs.c +4 -13
index 231f5c03ef..f4b5a545f6 100644
@@ -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;
 }
drivers/net/e1000/e1000_logs.h +2 -11
index 2612134f38..c989033392 100644
@@ -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, \
drivers/net/e1000/em_rxtx.c +19 -19
index db5d1222ce..47a02b6cf4 100644
@@ -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;
drivers/net/e1000/igb_rxtx.c +1 -1
index 1500d2ffff..5749650f95 100644
@@ -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;
Signature · 1 line
2.26.2
author
#21 lore raw

PATCH v2 4/8 net/i40e: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/i40e/i40e_ethdev.c +2 -5
index d7cd049891..afd88c36d2 100644
@@ -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"
drivers/net/i40e/i40e_logs.h +2 -11
index dac3267eb4..e747fa8681 100644
@@ -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, \
drivers/net/i40e/i40e_rxtx.c +8 -8
index 61cb204be2..e5eecf03de 100644
@@ -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;
Signature · 1 line
2.26.2
author
#22 lore raw

PATCH v2 5/8 net/iavf: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/iavf/iavf_ethdev.c +2 -5
index 4d37722022..863160135f 100644
@@ -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
drivers/net/iavf/iavf_log.h +2 -11
index 1088ec75f5..c83f09cc25 100644
@@ -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_ */
drivers/net/iavf/iavf_rxtx.c +4 -4
index 8fafe4579b..c4611c0431 100644
@@ -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;
Signature · 1 line
2.26.2
author
#23 lore raw

PATCH v2 6/8 net/ice: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/ice/ice_ethdev.c +2 -5
index 8999d441ac..3de7e513f9 100644
@@ -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
drivers/net/ice/ice_logs.h +2 -11
index aab7da5f7b..8e2463b69f 100644
@@ -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)
drivers/net/ice/ice_rxtx.c +10 -10
index 530c206f4f..74fbd46f47 100644
@@ -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;
Signature · 1 line
2.26.2
author
#24 lore raw

PATCH v2 7/8 net/ixgbe: refine debug compile option

In reply to 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

---
 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(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -5
index 761a0f26bb..f48db42c0d 100644
@@ -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
drivers/net/ixgbe/ixgbe_logs.h +2 -11
index 2a279d1098..983adeffe0 100644
@@ -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, \
drivers/net/ixgbe/ixgbe_rxtx.c +32 -32

100 lines not on this page · raw message

Signature · 1 line
2.26.2
author
#25 lore raw

PATCH v2 8/8 net/igc: refine debug compile option

In reply to 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

---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/igc/igc_logs.h +2 -2
index 6457c4d180..a67a79b900 100644
@@ -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
drivers/net/igc/igc_txrx.c +1 -1
index c0a5d5e84f..2c632786b9 100644
@@ -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;
Signature · 1 line
2.26.2
author
#26 lore raw

v3 cover ether: refine debug build option

In reply to 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(-)
Signature · 1 line
2.26.2
author
#27 lore raw

PATCH v3 1/9 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.

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.

---
 doc/guides/nics/build_and_test.rst | 20 ++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h     | 16 ++++++++--------
 2 files changed, 28 insertions(+), 8 deletions(-)
doc/guides/nics/build_and_test.rst +20 -0
index e83dd4628c..4d7f10f6b0 100644
@@ -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
 ------------------------
 
lib/librte_ethdev/rte_ethdev.h +8 -8
index 059a061072..a80f96a37d 100644
@@ -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;
Signature · 1 line
2.26.2
author
#28 lore raw

PATCH v3 2/9 net: replace build option

In reply to Qi Zhang

Replace RTE_LIBRTE_ETHDEV_DEBUG with RTE_ETHDEV_DEBUG.

---
 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(-)
drivers/net/ark/ark_logs.h +1 -1
index ca46d86c99..1043e85b07 100644
@@ -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
drivers/net/atlantic/atl_rxtx.c +1 -1
index 7d367c9306..2d75536d6f 100644
@@ -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;
drivers/net/e1000/em_rxtx.c +1 -1
index db5d1222ce..dc8cc3a22e 100644
@@ -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;
drivers/net/e1000/igb_rxtx.c +1 -1
index 1500d2ffff..4ab94dfeac 100644
@@ -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;
drivers/net/ena/ena_ethdev.c +1 -1
index 9aa51c9dcf..0086ff6828 100644
@@ -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;
drivers/net/enic/enic_rxtx.c +1 -1
index a2a02227e3..90c147ab4c 100644
@@ -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;
drivers/net/fm10k/fm10k_rxtx.c +1 -1
index 8585c5b9e4..fbf07bc225 100644
@@ -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;
drivers/net/hinic/hinic_pmd_tx.c +1 -1
index 669f82389c..c8ab9831cd 100644
@@ -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
drivers/net/hns3/hns3_rxtx.c +2 -2
index 00167c4bd5..be0ae045bf 100644
@@ -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;
drivers/net/i40e/i40e_rxtx.c +1 -1
index 61cb204be2..4c0f558195 100644
@@ -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;
drivers/net/iavf/iavf_rxtx.c +1 -1
index 8fafe4579b..69d83dbbfc 100644
@@ -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;
drivers/net/ice/ice_rxtx.c +1 -1
index 530c206f4f..8785baa71a 100644
@@ -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;
drivers/net/igc/igc_txrx.c +1 -1
index c0a5d5e84f..21a658861c 100644
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
index 7d23bab290..78a66a554b 100644
@@ -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;
drivers/net/qede/qede_rxtx.c +2 -2
index 87f52d7254..9fb8da3948 100644
@@ -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;
drivers/net/softnic/rte_eth_softnic.c +1 -1
index 99d8468c94..6e6dad199c 100644
@@ -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
 
drivers/net/softnic/rte_eth_softnic_thread.c +1 -1
index a8c26a5b23..ec5e0feca5 100644
@@ -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
 
drivers/net/txgbe/txgbe_rxtx.c +1 -1
index a70bf0b9c6..3bac2a136d 100644
@@ -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;
drivers/net/virtio/virtio_rxtx.c +1 -1
index 40283001b0..77183e6968 100644
@@ -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;
drivers/net/vmxnet3/vmxnet3_rxtx.c +1 -1
index 5cf53d4de8..c2af0d877c 100644
@@ -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;
Signature · 1 line
2.26.2
#29 lore raw

Re: [dpdk-dev] [PATCH v3 2/9] net: replace build option

Quoted 3 lines · Qi Zhang

Replace RTE_LIBRTE_ETHDEV_DEBUG with RTE_ETHDEV_DEBUG.

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?

#30 lore raw

Re: [dpdk-dev] [PATCH v3 2/9] net: replace build option

17/03/2021 22:47, Ferruh Yigit:

Quoted 10 lines · Qi Zhang
Quoted 3 lines

Replace RTE_LIBRTE_ETHDEV_DEBUG with RTE_ETHDEV_DEBUG.

Hi Qi, Thomas,

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

Quoted 6 lines

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

#31 lore raw

Re: [dpdk-dev] [PATCH v3 2/9] net: replace build option

Quoted 28 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, March 18, 2021 6:01 AM
To: Zhang, Qi Z <[email protected]>; Andrew Rybchenko <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Richardson, Bruce <[email protected]>; Wang, Xiao W <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Yang, Qiming <[email protected]>; Wang, Haiyue <[email protected]>
Subject: Re: [PATCH v3 2/9] net: replace build option

17/03/2021 22:47, Ferruh Yigit:

Quoted 5 lines · Qi Zhang
Quoted 3 lines

Replace RTE_LIBRTE_ETHDEV_DEBUG with RTE_ETHDEV_DEBUG.

Quoted 7 lines

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.

Quoted 1 line
Quoted 7 lines
Quoted 3 lines

'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

Quoted 1 line
author
#32 lore raw

PATCH v3 3/9 net/fm10k: refine debug build option

In reply to 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

---
 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(-)
drivers/net/fm10k/fm10k_ethdev.c +2 -5
index fd471c415e..0a557acbef 100644
@@ -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
drivers/net/fm10k/fm10k_logs.h +2 -11
index 9ae743d806..4f039f8beb 100644
@@ -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, \
drivers/net/fm10k/fm10k_rxtx.c +4 -4
index fbf07bc225..0a9a27aa5a 100644
@@ -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;
Signature · 1 line
2.26.2
author
#33 lore raw

PATCH v3 4/9 net/e1000: refine debug build option

In reply to 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

---
 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(-)
drivers/net/e1000/e1000_logs.c +4 -13
index 231f5c03ef..84ea0f9d4b 100644
@@ -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;
 }
drivers/net/e1000/e1000_logs.h +2 -11
index 2612134f38..86f546b0f9 100644
@@ -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, \
drivers/net/e1000/em_rxtx.c +19 -19
index dc8cc3a22e..dfd8f2fd00 100644
@@ -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;
drivers/net/e1000/igb_rxtx.c +1 -1
index 4ab94dfeac..45da4ed9d2 100644
@@ -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;
Signature · 1 line
2.26.2
author
#34 lore raw

PATCH v3 5/9 net/i40e: refine debug build option

In reply to 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

---
 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(-)
drivers/net/i40e/i40e_ethdev.c +2 -5
index d7cd049891..e529ca0998 100644
@@ -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"
drivers/net/i40e/i40e_logs.h +2 -11
index dac3267eb4..eebe6c5559 100644
@@ -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, \
drivers/net/i40e/i40e_rxtx.c +8 -8
index 4c0f558195..3c7686c3f4 100644
@@ -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;
Signature · 1 line
2.26.2
author
#35 lore raw

PATCH v3 6/9 net/iavf: refine debug build option

In reply to 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

---
 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(-)
drivers/net/iavf/iavf_ethdev.c +2 -5
index 4d37722022..86bc5fcf3f 100644
@@ -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
drivers/net/iavf/iavf_log.h +2 -11
index 1088ec75f5..ff66ab0ccf 100644
@@ -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_ */
drivers/net/iavf/iavf_rxtx.c +4 -4
index 69d83dbbfc..84df0989af 100644
@@ -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;
Signature · 1 line
2.26.2
author
#36 lore raw

PATCH v3 7/9 net/ice: refine debug build option

In reply to 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

---
 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(-)
drivers/net/ice/ice_ethdev.c +2 -5
index 8999d441ac..d370b72d80 100644
@@ -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
drivers/net/ice/ice_logs.h +2 -11
index aab7da5f7b..e79980fb63 100644
@@ -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)
drivers/net/ice/ice_rxtx.c +10 -10
index 8785baa71a..0827db9c9e 100644
@@ -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;
Signature · 1 line
2.26.2
author
#37 lore raw

PATCH v3 8/9 net/ixgbe: refine debug build option

In reply to 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

---
 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(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -5
index 761a0f26bb..4e948a260f 100644
@@ -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
drivers/net/ixgbe/ixgbe_logs.h +2 -11
index 2a279d1098..00ef797ca1 100644
@@ -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, \
drivers/net/ixgbe/ixgbe_rxtx.c +32 -32

100 lines not on this page · raw message

Signature · 1 line
2.26.2
author
#38 lore raw

PATCH v3 9/9 net/igc: refine debug build option

In reply to 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

---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/igc/igc_logs.h +2 -2
index 6457c4d180..11071a32b5 100644
@@ -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
drivers/net/igc/igc_txrx.c +1 -1
index 21a658861c..f092709c02 100644
@@ -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;
Signature · 1 line
2.26.2
author
#39 lore raw

v4 cover ether: refine debug build option

In reply to 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(-)
Signature · 1 line
2.26.2
author
#40 lore raw

PATCH v4 1/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.

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.

---
 doc/guides/nics/build_and_test.rst | 20 ++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h     | 21 +++++++++++++--------
 2 files changed, 33 insertions(+), 8 deletions(-)
doc/guides/nics/build_and_test.rst +20 -0
index e83dd4628c..4d7f10f6b0 100644
@@ -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
 ------------------------
 
lib/librte_ethdev/rte_ethdev.h +13 -8
index 059a061072..7a65d99ff4 100644
@@ -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;
Signature · 1 line
2.26.2
author
#41 lore raw

PATCH v4 2/8 net/fm10k: refine debug build option

In reply to 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

---
 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(-)
drivers/net/fm10k/fm10k_ethdev.c +2 -5
index fd471c415e..0a557acbef 100644
@@ -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
drivers/net/fm10k/fm10k_logs.h +2 -11
index 9ae743d806..4f039f8beb 100644
@@ -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, \
drivers/net/fm10k/fm10k_rxtx.c +4 -4
index 8585c5b9e4..0a9a27aa5a 100644
@@ -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;
Signature · 1 line
2.26.2
author
#42 lore raw

PATCH v4 3/8 net/e1000: refine debug build option

In reply to 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

---
 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(-)
drivers/net/e1000/e1000_logs.c +4 -13
index 231f5c03ef..84ea0f9d4b 100644
@@ -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;
 }
drivers/net/e1000/e1000_logs.h +2 -11
index 2612134f38..86f546b0f9 100644
@@ -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, \
drivers/net/e1000/em_rxtx.c +19 -19
index db5d1222ce..dfd8f2fd00 100644
@@ -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;
drivers/net/e1000/igb_rxtx.c +1 -1
index 1500d2ffff..45da4ed9d2 100644
@@ -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;
Signature · 1 line
2.26.2
author
#43 lore raw

PATCH v4 4/8 net/i40e: refine debug build option

In reply to 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

---
 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(-)
drivers/net/i40e/i40e_ethdev.c +2 -5
index d7cd049891..e529ca0998 100644
@@ -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"
drivers/net/i40e/i40e_logs.h +2 -11
index dac3267eb4..eebe6c5559 100644
@@ -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, \
drivers/net/i40e/i40e_rxtx.c +8 -8
index 61cb204be2..3c7686c3f4 100644
@@ -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;
Signature · 1 line
2.26.2
author
#44 lore raw

PATCH v4 5/8 net/iavf: refine debug build option

In reply to 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

---
 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(-)
drivers/net/iavf/iavf_ethdev.c +2 -5
index 4d37722022..86bc5fcf3f 100644
@@ -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
drivers/net/iavf/iavf_log.h +2 -11
index 1088ec75f5..ff66ab0ccf 100644
@@ -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_ */
drivers/net/iavf/iavf_rxtx.c +4 -4
index 8fafe4579b..84df0989af 100644
@@ -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;
Signature · 1 line
2.26.2
author
#45 lore raw

PATCH v4 6/8 net/ice: refine debug build option

In reply to 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

---
 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(-)
drivers/net/ice/ice_ethdev.c +2 -5
index 8999d441ac..d370b72d80 100644
@@ -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
drivers/net/ice/ice_logs.h +2 -11
index aab7da5f7b..e79980fb63 100644
@@ -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)
drivers/net/ice/ice_rxtx.c +10 -10
index 530c206f4f..0827db9c9e 100644
@@ -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;
Signature · 1 line
2.26.2
author
#46 lore raw

PATCH v4 7/8 net/ixgbe: refine debug build option

In reply to 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

---
 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(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -5
index 761a0f26bb..4e948a260f 100644
@@ -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
drivers/net/ixgbe/ixgbe_logs.h +2 -11
index 2a279d1098..00ef797ca1 100644
@@ -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, \
drivers/net/ixgbe/ixgbe_rxtx.c +32 -32

100 lines not on this page · raw message

Signature · 1 line
2.26.2
author
#47 lore raw

PATCH v4 8/8 net/igc: refine debug build option

In reply to 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

---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/igc/igc_logs.h +2 -2
index 6457c4d180..11071a32b5 100644
@@ -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
drivers/net/igc/igc_txrx.c +1 -1
index c0a5d5e84f..f092709c02 100644
@@ -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;
Signature · 1 line
2.26.2
author
#48 lore raw

v5 cover ether: refine debug build option

In reply to 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(-)
Signature · 1 line
2.26.2
author
#49 lore raw

PATCH v5 1/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.

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.

---
 doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
 2 files changed, 30 insertions(+), 8 deletions(-)
doc/guides/nics/build_and_test.rst +16 -0
index e83dd4628c..d68f9563e0 100644
@@ -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
 ------------------------
 
lib/librte_ethdev/rte_ethdev.h +14 -8
index efda3137f7..6c7c72890f 100644
@@ -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;
Signature · 1 line
2.26.2
#50 lore raw

Re: [dpdk-dev] [PATCH v5 1/8] ether: refine debug build option

Quoted 10 lines · 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

Quoted 8 lines

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.

ethdev: ...

can fix while merging.

Acked-by on v5 1/8
#51 lore raw

Re: [dpdk-dev] [PATCH v5 1/8] ether: refine debug build option

In reply to Qi Zhang

23/03/2021 12:07, Qi Zhang:

Quoted 18 lines

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.

[...]

Quoted 1 line

+The ethdev layer supports below compile options for debug purpose:

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

Quoted 4 lines
doc/guides/nics/build_and_test.rst +4 -0
+
+- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
+
+  Build with debug code on Rx path.

doc/guides/nics/build_and_test.rst This will also build testpmd. · line 43

Quoted 10 lines
doc/guides/nics/build_and_test.rst +10 -0
+
+- ``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.
author
#52 lore raw

PATCH v5 2/8 net/fm10k: refine debug build option

In reply to 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

---
 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(-)
drivers/net/fm10k/fm10k_ethdev.c +2 -5
index fd471c415e..0a557acbef 100644
@@ -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
drivers/net/fm10k/fm10k_logs.h +2 -11
index 9ae743d806..4f039f8beb 100644
@@ -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, \
drivers/net/fm10k/fm10k_rxtx.c +4 -4
index 8585c5b9e4..0a9a27aa5a 100644
@@ -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;
Signature · 1 line
2.26.2
#53 lore raw

Re: [dpdk-dev] [PATCH v5 2/8] net/fm10k: refine debug build option

Quoted 2 lines · 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.

s/whth/with

can fix while merging

Quoted 4 lines

3. merge RTE_LIBRTE_FM10K_DEBUG_TX_FREE and RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX

author
#54 lore raw

PATCH v5 3/8 net/e1000: refine debug build option

In reply to 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

---
 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(-)
drivers/net/e1000/e1000_logs.c +4 -13
index 231f5c03ef..84ea0f9d4b 100644
@@ -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;
 }
drivers/net/e1000/e1000_logs.h +2 -11
index 2612134f38..86f546b0f9 100644
@@ -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, \
drivers/net/e1000/em_rxtx.c +19 -19
index db5d1222ce..dfd8f2fd00 100644
@@ -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;
drivers/net/e1000/igb_rxtx.c +1 -1
index 1500d2ffff..45da4ed9d2 100644
@@ -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;
Signature · 1 line
2.26.2
author
#55 lore raw

PATCH v5 4/8 net/i40e: refine debug build option

In reply to 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

---
 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(-)
drivers/net/i40e/i40e_ethdev.c +2 -5
index 9b86bcdc69..38d43c8dc6 100644
@@ -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"
drivers/net/i40e/i40e_logs.h +2 -11
index dac3267eb4..eebe6c5559 100644
@@ -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, \
drivers/net/i40e/i40e_rxtx.c +8 -8
index 61cb204be2..3c7686c3f4 100644
@@ -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;
Signature · 1 line
2.26.2
author
#56 lore raw

PATCH v5 5/8 net/iavf: refine debug build option

In reply to 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

---
 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(-)
drivers/net/iavf/iavf_ethdev.c +2 -5
index 4d37722022..86bc5fcf3f 100644
@@ -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
drivers/net/iavf/iavf_log.h +2 -11
index 1088ec75f5..ff66ab0ccf 100644
@@ -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_ */
drivers/net/iavf/iavf_rxtx.c +4 -4
index 8fafe4579b..84df0989af 100644
@@ -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;
Signature · 1 line
2.26.2
author
#57 lore raw

PATCH v5 6/8 net/ice: refine debug build option

In reply to 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

---
 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(-)
drivers/net/ice/ice_ethdev.c +2 -5
index 9c9b84a938..06169321cf 100644
@@ -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
drivers/net/ice/ice_logs.h +2 -11
index aab7da5f7b..e79980fb63 100644
@@ -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)
drivers/net/ice/ice_rxtx.c +10 -10
index 530c206f4f..0827db9c9e 100644
@@ -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;
Signature · 1 line
2.26.2
author
#58 lore raw

PATCH v5 7/8 net/ixgbe: refine debug build option

In reply to 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

---
 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(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -5
index 8a9a21e7c2..62cd2ecc22 100644
@@ -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
drivers/net/ixgbe/ixgbe_logs.h +2 -11
index 2a279d1098..00ef797ca1 100644
@@ -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, \
drivers/net/ixgbe/ixgbe_rxtx.c +32 -32

100 lines not on this page · raw message

Signature · 1 line
2.26.2
author
#59 lore raw

PATCH v5 8/8 net/igc: refine debug build option

In reply to 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

---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/igc/igc_logs.h +2 -2
index 6457c4d180..11071a32b5 100644
@@ -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
drivers/net/igc/igc_txrx.c +1 -1
index c0a5d5e84f..f092709c02 100644
@@ -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;
Signature · 1 line
2.26.2
#60 lore raw

Re: [dpdk-dev] [PATCH v5 8/8] net/igc: refine debug build option

Quoted 5 lines · 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

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

#61 lore raw

Re: [dpdk-dev] [PATCH v5 8/8] net/igc: refine debug build option

Quoted 8 lines · Ferruh Yigit
Quoted 5 lines · 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

Quoted 8 lines

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
Signature · 1 line
David Marchand
#62 lore raw

Re: [dpdk-dev] [PATCH v5 8/8] net/igc: refine debug build option

Quoted 23 lines · David Marchand
Quoted 8 lines · Ferruh Yigit
Quoted 5 lines · 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

Quoted 8 lines

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.

Quoted 4 lines

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...) \
#63 lore raw

Re: [dpdk-dev] [PATCH v5 8/8] net/igc: refine debug build option

Quoted 51 lines · Ferruh Yigit
Quoted 23 lines · David Marchand
Quoted 8 lines · Ferruh Yigit
Quoted 5 lines · 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

Quoted 8 lines

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.

Quoted 4 lines

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?

drivers/net/e1000/base/meson.build +1 -1
index d13f693d3eb8..a9f92cbc4770 100644
@@ -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()
drivers/net/e1000/e1000_logs.h +0 -0
index 86f546b0f9ed..210c3447c66c 100644

drivers/net/e1000/e1000_logs.h line 15

Quoted 9 lines
drivers/net/e1000/e1000_logs.h +3 -0
@@ -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?

#64 lore raw

Re: [dpdk-dev] [PATCH v5 0/8] ether: refine debug build option

In reply to Qi Zhang

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.

Quoted 65 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Tuesday, March 23, 2021 7:08 PM
To: Yigit, Ferruh <[email protected]>
Cc: [email protected]; [email protected]; Richardson, Bruce <[email protected]>; Wang, Xiao W <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Yang, Qiming <[email protected]>; Wang, Haiyue <[email protected]>; Zhang, Qi Z <[email protected]>
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

Reviewed-by on the v5 series
#65 lore raw

Re: [dpdk-dev] [PATCH v5 0/8] ether: refine debug build option

In reply to Qi Zhang
Quoted 17 lines · 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

Quoted 10 lines

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,

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

author
#66 lore raw

v6 cover ether: refine debug build option

In reply to 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(-)
Signature · 1 line
2.26.2
author
#67 lore raw

PATCH v6 1/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.

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.

---
 doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
 2 files changed, 30 insertions(+), 8 deletions(-)
doc/guides/nics/build_and_test.rst +16 -0
index e83dd4628c..e8b29c2277 100644
@@ -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
 ------------------------
 
lib/librte_ethdev/rte_ethdev.h +14 -8
index efda3137f7..6c7c72890f 100644
@@ -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;
Signature · 1 line
2.26.2
#68 lore raw

Re: [dpdk-dev] [PATCH v6 1/8] ether: refine debug build option

Quoted 37 lines · 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.

---
  doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
  lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
  2 files changed, 30 insertions(+), 8 deletions(-)
doc/guides/nics/build_and_test.rst +6 -0
index e83dd4628c..e8b29c2277 100644
@@ -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.
+

doc/guides/nics/build_and_test.rst This will also build testpmd. · line 44

Quoted 10 lines
doc/guides/nics/build_and_test.rst +10 -0
+- ``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

#69 lore raw

Re: [dpdk-dev] [PATCH v6 1/8] ether: refine debug build option

Quoted 56 lines · Ferruh Yigit
Quoted 44 lines · 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.

---
  doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++ lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------

  2 files changed, 30 insertions(+), 8 deletions(-)
doc/guides/nics/build_and_test.rst +0 -0
index e83dd4628c..e8b29c2277 100644
@@ -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:

doc/guides/nics/build_and_test.rst +12 -0
+
+- ``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
Quoted 6 lines

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?

Quoted 15 lines

[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?

#70 lore raw

Re: [dpdk-dev] [PATCH v6 1/8] ether: refine debug build option

śr., 5 maj 2021 o 13:45 Ferruh Yigit <[email protected]> napisał(a):

Quoted 73 lines · Ferruh Yigit
Quoted 56 lines · Qi Zhang
Quoted 44 lines

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.

---
  doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
  lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
  2 files changed, 30 insertions(+), 8 deletions(-)
doc/guides/nics/build_and_test.rst +12 -0
index e83dd4628c..e8b29c2277 100644
@@ -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
Quoted 6 lines

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?

Quoted 15 lines

[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

Quoted 3 lines

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

#71 lore raw

Re: [dpdk-dev] [PATCH v6 1/8] ether: refine debug build option

Quoted 74 lines · Michał Krawczyk

śr., 5 maj 2021 o 13:45 Ferruh Yigit <[email protected]> napisał(a):

Quoted 73 lines · Ferruh Yigit
Quoted 71 lines · Qi Zhang
Quoted 44 lines

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.

---
  doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
  lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
  2 files changed, 30 insertions(+), 8 deletions(-)
doc/guides/nics/build_and_test.rst +12 -0
index e83dd4628c..e8b29c2277 100644
@@ -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
Quoted 6 lines

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

Quoted 8 lines
Quoted 3 lines

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.

#72 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v6 1/8] ether: refine debug build option

Quoted 93 lines

From: dev <[email protected]> On Behalf Of Ferruh Yigit
Sent: Wednesday, May 5, 2021 8:09 PM

Quoted 5 lines · Michał Krawczyk

śr., 5 maj 2021 o 13:45 Ferruh Yigit <[email protected]> napisał(a):

Quoted 4 lines · Ferruh Yigit
Quoted 2 lines · Qi Zhang
Quoted 1 line

PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option

to wrap

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

- 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

Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
Quoted 34 lines

compatibility.

---
  doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
  lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
  2 files changed, 30 insertions(+), 8 deletions(-)
doc/guides/nics/build_and_test.rst +13 -0
index e83dd4628c..e8b29c2277 100644
@@ -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.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

+ 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?

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

[1]:
- bnx2x: RTE_LIBRTE_BNX2X_DEBUG_RX /

RTE_LIBRTE_BNX2X_DEBUG_TX

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

- qede: RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
- virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX /

RTE_LIBRTE_VIRTIO_DEBUG_TX

Quoted 1 line
Quoted 1 line
Quoted 1 line

- netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX /

RTE_LIBRTE_NETVSC_DEBUG_TX

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

- 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

Quoted 1 line
Quoted 1 line
Quoted 1 line

- nfp: RTE_LIBRTE_NFP_NET_DEBUG_RX /

RTE_LIBRTE_NFP_NET_DEBUG_TX

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

- liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
- txgbe: RTE_LIBRTE_TXGBE_DEBUG_RX /

RTE_LIBRTE_TXGBE_DEBUG_TX

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

- ena: RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX

Reminder of this one.

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

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

author
#73 lore raw

PATCH v6 2/8 net/fm10k: refine debug build option

In reply to 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

---
 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(-)
drivers/net/fm10k/fm10k_ethdev.c +2 -5
index fd471c415e..0a557acbef 100644
@@ -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
drivers/net/fm10k/fm10k_logs.h +2 -11
index 9ae743d806..4f039f8beb 100644
@@ -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, \
drivers/net/fm10k/fm10k_rxtx.c +4 -4
index 8585c5b9e4..0a9a27aa5a 100644
@@ -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;
Signature · 1 line
2.26.2
author
#74 lore raw

PATCH v6 3/8 net/e1000: refine debug build option

In reply to 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

---
 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(-)
drivers/net/e1000/e1000_logs.c +4 -13
index 231f5c03ef..84ea0f9d4b 100644
@@ -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;
 }
drivers/net/e1000/e1000_logs.h +2 -11
index 2612134f38..86f546b0f9 100644
@@ -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, \
drivers/net/e1000/em_rxtx.c +19 -19
index db5d1222ce..dfd8f2fd00 100644
@@ -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;
drivers/net/e1000/igb_rxtx.c +1 -1
index 1500d2ffff..45da4ed9d2 100644
@@ -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;
Signature · 1 line
2.26.2
author
#75 lore raw

PATCH v6 4/8 net/i40e: refine debug build option

In reply to 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

---
 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(-)
drivers/net/i40e/i40e_ethdev.c +2 -5
index fcf150e127..2076717324 100644
@@ -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"
drivers/net/i40e/i40e_logs.h +2 -11
index dac3267eb4..eebe6c5559 100644
@@ -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, \
drivers/net/i40e/i40e_rxtx.c +8 -8
index 61cb204be2..3c7686c3f4 100644
@@ -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;
Signature · 1 line
2.26.2
author
#76 lore raw

PATCH v6 5/8 net/iavf: refine debug build option

In reply to 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

---
 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(-)
drivers/net/iavf/iavf_ethdev.c +2 -5
index 869c4a1988..51cad48069 100644
@@ -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
drivers/net/iavf/iavf_log.h +2 -11
index 1088ec75f5..ff66ab0ccf 100644
@@ -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_ */
drivers/net/iavf/iavf_rxtx.c +4 -4
index caf14a2323..541b4446e8 100644
@@ -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;
Signature · 1 line
2.26.2
author
#77 lore raw

PATCH v6 6/8 net/ice: refine debug build option

In reply to 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

---
 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(-)
drivers/net/ice/ice_ethdev.c +2 -5
index f0dc543575..5082c227bf 100644
@@ -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
drivers/net/ice/ice_logs.h +2 -11
index aab7da5f7b..e79980fb63 100644
@@ -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)
drivers/net/ice/ice_rxtx.c +10 -10
index 530c206f4f..0827db9c9e 100644
@@ -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;
Signature · 1 line
2.26.2
author
#78 lore raw

PATCH v6 7/8 net/ixgbe: refine debug build option

In reply to 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

---
 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(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -5
index 31faff066c..2d308be48a 100644
@@ -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
drivers/net/ixgbe/ixgbe_logs.h +2 -11
index 2a279d1098..00ef797ca1 100644
@@ -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, \
drivers/net/ixgbe/ixgbe_rxtx.c +32 -32

100 lines not on this page · raw message

Signature · 1 line
2.26.2
author
#79 lore raw

PATCH v6 8/8 net/igc: refine debug build option

In reply to 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

---
 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(-)
drivers/net/e1000/e1000_logs.c +1 -0
index 84ea0f9d4b..5835a0d62d 100644
@@ -2,6 +2,7 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <rte_ethdev.h>
 #include "e1000_logs.h"
 
 /* declared as extern in e1000_logs.h */
drivers/net/igc/igc_logs.h +2 -2
index 6457c4d180..11071a32b5 100644
@@ -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
drivers/net/igc/igc_txrx.c +1 -1
index c0a5d5e84f..f092709c02 100644
@@ -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;
Signature · 1 line
2.26.2
Reviewed-by on the v6 series
#80 lore raw

Re: [dpdk-dev] [PATCH v6 0/8] ether: refine debug build option

In reply to Qi Zhang
Quoted 40 lines · 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.

Quoted 10 lines

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,

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