#include "mlx5_common_utils.h"
#include "mlx5_common_pci.h"
-int mlx5_common_logtype;
-
uint8_t haswell_broadwell_cpu;
/* In case this is an x86_64 intel processor to check if
}
#endif
-RTE_INIT_PRIO(mlx5_log_init, LOG)
-{
- mlx5_common_logtype = rte_log_register("pmd.common.mlx5");
- if (mlx5_common_logtype >= 0)
- rte_log_set_level(mlx5_common_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(mlx5_common_logtype, pmd.common.mlx5, NOTICE)
static bool mlx5_common_initialized;
#include "bcmfs_logs.h"
-int bcmfs_conf_logtype;
-int bcmfs_dp_logtype;
-
int
bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
const void *buf, unsigned int len)
return 0;
}
-RTE_INIT(bcmfs_device_init_log)
-{
- /* Configuration and general logs */
- bcmfs_conf_logtype = rte_log_register("pmd.bcmfs_config");
- if (bcmfs_conf_logtype >= 0)
- rte_log_set_level(bcmfs_conf_logtype, RTE_LOG_NOTICE);
-
- /* data-path logs */
- bcmfs_dp_logtype = rte_log_register("pmd.bcmfs_fp");
- if (bcmfs_dp_logtype >= 0)
- rte_log_set_level(bcmfs_dp_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE)
+RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE)
#include "e1000_logs.h"
-/* declared as extern in e1000_logs.h */
-int e1000_logtype_init;
-int e1000_logtype_driver;
-
-#ifdef RTE_LIBRTE_E1000_DEBUG_RX
-int e1000_logtype_rx;
-#endif
-#ifdef RTE_LIBRTE_E1000_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;
-
-void
-e1000_igb_init_log(void)
-{
- if (e1000_log_initialized)
- return;
-
- e1000_logtype_init = rte_log_register("pmd.net.e1000.init");
- if (e1000_logtype_init >= 0)
- rte_log_set_level(e1000_logtype_init, RTE_LOG_NOTICE);
- e1000_logtype_driver = rte_log_register("pmd.net.e1000.driver");
- if (e1000_logtype_driver >= 0)
- rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
-
+RTE_LOG_REGISTER(e1000_logtype_init, pmd.net.e1000.init, NOTICE)
+RTE_LOG_REGISTER(e1000_logtype_driver, pmd.net.e1000.driver, NOTICE)
#ifdef RTE_LIBRTE_E1000_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);
+RTE_LOG_REGISTER(e1000_logtype_rx, pmd.net.e1000.rx, DEBUG)
#endif
-
#ifdef RTE_LIBRTE_E1000_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);
+RTE_LOG_REGISTER(e1000_logtype_tx, pmd.net.e1000.tx, 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);
+RTE_LOG_REGISTER(e1000_logtype_tx_free, pmd.net.e1000.tx_free, DEBUG)
#endif
-
- e1000_log_initialized = 1;
-}