1 /* SPDX-License-Identifier: BSD-3-Clause
12 extern int dpaa_logtype_bus;
13 extern int dpaa_logtype_mempool;
14 extern int dpaa_logtype_pmd;
15 extern int dpaa_logtype_eventdev;
17 #define DPAA_BUS_LOG(level, fmt, args...) \
18 rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "dpaa: " fmt "\n", ##args)
20 #ifdef RTE_LIBRTE_DPAA_DEBUG_BUS
21 #define DPAA_BUS_HWWARN(cond, fmt, args...) \
24 DPAA_BUS_LOG(DEBUG, "WARN: " fmt, ##args); \
27 #define DPAA_BUS_HWWARN(cond, fmt, args...) do { } while (0)
30 #define DPAA_BUS_DEBUG(fmt, args...) \
31 rte_log(RTE_LOG_DEBUG, dpaa_logtype_bus, "dpaa: %s(): " fmt "\n", \
34 #define BUS_INIT_FUNC_TRACE() DPAA_BUS_DEBUG(" >>")
36 #define DPAA_BUS_INFO(fmt, args...) \
37 DPAA_BUS_LOG(INFO, fmt, ## args)
38 #define DPAA_BUS_ERR(fmt, args...) \
39 DPAA_BUS_LOG(ERR, fmt, ## args)
40 #define DPAA_BUS_WARN(fmt, args...) \
41 DPAA_BUS_LOG(WARNING, fmt, ## args)
43 /* Mempool related logs */
45 #define DPAA_MEMPOOL_LOG(level, fmt, args...) \
46 rte_log(RTE_LOG_ ## level, dpaa_logtype_mempool, "%s(): " fmt "\n", \
49 #define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
51 #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \
52 RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
53 #define DPAA_MEMPOOL_DEBUG(fmt, args...) \
54 DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args)
55 #define DPAA_MEMPOOL_ERR(fmt, args...) \
56 DPAA_MEMPOOL_LOG(ERR, fmt, ## args)
57 #define DPAA_MEMPOOL_INFO(fmt, args...) \
58 DPAA_MEMPOOL_LOG(INFO, fmt, ## args)
59 #define DPAA_MEMPOOL_WARN(fmt, args...) \
60 DPAA_MEMPOOL_LOG(WARNING, fmt, ## args)
62 /* PMD related logs */
64 #define DPAA_PMD_LOG(level, fmt, args...) \
65 rte_log(RTE_LOG_ ## level, dpaa_logtype_pmd, "%s(): " fmt "\n", \
68 #define PMD_INIT_FUNC_TRACE() DPAA_PMD_LOG(DEBUG, " >>")
70 #define DPAA_PMD_DEBUG(fmt, args...) \
71 DPAA_PMD_LOG(DEBUG, fmt, ## args)
72 #define DPAA_PMD_ERR(fmt, args...) \
73 DPAA_PMD_LOG(ERR, fmt, ## args)
74 #define DPAA_PMD_INFO(fmt, args...) \
75 DPAA_PMD_LOG(INFO, fmt, ## args)
76 #define DPAA_PMD_WARN(fmt, args...) \
77 DPAA_PMD_LOG(WARNING, fmt, ## args)
79 #define DPAA_EVENTDEV_LOG(level, fmt, args...) \
80 rte_log(RTE_LOG_ ## level, dpaa_logtype_eventdev, "%s(): " fmt "\n", \
83 #define EVENTDEV_INIT_FUNC_TRACE() DPAA_EVENTDEV_LOG(DEBUG, " >>")
85 #define DPAA_EVENTDEV_DEBUG(fmt, args...) \
86 DPAA_EVENTDEV_LOG(DEBUG, fmt, ## args)
87 #define DPAA_EVENTDEV_ERR(fmt, args...) \
88 DPAA_EVENTDEV_LOG(ERR, fmt, ## args)
89 #define DPAA_EVENTDEV_INFO(fmt, args...) \
90 DPAA_EVENTDEV_LOG(INFO, fmt, ## args)
91 #define DPAA_EVENTDEV_WARN(fmt, args...) \
92 DPAA_EVENTDEV_LOG(WARNING, fmt, ## args)
94 /* DP Logs, toggled out at compile time if level lower than current level */
95 #define DPAA_DP_LOG(level, fmt, args...) \
96 RTE_LOG_DP(level, PMD, fmt, ## args)
98 #endif /* _DPAA_LOGS_H_ */