New upstream version 18.11-rc1
[deb_dpdk.git] / drivers / net / enetc / enetc_logs.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2018 NXP
3  */
4
5 #ifndef _ENETC_LOGS_H_
6 #define _ENETC_LOGS_H_
7
8 extern int enetc_logtype_pmd;
9
10 #define ENETC_PMD_LOG(level, fmt, args...) \
11         rte_log(RTE_LOG_ ## level, enetc_logtype_pmd, "enetc_net: " \
12                 fmt "\n", ##args)
13
14 #define ENETC_PMD_DEBUG(fmt, args...) \
15         rte_log(RTE_LOG_DEBUG, enetc_logtype_pmd, "enetc_net: %s(): "\
16                 fmt "\n", __func__, ##args)
17
18 #define PMD_INIT_FUNC_TRACE() ENETC_PMD_DEBUG(">>")
19
20 #define ENETC_PMD_CRIT(fmt, args...) \
21         ENETC_PMD_LOG(CRIT, fmt, ## args)
22 #define ENETC_PMD_INFO(fmt, args...) \
23         ENETC_PMD_LOG(INFO, fmt, ## args)
24 #define ENETC_PMD_ERR(fmt, args...) \
25         ENETC_PMD_LOG(ERR, fmt, ## args)
26 #define ENETC_PMD_WARN(fmt, args...) \
27         ENETC_PMD_LOG(WARNING, fmt, ## args)
28
29 /* DP Logs, toggled out at compile time if level lower than current level */
30 #define ENETC_PMD_DP_LOG(level, fmt, args...) \
31         RTE_LOG_DP(level, PMD, fmt, ## args)
32
33 #define ENETC_PMD_DP_DEBUG(fmt, args...) \
34         ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
35 #define ENETC_PMD_DP_INFO(fmt, args...) \
36         ENETC_PMD_DP_LOG(INFO, fmt, ## args)
37 #define ENETC_PMD_DP_WARN(fmt, args...) \
38         ENETC_PMD_DP_LOG(WARNING, fmt, ## args)
39
40 #endif /* _ENETC_LOGS_H_*/