1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2015-2018 Atomic Rules LLC
12 /* Configuration option to pad TX packets to 60 bytes */
13 #ifdef RTE_LIBRTE_ARK_PAD_TX
14 #define ARK_TX_PAD_TO_60 1
16 #define ARK_TX_PAD_TO_60 0
19 /* system camel case definition changed to upper case */
23 /* Format specifiers for string data pairs */
24 #define ARK_SU32 "\n\t%-20s %'20" PRIU32
25 #define ARK_SU64 "\n\t%-20s %'20" PRIU64
26 #define ARK_SU64X "\n\t%-20s %#20" PRIx64
27 #define ARK_SPTR "\n\t%-20s %20p"
29 extern int ark_logtype;
31 #define PMD_DRV_LOG(level, fmt, args...) \
32 rte_log(RTE_LOG_ ##level, ark_logtype, fmt, ## args)
34 /* Conditional trace definitions */
35 #define ARK_TRACE_ON(level, fmt, args...) \
36 PMD_DRV_LOG(level, fmt, ## args)
38 /* This pattern allows compiler check arguments even if disabled */
39 #define ARK_TRACE_OFF(level, fmt, args...) \
42 PMD_DRV_LOG(level, fmt, ## args); \
45 /* tracing including the function name */
46 #define ARK_FUNC_ON(level, fmt, args...) \
47 PMD_DRV_LOG(level, "%s(): " fmt, __func__, ## args)
49 /* tracing including the function name */
50 #define ARK_FUNC_OFF(level, fmt, args...) \
53 PMD_DRV_LOG(level, "%s(): " fmt, __func__, ## args); \
57 /* Debug macro for tracing full behavior, function tracing and messages*/
58 #ifdef RTE_LIBRTE_ARK_DEBUG_TRACE
59 #define PMD_FUNC_LOG(level, fmt, ...) ARK_FUNC_ON(level, fmt, ##__VA_ARGS__)
60 #define PMD_DEBUG_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
62 #define PMD_FUNC_LOG(level, fmt, ...) ARK_FUNC_OFF(level, fmt, ##__VA_ARGS__)
63 #define PMD_DEBUG_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
67 /* Debug macro for reporting FPGA statistics */
68 #ifdef RTE_LIBRTE_ARK_DEBUG_STATS
69 #define PMD_STATS_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
71 #define PMD_STATS_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
75 /* Debug macro for RX path */
76 #ifdef RTE_LIBRTE_ARK_DEBUG_RX
77 #define ARK_RX_DEBUG 1
78 #define PMD_RX_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
80 #define ARK_RX_DEBUG 0
81 #define PMD_RX_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
84 /* Debug macro for TX path */
85 #ifdef RTE_LIBRTE_ARK_DEBUG_TX
86 #define ARK_TX_DEBUG 1
87 #define PMD_TX_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
89 #define ARK_TX_DEBUG 0
90 #define PMD_TX_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)