net/mlx5: add VLAN push/pop DR commands to glue
[dpdk.git] / drivers / net / qede / qede_logs.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2016 - 2018 Cavium Inc.
3  * All rights reserved.
4  * www.cavium.com
5  */
6
7 #ifndef _QEDE_LOGS_H_
8 #define _QEDE_LOGS_H_
9
10 extern int qede_logtype_driver;
11
12 #define DP_ERR(p_dev, fmt, ...)                         \
13         rte_log(RTE_LOG_ERR, qede_logtype_driver,       \
14                 "[%s:%d(%s)]" fmt,                      \
15                 __func__, __LINE__,                     \
16                 (p_dev)->name ? (p_dev)->name : "",     \
17                 ##__VA_ARGS__)
18
19 #define DP_NOTICE(p_dev, is_assert, fmt, ...) \
20 do { \
21         if (is_assert) \
22                 rte_log(RTE_LOG_ERR, qede_logtype_driver,\
23                         "[QEDE PMD: (%s)]%s:" fmt, \
24                         (p_dev)->name ? (p_dev)->name : "", \
25                          __func__, \
26                         ##__VA_ARGS__); \
27         else \
28                 rte_log(RTE_LOG_NOTICE, qede_logtype_driver,\
29                         "[QEDE PMD: (%s)]%s:" fmt, \
30                         (p_dev)->name ? (p_dev)->name : "", \
31                          __func__, \
32                         ##__VA_ARGS__); \
33 } while (0)
34
35 #define DP_INFO(p_dev, fmt, ...) \
36         rte_log(RTE_LOG_INFO, qede_logtype_driver, \
37                 "[%s:%d(%s)]" fmt, \
38                 __func__, __LINE__, \
39                 (p_dev)->name ? (p_dev)->name : "", \
40                 ##__VA_ARGS__)
41
42 #define DP_VERBOSE(p_dev, module, fmt, ...)                             \
43         do {                                                            \
44                 if ((p_dev)->dp_module & module)                        \
45                         rte_log(RTE_LOG_DEBUG, qede_logtype_driver,     \
46                                 "[%s:%d(%s)]" fmt,                      \
47                                 __func__, __LINE__,                     \
48                                 (p_dev)->name ? (p_dev)->name : "",     \
49                                 ##__VA_ARGS__);                         \
50         } while (0)
51
52 extern int qede_logtype_init;
53 #define PMD_INIT_LOG(level, edev, fmt, args...)         \
54         rte_log(RTE_LOG_ ## level, qede_logtype_init,   \
55                 "[qede_pmd: %s] %s() " fmt "\n",        \
56                 (edev)->name, __func__, ##args)
57
58 #define PMD_INIT_FUNC_TRACE(edev) PMD_INIT_LOG(DEBUG, edev, " >>")
59
60 #ifdef RTE_LIBRTE_QEDE_DEBUG_TX
61 #define PMD_TX_LOG(level, q, fmt, args...) \
62         RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \
63                 __func__, q->port_id, q->queue_id, ## args)
64 #else
65 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
66 #endif
67
68 #ifdef RTE_LIBRTE_QEDE_DEBUG_RX
69 #define PMD_RX_LOG(level, q, fmt, args...) \
70         RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \
71                 __func__, q->port_id, q->queue_id, ## args)
72 #else
73 #define PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
74 #endif
75
76 #endif /* _QEDE_LOGS_H_ */