Imported Upstream version 16.04
[deb_dpdk.git] / drivers / net / bnx2x / bnx2x_logs.h
1 /*
2  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
3  *
4  * Copyright (c) 2015 QLogic Corporation.
5  * All rights reserved.
6  * www.qlogic.com
7  *
8  * See LICENSE.bnx2x_pmd for copyright and licensing details.
9  */
10
11 #ifndef _PMD_LOGS_H_
12 #define _PMD_LOGS_H_
13
14 #define PMD_INIT_LOG(level, fmt, args...) \
15         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ##args)
16
17 #ifdef RTE_LIBRTE_BNX2X_DEBUG_INIT
18 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
19 #else
20 #define PMD_INIT_FUNC_TRACE() do { } while(0)
21 #endif
22
23 #ifdef RTE_LIBRTE_BNX2X_DEBUG_RX
24 #define PMD_RX_LOG(level, fmt, args...) \
25         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
26 #else
27 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
28 #endif
29
30 #ifdef RTE_LIBRTE_BNX2X_DEBUG_TX
31 #define PMD_TX_LOG(level, fmt, args...) \
32         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
33 #else
34 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
35 #endif
36
37 #ifdef RTE_LIBRTE_BNX2X_DEBUG_TX_FREE
38 #define PMD_TX_FREE_LOG(level, fmt, args...) \
39         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
40 #else
41 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
42 #endif
43
44 #ifdef RTE_LIBRTE_BNX2X_DEBUG
45 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
46         RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
47 #else
48 #define PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0)
49 #endif
50
51 #define PMD_DRV_LOG(level, fmt, args...) \
52         PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
53
54 #ifdef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC
55 #define PMD_DEBUG_PERIODIC_LOG(level, fmt, args...) \
56         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
57 #else
58 #define PMD_DEBUG_PERIODIC_LOG(level, fmt, args...) do { } while(0)
59 #endif
60
61
62 #endif /* _PMD_LOGS_H_ */