*/
static inline u32 t4_read_reg(struct adapter *adapter, u32 reg_addr)
{
- u32 val = CXGBE_READ_REG(adapter, reg_addr);
-
- CXGBE_DEBUG_REG(adapter, "read register 0x%x value 0x%x\n", reg_addr,
- val);
- return val;
+ return CXGBE_READ_REG(adapter, reg_addr);
}
/**
*/
static inline void t4_write_reg(struct adapter *adapter, u32 reg_addr, u32 val)
{
- CXGBE_DEBUG_REG(adapter, "setting register 0x%x to 0x%x\n", reg_addr,
- val);
CXGBE_WRITE_REG(adapter, reg_addr, val);
}
static inline void t4_write_reg_relaxed(struct adapter *adapter, u32 reg_addr,
u32 val)
{
- CXGBE_DEBUG_REG(adapter, "setting register 0x%x to 0x%x\n", reg_addr,
- val);
CXGBE_WRITE_REG_RELAXED(adapter, reg_addr, val);
}
*/
static inline u64 t4_read_reg64(struct adapter *adapter, u32 reg_addr)
{
- u64 val = CXGBE_READ_REG64(adapter, reg_addr);
-
- CXGBE_DEBUG_REG(adapter, "64-bit read register %#x value %#llx\n",
- reg_addr, (unsigned long long)val);
- return val;
+ return CXGBE_READ_REG64(adapter, reg_addr);
}
/**
static inline void t4_write_reg64(struct adapter *adapter, u32 reg_addr,
u64 val)
{
- CXGBE_DEBUG_REG(adapter, "setting register %#x to %#llx\n", reg_addr,
- (unsigned long long)val);
-
CXGBE_WRITE_REG64(adapter, reg_addr, val);
}
#include <rte_net.h>
extern int cxgbe_logtype;
+extern int cxgbe_mbox_logtype;
-#define dev_printf(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, cxgbe_logtype, \
+#define dev_printf(level, logtype, fmt, ...) \
+ rte_log(RTE_LOG_ ## level, logtype, \
"rte_cxgbe_pmd: " fmt, ##__VA_ARGS__)
-#define dev_err(x, fmt, ...) dev_printf(ERR, fmt, ##__VA_ARGS__)
-#define dev_info(x, fmt, ...) dev_printf(INFO, fmt, ##__VA_ARGS__)
-#define dev_warn(x, fmt, ...) dev_printf(WARNING, fmt, ##__VA_ARGS__)
+#define dev_err(x, fmt, ...) \
+ dev_printf(ERR, cxgbe_logtype, fmt, ##__VA_ARGS__)
+#define dev_info(x, fmt, ...) \
+ dev_printf(INFO, cxgbe_logtype, fmt, ##__VA_ARGS__)
+#define dev_warn(x, fmt, ...) \
+ dev_printf(WARNING, cxgbe_logtype, fmt, ##__VA_ARGS__)
+#define dev_debug(x, fmt, ...) \
+ dev_printf(DEBUG, cxgbe_logtype, fmt, ##__VA_ARGS__)
-#ifdef RTE_LIBRTE_CXGBE_DEBUG
-#define dev_debug(x, fmt, ...) dev_printf(INFO, fmt, ##__VA_ARGS__)
-#else
-#define dev_debug(x, fmt, ...) do { } while (0)
-#endif
-
-#ifdef RTE_LIBRTE_CXGBE_DEBUG_REG
-#define CXGBE_DEBUG_REG(x, fmt, ...) \
- dev_printf(INFO, "REG:" fmt, ##__VA_ARGS__)
-#else
-#define CXGBE_DEBUG_REG(x, fmt, ...) do { } while (0)
-#endif
-
-#ifdef RTE_LIBRTE_CXGBE_DEBUG_MBOX
#define CXGBE_DEBUG_MBOX(x, fmt, ...) \
- dev_printf(INFO, "MBOX:" fmt, ##__VA_ARGS__)
-#else
-#define CXGBE_DEBUG_MBOX(x, fmt, ...) do { } while (0)
-#endif
+ dev_printf(DEBUG, cxgbe_mbox_logtype, "MBOX:" fmt, ##__VA_ARGS__)
-#ifdef RTE_LIBRTE_CXGBE_DEBUG_TX
-#define CXGBE_DEBUG_TX(x, fmt, ...) \
- dev_printf(INFO, "TX:" fmt, ##__VA_ARGS__)
-#else
-#define CXGBE_DEBUG_TX(x, fmt, ...) do { } while (0)
-#endif
-
-#ifdef RTE_LIBRTE_CXGBE_DEBUG_RX
-#define CXGBE_DEBUG_RX(x, fmt, ...) \
- dev_printf(INFO, "RX:" fmt, ##__VA_ARGS__)
-#else
-#define CXGBE_DEBUG_RX(x, fmt, ...) do { } while (0)
-#endif
-
-#ifdef RTE_LIBRTE_CXGBE_DEBUG
#define CXGBE_FUNC_TRACE() \
- dev_printf(DEBUG, "CXGBE trace: %s\n", __func__)
-#else
-#define CXGBE_FUNC_TRACE() do { } while (0)
-#endif
+ dev_printf(DEBUG, cxgbe_logtype, "CXGBE trace: %s\n", __func__)
#define pr_err(fmt, ...) dev_err(0, fmt, ##__VA_ARGS__)
#define pr_warn(fmt, ...) dev_warn(0, fmt, ##__VA_ARGS__)
#include "cxgbe_flow.h"
int cxgbe_logtype;
+int cxgbe_mbox_logtype;
/*
* Macros needed to support the PCI Device ID Table ...
uint16_t idx = 0;
int ret = 0;
- CXGBE_DEBUG_TX(adapter, "%s: txq = %p; tx_pkts = %p; nb_pkts = %d\n",
- __func__, txq, tx_pkts, nb_pkts);
-
t4_os_lock(&txq->txq_lock);
/* free up desc from already completed tx */
reclaim_completed_tx(&txq->q);
struct sge_eth_rxq *rxq = (struct sge_eth_rxq *)rx_queue;
unsigned int work_done;
- CXGBE_DEBUG_RX(adapter, "%s: rxq->rspq.cntxt_id = %u; nb_pkts = %d\n",
- __func__, rxq->rspq.cntxt_id, nb_pkts);
-
if (cxgbe_poll(&rxq->rspq, rx_pkts, (unsigned int)nb_pkts, &work_done))
dev_err(adapter, "error in cxgbe poll\n");
- CXGBE_DEBUG_RX(adapter, "%s: work_done = %u\n", __func__, work_done);
return work_done;
}
cxgbe_logtype = rte_log_register("pmd.net.cxgbe");
if (cxgbe_logtype >= 0)
rte_log_set_level(cxgbe_logtype, RTE_LOG_NOTICE);
+ cxgbe_mbox_logtype = rte_log_register("pmd.net.cxgbe.mbox");
+ if (cxgbe_mbox_logtype >= 0)
+ rte_log_set_level(cxgbe_mbox_logtype, RTE_LOG_NOTICE);
}