1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2017-2018 NXP
3  */
4 
5 #ifndef _CAAM_JR_LOG_H_
6 #define _CAAM_JR_LOG_H_
7 
8 #include <rte_log.h>
9 
10 extern int caam_jr_logtype;
11 
12 #define CAAM_JR_LOG(level, fmt, args...) \
13 	rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \
14 		fmt "\n", ##args)
15 
16 #define CAAM_JR_DEBUG(fmt, args...) \
17 	rte_log(RTE_LOG_DEBUG, caam_jr_logtype, "caam_jr: %s(): " \
18 		fmt "\n", __func__, ##args)
19 
20 #define PMD_INIT_FUNC_TRACE() CAAM_JR_DEBUG(" >>")
21 
22 #define CAAM_JR_INFO(fmt, args...) \
23 	CAAM_JR_LOG(INFO, fmt, ## args)
24 #define CAAM_JR_ERR(fmt, args...) \
25 	CAAM_JR_LOG(ERR, fmt, ## args)
26 #define CAAM_JR_WARN(fmt, args...) \
27 	CAAM_JR_LOG(WARNING, fmt, ## args)
28 
29 /* DP Logs, toggled out at compile time if level lower than current level */
30 #define CAAM_JR_DP_LOG(level, fmt, args...) \
31 	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
32 
33 #define CAAM_JR_DP_DEBUG(fmt, args...) \
34 	CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
35 #define CAAM_JR_DP_INFO(fmt, args...) \
36 	CAAM_JR_DP_LOG(INFO, fmt, ## args)
37 #define CAAM_JR_DP_WARN(fmt, args...) \
38 	CAAM_JR_DP_LOG(WARNING, fmt, ## args)
39 #define CAAM_JR_DP_ERR(fmt, args...) \
40 	CAAM_JR_DP_LOG(ERR, fmt, ## args)
41 
42 #endif /* _CAAM_JR_LOG_H_ */
43