1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2014, 2015 Netronome Systems, Inc.
6 #ifndef _NFP_NET_LOGS_H_
7 #define _NFP_NET_LOGS_H_
11 extern int nfp_logtype_init;
12 #define PMD_INIT_LOG(level, fmt, args...) \
13 rte_log(RTE_LOG_ ## level, nfp_logtype_init, \
14 "%s(): " fmt "\n", __func__, ## args)
15 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
17 #ifdef RTE_LIBRTE_NFP_NET_DEBUG_RX
18 #define PMD_RX_LOG(level, fmt, args...) \
19 RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args)
21 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
24 #ifdef RTE_LIBRTE_NFP_NET_DEBUG_TX
25 #define PMD_TX_LOG(level, fmt, args...) \
26 RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args)
27 #define ASSERT(x) if (!(x)) rte_panic("NFP_NET: x")
29 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
30 #define ASSERT(x) do { } while (0)
33 #define RTE_LIBRTE_NFP_NET_DEBUG_CPP
35 #ifdef RTE_LIBRTE_NFP_NET_DEBUG_CPP
36 #define PMD_CPP_LOG(level, fmt, args...) \
37 RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
39 #define PMD_CPP_LOG(level, fmt, args...) do { } while (0)
42 extern int nfp_logtype_driver;
43 #define PMD_DRV_LOG(level, fmt, args...) \
44 rte_log(RTE_LOG_ ## level, nfp_logtype_driver, \
45 "%s(): " fmt "\n", __func__, ## args)
47 #endif /* _NFP_NET_LOGS_H_ */