2019-09-27 08:33:41 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2015-11-30 10:25:35 +00:00
|
|
|
* Copyright (c) 2014, 2015 Netronome Systems, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NFP_NET_LOGS_H_
|
|
|
|
#define _NFP_NET_LOGS_H_
|
|
|
|
|
|
|
|
#include <rte_log.h>
|
|
|
|
|
2017-12-19 06:38:36 +00:00
|
|
|
extern int nfp_logtype_init;
|
2015-11-30 10:25:35 +00:00
|
|
|
#define PMD_INIT_LOG(level, fmt, args...) \
|
2018-04-25 15:45:47 +00:00
|
|
|
rte_log(RTE_LOG_ ## level, nfp_logtype_init, \
|
|
|
|
"%s(): " fmt "\n", __func__, ## args)
|
2015-11-30 10:25:35 +00:00
|
|
|
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
|
|
|
|
|
|
|
|
#ifdef RTE_LIBRTE_NFP_NET_DEBUG_RX
|
|
|
|
#define PMD_RX_LOG(level, fmt, args...) \
|
2018-04-25 15:45:50 +00:00
|
|
|
RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args)
|
2015-11-30 10:25:35 +00:00
|
|
|
#else
|
|
|
|
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RTE_LIBRTE_NFP_NET_DEBUG_TX
|
|
|
|
#define PMD_TX_LOG(level, fmt, args...) \
|
2018-04-25 15:45:50 +00:00
|
|
|
RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args)
|
2017-12-19 06:38:36 +00:00
|
|
|
#define ASSERT(x) if (!(x)) rte_panic("NFP_NET: x")
|
2015-11-30 10:25:35 +00:00
|
|
|
#else
|
|
|
|
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
|
2017-12-19 06:38:36 +00:00
|
|
|
#define ASSERT(x) do { } while (0)
|
2015-11-30 10:25:35 +00:00
|
|
|
#endif
|
|
|
|
|
2019-01-11 13:25:53 +00:00
|
|
|
#define RTE_LIBRTE_NFP_NET_DEBUG_CPP
|
|
|
|
|
|
|
|
#ifdef RTE_LIBRTE_NFP_NET_DEBUG_CPP
|
|
|
|
#define PMD_CPP_LOG(level, fmt, args...) \
|
|
|
|
RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
|
|
|
|
#else
|
|
|
|
#define PMD_CPP_LOG(level, fmt, args...) do { } while (0)
|
|
|
|
#endif
|
|
|
|
|
2017-12-19 06:38:36 +00:00
|
|
|
extern int nfp_logtype_driver;
|
2015-11-30 10:25:35 +00:00
|
|
|
#define PMD_DRV_LOG(level, fmt, args...) \
|
2017-12-19 06:38:36 +00:00
|
|
|
rte_log(RTE_LOG_ ## level, nfp_logtype_driver, \
|
2018-04-25 15:45:48 +00:00
|
|
|
"%s(): " fmt "\n", __func__, ## args)
|
2015-11-30 10:25:35 +00:00
|
|
|
|
|
|
|
#endif /* _NFP_NET_LOGS_H_ */
|