aa37234ef2653d3809ad1d683c71419ab55d0017
[dpdk.git] / drivers / net / bnx2x / bnx2x_logs.h
1 /*
2  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
3  *
4  * All rights reserved.
5  */
6
7 #ifndef _PMD_LOGS_H_
8 #define _PMD_LOGS_H_
9
10 #define PMD_INIT_LOG(level, fmt, args...) \
11         rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, \
12                 "PMD: %s(): " fmt "\n", __func__, ##args)
13
14 #ifdef RTE_LIBRTE_BNX2X_DEBUG_INIT
15 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
16 #else
17 #define PMD_INIT_FUNC_TRACE() do { } while(0)
18 #endif
19
20 #ifdef RTE_LIBRTE_BNX2X_DEBUG_RX
21 #define PMD_RX_LOG(level, fmt, args...) \
22         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
23 #else
24 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
25 #endif
26
27 #ifdef RTE_LIBRTE_BNX2X_DEBUG_TX
28 #define PMD_TX_LOG(level, fmt, args...) \
29         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
30 #else
31 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
32 #endif
33
34 #ifdef RTE_LIBRTE_BNX2X_DEBUG_TX_FREE
35 #define PMD_TX_FREE_LOG(level, fmt, args...) \
36         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
37 #else
38 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
39 #endif
40
41 #ifdef RTE_LIBRTE_BNX2X_DEBUG_DRIVER
42 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
43         RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
44 #else
45 #define PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0)
46 #endif
47
48 #define PMD_DRV_LOG(level, fmt, args...) \
49         PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
50
51 #endif /* _PMD_LOGS_H_ */