ether: refine debug compile option
Subsystems (2)
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
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
@@ -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
@@ -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
PATCH 2/8 net/fm10k: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH 3/8 net/e1000: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 4/8 net/i40e: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH 5/8 net/iavf: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH 6/8 net/ice: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH 7/8 net/ixgbe: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
PATCH 8/8 net/igc: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
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
<...>
v2 cover ether: refine debug compile option
In reply to Qi ZhangPMDs 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
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
@@ -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
@@ -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
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_TXAlso, all the compile options are documented on the overview page, so users can easily find them.
Signed-off-by Qi Zhang <[email protected]>--- 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@@ -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"?
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_TXAlso, 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
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".
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 optionQuoted 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_TXAlso, 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!
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_TXAlso, 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.
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_TXAlso, 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
_RXand_TXmacro 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?
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 optionQuoted 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_TXAlso, 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
_RXand_TXmacro 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
PATCH v2 2/8 net/fm10k: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v2 3/8 net/e1000: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v2 4/8 net/i40e: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v2 5/8 net/iavf: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v2 6/8 net/ice: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v2 7/8 net/ixgbe: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
PATCH v2 8/8 net/igc: refine debug compile option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
v3 cover ether: refine debug build option
In reply to Qi ZhangPMDs 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
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
@@ -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
@@ -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
PATCH v3 2/9 net: replace build option
In reply to Qi ZhangReplace 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Re: [dpdk-dev] [PATCH v3 2/9] net: replace build option
Quoted 3 lines · Qi Zhang
Replace
RTE_LIBRTE_ETHDEV_DEBUGwithRTE_ETHDEV_DEBUG.Signed-off-by Qi Zhang <[email protected]>
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?
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_DEBUGwithRTE_ETHDEV_DEBUG.Signed-off-by Qi Zhang <[email protected]>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_).
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 option17/03/2021 22:47, Ferruh Yigit:
Quoted 5 lines · Qi Zhang
Quoted 3 lines
Replace
RTE_LIBRTE_ETHDEV_DEBUGwithRTE_ETHDEV_DEBUG.Signed-off-by Qi Zhang <[email protected]>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 withoutLIBRTE_).
OK, adding an alias makes sense to me
Thanks
Qi
Quoted 1 line
PATCH v3 3/9 net/fm10k: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v3 4/9 net/e1000: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v3 5/9 net/i40e: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v3 6/9 net/iavf: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v3 7/9 net/ice: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v3 8/9 net/ixgbe: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
PATCH v3 9/9 net/igc: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
v4 cover ether: refine debug build option
In reply to Qi ZhangPMDs 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
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
@@ -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
@@ -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
PATCH v4 2/8 net/fm10k: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v4 3/8 net/e1000: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v4 4/8 net/i40e: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v4 5/8 net/iavf: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v4 6/8 net/ice: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v4 7/8 net/ixgbe: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
PATCH v4 8/8 net/igc: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
v5 cover ether: refine debug build option
In reply to Qi ZhangPMDs 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
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
@@ -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
@@ -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
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_DEBUGwill alias to bothRTE_ETHDEV_DEBUG_RXandRTE_ETHDEV_DEBUG_TXfor backward compatibility.Signed-off-by Qi Zhang <[email protected]>
ethdev: ...
can fix while merging.
Re: [dpdk-dev] [PATCH v5 1/8] ether: refine debug build option
In reply to Qi Zhang23/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_TXAll the build options are documented at programming guide "3.1 Driver Option", so users can easily find them.
The original undocumented
RTE_LIBRTE_ETHDEV_DEBUGwill alias to bothRTE_ETHDEV_DEBUG_RXandRTE_ETHDEV_DEBUG_TXfor backward compatibility.Signed-off-by Qi Zhang <[email protected]>
[...]
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.
PATCH v5 2/8 net/fm10k: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
Re: [dpdk-dev] [PATCH v5 2/8] net/fm10k: refine debug build option
Quoted 2 lines · Qi Zhang
1. replace
RTE_LIBRTE_FM10K_DEBUG_RXwithRTE_ETHDEV_DEBUG_RX.
2. replaceRTE_LIBRTE_FM10K_DEBUG_TXwhthRTE_ETHDEV_DEBUG_TX.
s/whth/with
can fix while merging
Quoted 4 lines
3. merge
RTE_LIBRTE_FM10K_DEBUG_TX_FREEandRTE_LIBRTE_ETHDEV_DEBUGintoRTE_ETHDEV_DEBUG_TXSigned-off-by Qi Zhang <[email protected]>
PATCH v5 3/8 net/e1000: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v5 4/8 net/i40e: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v5 5/8 net/iavf: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v5 6/8 net/ice: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v5 7/8 net/ixgbe: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
PATCH v5 8/8 net/igc: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
Re: [dpdk-dev] [PATCH v5 8/8] net/igc: refine debug build option
Quoted 5 lines · Qi Zhang
1. replace
RTE_LIBRTE_IGC_DEBUG_RXwithRTE_ETHDEV_DEBUG_RX.
2. replaceRTE_LIBRTE_IGC_DEBUG_TXwhthRTE_ETHDEV_DEBUG_TX.
3. mergeRTE_LIBRTE_ETHDEV_DEBUGintoRTE_ETHDEV_DEBUG_TXSigned-off-by Qi Zhang <[email protected]>
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
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_RXwithRTE_ETHDEV_DEBUG_RX.
2. replaceRTE_LIBRTE_IGC_DEBUG_TXwhthRTE_ETHDEV_DEBUG_TX.
3. mergeRTE_LIBRTE_ETHDEV_DEBUGintoRTE_ETHDEV_DEBUG_TXSigned-off-by Qi Zhang <[email protected]>
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
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_RXwithRTE_ETHDEV_DEBUG_RX.
2. replaceRTE_LIBRTE_IGC_DEBUG_TXwhthRTE_ETHDEV_DEBUG_TX.
3. mergeRTE_LIBRTE_ETHDEV_DEBUGintoRTE_ETHDEV_DEBUG_TXSigned-off-by Qi Zhang <[email protected]>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.htmlNot 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 toconfig/rte_compatibility_defines.h) and not inlib/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...) \
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_RXwithRTE_ETHDEV_DEBUG_RX.
2. replaceRTE_LIBRTE_IGC_DEBUG_TXwhthRTE_ETHDEV_DEBUG_TX.
3. mergeRTE_LIBRTE_ETHDEV_DEBUGintoRTE_ETHDEV_DEBUG_TXSigned-off-by Qi Zhang <[email protected]>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.htmlNot 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 toconfig/rte_compatibility_defines.h) and not inlib/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.shThanks 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@@ -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
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?
Re: [dpdk-dev] [PATCH v5 0/8] ether: refine debug build option
In reply to Qi ZhangSorry, 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 optionPMDs 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_TXThe undocumented
RTE_LIBRTE_ETHDEV_DEBUGwill a alias to bothRTE_ETHDEV_DEBUG_RXandRTE_ETHDEV_DEBUG_TXfor 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 optiondoc/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
Re: [dpdk-dev] [PATCH v5 0/8] ether: refine debug build option
In reply to Qi ZhangQuoted 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_TXThe undocumented
RTE_LIBRTE_ETHDEV_DEBUGwill a alias to bothRTE_ETHDEV_DEBUG_RXandRTE_ETHDEV_DEBUG_TXfor 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.
v6 cover ether: refine debug build option
In reply to Qi ZhangPMDs 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
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
@@ -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
@@ -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
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_TXAll the build options are documented at programming guide "3.1 Driver Option", so users can easily find them.
The original undocumented
RTE_LIBRTE_ETHDEV_DEBUGwill alias to bothRTE_ETHDEV_DEBUG_RXandRTE_ETHDEV_DEBUG_TXfor backward compatibility.Signed-off-by Qi Zhang <[email protected]>--- 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@@ -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
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_TXAll the build options are documented at programming guide "3.1 Driver Option", so users can easily find them.
The original undocumented
RTE_LIBRTE_ETHDEV_DEBUGwill alias to bothRTE_ETHDEV_DEBUG_RXandRTE_ETHDEV_DEBUG_TXfor backward compatibility.Signed-off-by Qi Zhang <[email protected]>---
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@@ -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 invalidQuoted 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_TXmacros?
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?
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_TXAll the build options are documented at programming guide "3.1 Driver Option", so users can easily find them.
The original undocumented
RTE_LIBRTE_ETHDEV_DEBUGwill alias to bothRTE_ETHDEV_DEBUG_RXandRTE_ETHDEV_DEBUG_TXfor backward compatibility.Signed-off-by Qi Zhang <[email protected]>--- 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@@ -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 invalidQuoted 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_TXmacros?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
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_TXAll the build options are documented at programming guide "3.1 Driver Option", so users can easily find them.
The original undocumented
RTE_LIBRTE_ETHDEV_DEBUGwill alias to bothRTE_ETHDEV_DEBUG_RXandRTE_ETHDEV_DEBUG_TXfor backward compatibility.Signed-off-by Qi Zhang <[email protected]>--- 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@@ -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 invalidQuoted 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_TXmacros?[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.
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 PMQuoted 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_TXAll the build options are documented at programming guide "3.1 Driver Option", so users can easily find them.
The original undocumented
RTE_LIBRTE_ETHDEV_DEBUGwill alias to bothRTE_ETHDEV_DEBUG_RXandRTE_ETHDEV_DEBUG_TXforbackward
Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
compatibility.
Signed-off-by Qi Zhang <[email protected]>--- 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@@ -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 invalidparameters
+ 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_TXmacros?Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
[1]:
- bnx2x:RTE_LIBRTE_BNX2X_DEBUG_RX/
RTE_LIBRTE_BNX2X_DEBUG_TXQuoted 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_TXQuoted 1 line
Quoted 1 line
Quoted 1 line
- netvsc:
RTE_LIBRTE_NETVSC_DEBUG_RX/
RTE_LIBRTE_NETVSC_DEBUG_TXQuoted 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_TXQuoted 1 line
Quoted 1 line
Quoted 1 line
- nfp:
RTE_LIBRTE_NFP_NET_DEBUG_RX/
RTE_LIBRTE_NFP_NET_DEBUG_TXQuoted 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_TXQuoted 5 lines
Quoted 5 lines
Quoted 3 lines
- ena:
RTE_LIBRTE_ENA_DEBUG_RX/RTE_LIBRTE_ENA_DEBUG_TXReminder 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
PATCH v6 2/8 net/fm10k: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v6 3/8 net/e1000: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v6 4/8 net/i40e: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v6 5/8 net/iavf: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v6 6/8 net/ice: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
PATCH v6 7/8 net/ixgbe: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
PATCH v6 8/8 net/igc: refine debug build option
In reply to Qi Zhang1. 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
@@ -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
@@ -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
@@ -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
Re: [dpdk-dev] [PATCH v6 0/8] ether: refine debug build option
In reply to Qi ZhangQuoted 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_TXThe undocumented
RTE_LIBRTE_ETHDEV_DEBUGwill a alias to bothRTE_ETHDEV_DEBUG_RXandRTE_ETHDEV_DEBUG_TXfor 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:
- RemoveRTE_ETHDEV_DEBUG
- AliasRTE_LIBRTE_ETHDEV_DEBUGto RTE_ETHDEV_DEBUG_RX|TX for backward compatibility.v4:
- AliasRTE_LIBRTE_ETHDEV_DEBUGtoRTE_ETHDEV_DEBUGin ethdev library for backward compatibility.
- Not replaceRTE_LIBRTE_ETHDEV_DEBUGin 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.