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"
31 #define PMD_DRV_LOG(level, fmt, args...) \
32 RTE_LOG(level, PMD, fmt, ## args)
34 /* Conditional trace definitions */
35 #define ARK_TRACE_ON(level, fmt, ...) \
36 RTE_LOG(level, PMD, fmt, ##__VA_ARGS__)
38 /* This pattern allows compiler check arguments even if disabled */
39 #define ARK_TRACE_OFF(level, fmt, ...) \
40 do {if (0) RTE_LOG(level, PMD, fmt, ##__VA_ARGS__); } \
44 /* tracing including the function name */
45 #define ARK_FUNC_ON(level, fmt, args...) \
46 RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
48 /* tracing including the function name */
49 #define ARK_FUNC_OFF(level, fmt, args...) \
50 do { if (0) RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args); } \
54 /* Debug macro for tracing full behavior, function tracing and messages*/
55 #ifdef RTE_LIBRTE_ARK_DEBUG_TRACE
56 #define PMD_FUNC_LOG(level, fmt, ...) ARK_FUNC_ON(level, fmt, ##__VA_ARGS__)
57 #define PMD_DEBUG_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
59 #define PMD_FUNC_LOG(level, fmt, ...) ARK_FUNC_OFF(level, fmt, ##__VA_ARGS__)
60 #define PMD_DEBUG_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
64 /* Debug macro for reporting FPGA statistics */
65 #ifdef RTE_LIBRTE_ARK_DEBUG_STATS
66 #define PMD_STATS_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
68 #define PMD_STATS_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
72 /* Debug macro for RX path */
73 #ifdef RTE_LIBRTE_ARK_DEBUG_RX
74 #define ARK_RX_DEBUG 1
75 #define PMD_RX_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
77 #define ARK_RX_DEBUG 0
78 #define PMD_RX_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
81 /* Debug macro for TX path */
82 #ifdef RTE_LIBRTE_ARK_DEBUG_TX
83 #define ARK_TX_DEBUG 1
84 #define PMD_TX_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
86 #define ARK_TX_DEBUG 0
87 #define PMD_TX_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)