xref: /dpdk/drivers/net/nfp/nfp_logs.h (revision 2b843cac232eb3f2fa79e4254e21766817e2019f)
18d7a59f1SHeinrich Kuhn /* SPDX-License-Identifier: BSD-3-Clause
28d7a59f1SHeinrich Kuhn  * Copyright (c) 2014, 2015 Netronome Systems, Inc.
38d7a59f1SHeinrich Kuhn  * All rights reserved.
48d7a59f1SHeinrich Kuhn  */
58d7a59f1SHeinrich Kuhn 
672de00c6SChaoyong He #ifndef __NFP_LOGS_H__
772de00c6SChaoyong He #define __NFP_LOGS_H__
88d7a59f1SHeinrich Kuhn 
98d7a59f1SHeinrich Kuhn #include <rte_log.h>
108d7a59f1SHeinrich Kuhn 
118d7a59f1SHeinrich Kuhn extern int nfp_logtype_init;
12*2b843cacSDavid Marchand #define RTE_LOGTYPE_NFP_INIT nfp_logtype_init
13*2b843cacSDavid Marchand #define PMD_INIT_LOG(level, ...) \
14*2b843cacSDavid Marchand 	RTE_LOG_LINE_PREFIX(level, NFP_INIT, "%s(): ", __func__, __VA_ARGS__)
158d7a59f1SHeinrich Kuhn 
163a5b6aaaSLong Wu #ifdef RTE_ETHDEV_DEBUG_RX
1754fdb550SChaoyong He extern int nfp_logtype_rx;
18*2b843cacSDavid Marchand #define RTE_LOGTYPE_NFP_RX nfp_logtype_rx
19*2b843cacSDavid Marchand #define PMD_RX_LOG(level, ...) \
20*2b843cacSDavid Marchand 	RTE_LOG_LINE_PREFIX(level, NFP_RX, "%s(): ", __func__, __VA_ARGS__)
218d7a59f1SHeinrich Kuhn #else
22*2b843cacSDavid Marchand #define PMD_RX_LOG(...) do { } while (0)
238d7a59f1SHeinrich Kuhn #endif
248d7a59f1SHeinrich Kuhn 
253a5b6aaaSLong Wu #ifdef RTE_ETHDEV_DEBUG_TX
2654fdb550SChaoyong He extern int nfp_logtype_tx;
27*2b843cacSDavid Marchand #define RTE_LOGTYPE_NFP_TX nfp_logtype_tx
28*2b843cacSDavid Marchand #define PMD_TX_LOG(level, ...) \
29*2b843cacSDavid Marchand 	RTE_LOG_LINE_PREFIX(level, NFP_TX, "%s(): ", __func__, __VA_ARGS__)
308d7a59f1SHeinrich Kuhn #else
31*2b843cacSDavid Marchand #define PMD_TX_LOG(...) do { } while (0)
328d7a59f1SHeinrich Kuhn #endif
338d7a59f1SHeinrich Kuhn 
34da5c60d7SLong Wu extern int nfp_logtype_cpp;
35*2b843cacSDavid Marchand #define RTE_LOGTYPE_NFP_CPP nfp_logtype_cpp
36*2b843cacSDavid Marchand #define PMD_CPP_LOG(level, ...) \
37*2b843cacSDavid Marchand 	RTE_LOG_LINE_PREFIX(level, NFP_CPP, "%s(): ", __func__, __VA_ARGS__)
388d7a59f1SHeinrich Kuhn 
398d7a59f1SHeinrich Kuhn extern int nfp_logtype_driver;
40*2b843cacSDavid Marchand #define RTE_LOGTYPE_NFP_DRIVER nfp_logtype_driver
41*2b843cacSDavid Marchand #define PMD_DRV_LOG(level, ...) \
42*2b843cacSDavid Marchand 	RTE_LOG_LINE_PREFIX(level, NFP_DRIVER, "%s(): ", __func__, __VA_ARGS__)
438d7a59f1SHeinrich Kuhn 
4472de00c6SChaoyong He #endif /* __NFP_LOGS_H__ */
45