1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
5 #include "e1000_logs.h"
7 /* declared as extern in e1000_logs.h */
8 int e1000_logtype_init;
9 int e1000_logtype_driver;
11 #ifdef RTE_LIBRTE_E1000_DEBUG_RX
14 #ifdef RTE_LIBRTE_E1000_DEBUG_TX
17 #ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
18 int e1000_logtype_tx_free;
21 /* avoids double registering of logs if EM and IGB drivers are in use */
22 static int e1000_log_initialized;
25 e1000_igb_init_log(void)
27 if (e1000_log_initialized)
30 e1000_logtype_init = rte_log_register("pmd.net.e1000.init");
31 if (e1000_logtype_init >= 0)
32 rte_log_set_level(e1000_logtype_init, RTE_LOG_NOTICE);
33 e1000_logtype_driver = rte_log_register("pmd.net.e1000.driver");
34 if (e1000_logtype_driver >= 0)
35 rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
37 #ifdef RTE_LIBRTE_E1000_DEBUG_RX
38 e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx");
39 if (e1000_logtype_rx >= 0)
40 rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG);
43 #ifdef RTE_LIBRTE_E1000_DEBUG_TX
44 e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx");
45 if (e1000_logtype_tx >= 0)
46 rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG);
49 #ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE
50 e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free");
51 if (e1000_logtype_tx_free >= 0)
52 rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG);
55 e1000_log_initialized = 1;