1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Cavium, Inc
5 #ifndef _CPT_PMD_LOGS_H_
6 #define _CPT_PMD_LOGS_H_
11 * This file defines log macros
15 * otx*_cryptodev.h file would define the CPT_LOGTYPE macro for the
18 #define CPT_PMD_DRV_LOG_RAW(level, fmt, args...) \
19 rte_log(RTE_LOG_ ## level, CPT_LOGTYPE, \
20 "cpt: %s(): " fmt "\n", __func__, ##args)
22 #define CPT_PMD_INIT_FUNC_TRACE() CPT_PMD_DRV_LOG_RAW(DEBUG, " >>")
24 #define CPT_LOG_INFO(fmt, args...) \
25 CPT_PMD_DRV_LOG_RAW(INFO, fmt, ## args)
26 #define CPT_LOG_WARN(fmt, args...) \
27 CPT_PMD_DRV_LOG_RAW(WARNING, fmt, ## args)
28 #define CPT_LOG_ERR(fmt, args...) \
29 CPT_PMD_DRV_LOG_RAW(ERR, fmt, ## args)
32 * DP logs, toggled out at compile time if level lower than current level.
33 * DP logs would be logged under 'PMD' type. So for dynamic logging, the
34 * level of 'pmd' has to be used.
36 #define CPT_LOG_DP(level, fmt, args...) \
37 RTE_LOG_DP(level, PMD, fmt "\n", ## args)
39 #define CPT_LOG_DP_DEBUG(fmt, args...) \
40 CPT_LOG_DP(DEBUG, fmt, ## args)
41 #define CPT_LOG_DP_INFO(fmt, args...) \
42 CPT_LOG_DP(INFO, fmt, ## args)
43 #define CPT_LOG_DP_WARN(fmt, args...) \
44 CPT_LOG_DP(WARNING, fmt, ## args)
45 #define CPT_LOG_DP_ERR(fmt, args...) \
46 CPT_LOG_DP(ERR, fmt, ## args)
48 #endif /* _CPT_PMD_LOGS_H_ */