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;
16 #define DPAA_BUS_LOG(level, fmt, args...) \
17 rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "%s(): " fmt "\n", \
20 #define BUS_INIT_FUNC_TRACE() DPAA_BUS_LOG(DEBUG, " >>")
22 #ifdef RTE_LIBRTE_DPAA_DEBUG_BUS
23 #define DPAA_BUS_HWWARN(cond, fmt, args...) \
26 DPAA_BUS_LOG(DEBUG, "WARN: " fmt, ##args); \
29 #define DPAA_BUS_HWWARN(cond, fmt, args...) do { } while (0)
32 #define DPAA_BUS_DEBUG(fmt, args...) \
33 DPAA_BUS_LOG(DEBUG, fmt, ## args)
34 #define DPAA_BUS_INFO(fmt, args...) \
35 DPAA_BUS_LOG(INFO, fmt, ## args)
36 #define DPAA_BUS_ERR(fmt, args...) \
37 DPAA_BUS_LOG(ERR, fmt, ## args)
38 #define DPAA_BUS_WARN(fmt, args...) \
39 DPAA_BUS_LOG(WARNING, fmt, ## args)
41 /* Mempool related logs */
43 #define DPAA_MEMPOOL_LOG(level, fmt, args...) \
44 rte_log(RTE_LOG_ ## level, dpaa_logtype_mempool, "%s(): " fmt "\n", \
47 #define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
49 #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \
50 RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
51 #define DPAA_MEMPOOL_DEBUG(fmt, args...) \
52 DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args)
53 #define DPAA_MEMPOOL_ERR(fmt, args...) \
54 DPAA_MEMPOOL_LOG(ERR, fmt, ## args)
55 #define DPAA_MEMPOOL_INFO(fmt, args...) \
56 DPAA_MEMPOOL_LOG(INFO, fmt, ## args)
57 #define DPAA_MEMPOOL_WARN(fmt, args...) \
58 DPAA_MEMPOOL_LOG(WARNING, fmt, ## args)
60 /* PMD related logs */
62 #define DPAA_PMD_LOG(level, fmt, args...) \
63 rte_log(RTE_LOG_ ## level, dpaa_logtype_pmd, "%s(): " fmt "\n", \
66 #define PMD_INIT_FUNC_TRACE() DPAA_PMD_LOG(DEBUG, " >>")
68 #define DPAA_PMD_DEBUG(fmt, args...) \
69 DPAA_PMD_LOG(DEBUG, fmt, ## args)
70 #define DPAA_PMD_ERR(fmt, args...) \
71 DPAA_PMD_LOG(ERR, fmt, ## args)
72 #define DPAA_PMD_INFO(fmt, args...) \
73 DPAA_PMD_LOG(INFO, fmt, ## args)
74 #define DPAA_PMD_WARN(fmt, args...) \
75 DPAA_PMD_LOG(WARNING, fmt, ## args)
77 /* DP Logs, toggled out at compile time if level lower than current level */
78 #define DPAA_DP_LOG(level, fmt, args...) \
79 RTE_LOG_DP(level, PMD, fmt, ## args)
81 #endif /* _DPAA_LOGS_H_ */