net/fm10k: refine debug build option

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

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
Qi Zhang 2021-03-31 17:52:48 +08:00 committed by Ferruh Yigit
parent bb6270dab3
commit cc8d20d2e6
3 changed files with 8 additions and 20 deletions

View File

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

View File

@ -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, \

View File

@ -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;