#include <rte_version.h>
/* Globals */
+int qede_logtype_init;
+int qede_logtype_driver;
+
static const struct qed_eth_ops *qed_ops;
static int64_t timer_period = 1;
RTE_PMD_REGISTER_PCI(net_qede_vf, rte_qedevf_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_qede_vf, pci_id_qedevf_map);
RTE_PMD_REGISTER_KMOD_DEP(net_qede_vf, "* igb_uio | vfio-pci");
+
+RTE_INIT(qede_init_log);
+static void
+qede_init_log(void)
+{
+ qede_logtype_init = rte_log_register("pmd.qede.init");
+ if (qede_logtype_init >= 0)
+ rte_log_set_level(qede_logtype_init, RTE_LOG_NOTICE);
+ qede_logtype_driver = rte_log_register("pmd.qede.driver");
+ if (qede_logtype_driver >= 0)
+ rte_log_set_level(qede_logtype_driver, RTE_LOG_NOTICE);
+}
#ifndef _QEDE_LOGS_H_
#define _QEDE_LOGS_H_
-#define DP_ERR(p_dev, fmt, ...) \
- rte_log(RTE_LOG_ERR, RTE_LOGTYPE_PMD, \
- "[%s:%d(%s)]" fmt, \
- __func__, __LINE__, \
- (p_dev)->name ? (p_dev)->name : "", \
+extern int qede_logtype_driver;
+
+#define DP_ERR(p_dev, fmt, ...) \
+ rte_log(RTE_LOG_ERR, qede_logtype_driver, \
+ "[%s:%d(%s)]" fmt, \
+ __func__, __LINE__, \
+ (p_dev)->name ? (p_dev)->name : "", \
##__VA_ARGS__)
#define DP_NOTICE(p_dev, is_assert, fmt, ...) \
do { \
if (is_assert) \
- rte_log(RTE_LOG_ERR, RTE_LOGTYPE_PMD,\
+ rte_log(RTE_LOG_ERR, qede_logtype_driver,\
"[QEDE PMD: (%s)]%s:" fmt, \
(p_dev)->name ? (p_dev)->name : "", \
__func__, \
##__VA_ARGS__); \
else \
- rte_log(RTE_LOG_NOTICE, RTE_LOGTYPE_PMD,\
+ rte_log(RTE_LOG_NOTICE, qede_logtype_driver,\
"[QEDE PMD: (%s)]%s:" fmt, \
(p_dev)->name ? (p_dev)->name : "", \
__func__, \
#ifdef RTE_LIBRTE_QEDE_DEBUG_INFO
#define DP_INFO(p_dev, fmt, ...) \
- rte_log(RTE_LOG_INFO, RTE_LOGTYPE_PMD, \
+ rte_log(RTE_LOG_INFO, qede_logtype_driver, \
"[%s:%d(%s)]" fmt, \
__func__, __LINE__, \
(p_dev)->name ? (p_dev)->name : "", \
#define DP_INFO(p_dev, fmt, ...) do { } while (0)
#endif
-#ifdef RTE_LIBRTE_QEDE_DEBUG_DRIVER
-#define DP_VERBOSE(p_dev, module, fmt, ...) \
-do { \
- if ((p_dev)->dp_module & module) \
- rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_PMD, \
- "[%s:%d(%s)]" fmt, \
- __func__, __LINE__, \
- (p_dev)->name ? (p_dev)->name : "", \
- ##__VA_ARGS__); \
-} while (0)
-#else
-#define DP_VERBOSE(p_dev, fmt, ...) do { } while (0)
-#endif
+#define DP_VERBOSE(p_dev, module, fmt, ...) \
+ do { \
+ if ((p_dev)->dp_module & module) \
+ rte_log(RTE_LOG_DEBUG, qede_logtype_driver, \
+ "[%s:%d(%s)]" fmt, \
+ __func__, __LINE__, \
+ (p_dev)->name ? (p_dev)->name : "", \
+ ##__VA_ARGS__); \
+ } while (0)
-#define PMD_INIT_LOG(level, edev, fmt, args...) \
- rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, \
- "[qede_pmd: %s] %s() " fmt "\n", \
- (edev)->name, __func__, ##args)
+extern int qede_logtype_init;
+#define PMD_INIT_LOG(level, edev, fmt, args...) \
+ rte_log(RTE_LOG_ ## level, qede_logtype_init, \
+ "[qede_pmd: %s] %s() " fmt "\n", \
+ (edev)->name, __func__, ##args)
-#ifdef RTE_LIBRTE_QEDE_DEBUG_INIT
#define PMD_INIT_FUNC_TRACE(edev) PMD_INIT_LOG(DEBUG, edev, " >>")
-#else
-#define PMD_INIT_FUNC_TRACE(edev) do { } while (0)
-#endif
#ifdef RTE_LIBRTE_QEDE_DEBUG_TX
#define PMD_TX_LOG(level, q, fmt, args...) \