New upstream version 16.11.9
[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, sc, fmt, args...) \
15         RTE_LOG(level, PMD, \
16         "[bnx2x_pmd: %s] %s() " fmt "\n", (sc)->devinfo.name, __func__, ##args)
17
18 #ifdef RTE_LIBRTE_BNX2X_DEBUG_INIT
19 #define PMD_INIT_FUNC_TRACE(sc) PMD_INIT_LOG(DEBUG, sc, " >>")
20 #else
21 #define PMD_INIT_FUNC_TRACE(sc) do { (void)sc; } while(0)
22 #endif
23
24 #ifdef RTE_LIBRTE_BNX2X_DEBUG_RX
25 #define PMD_RX_LOG(level, fmt, args...) \
26         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
27 #else
28 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
29 #endif
30
31 #ifdef RTE_LIBRTE_BNX2X_DEBUG_TX
32 #define PMD_TX_LOG(level, fmt, args...) \
33         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
34 #else
35 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
36 #endif
37
38 #ifdef RTE_LIBRTE_BNX2X_DEBUG_TX_FREE
39 #define PMD_TX_FREE_LOG(level, fmt, args...) \
40         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
41 #else
42 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
43 #endif
44
45 #ifdef RTE_LIBRTE_BNX2X_DEBUG
46 #define PMD_DRV_LOG_RAW(level, sc, fmt, args...) \
47         RTE_LOG(level, PMD, "[%s:%d(%s)] " fmt, __func__, __LINE__, \
48                 (sc)->devinfo.name ? (sc)->devinfo.name : "", ## args)
49 #else
50 #define PMD_DRV_LOG_RAW(level, sc, fmt, args...) do { } while (0)
51 #endif
52
53 #define PMD_DRV_LOG(level, sc, fmt, args...) \
54         PMD_DRV_LOG_RAW(level, sc, fmt "\n", ## args)
55
56 #ifdef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC
57 #define PMD_DEBUG_PERIODIC_LOG(level, sc, fmt, args...) \
58         RTE_LOG(level, PMD, "%s(%s): " fmt "\n", __func__, \
59                 (sc)->devinfo.name ? (sc)->devinfo.name : "", ## args)
60 #else
61 #define PMD_DEBUG_PERIODIC_LOG(level, sc, fmt, args...) do { } while (0)
62 #endif
63
64
65 #endif /* _PMD_LOGS_H_ */