2018-01-08 13:35:35 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2017-03-16 12:41:08 +00:00
|
|
|
*
|
2018-01-08 13:35:35 +00:00
|
|
|
* Copyright (c) 2016-2018 Solarflare Communications Inc.
|
2016-11-29 16:18:33 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This software was jointly developed between OKTET Labs (under contract
|
|
|
|
* for Solarflare) and Solarflare Communications, Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SFC_DEBUG_H_
|
|
|
|
#define _SFC_DEBUG_H_
|
|
|
|
|
|
|
|
#include <rte_debug.h>
|
|
|
|
|
|
|
|
#ifdef RTE_LIBRTE_SFC_EFX_DEBUG
|
2017-12-09 13:23:58 +00:00
|
|
|
/* Avoid dependency from RTE_LOG_DP_LEVEL to be able to enable debug check
|
2016-11-29 16:18:33 +00:00
|
|
|
* in the driver only.
|
|
|
|
*/
|
|
|
|
#define SFC_ASSERT(exp) RTE_VERIFY(exp)
|
|
|
|
#else
|
|
|
|
/* If the driver debug is not enabled, follow DPDK debug/non-debug */
|
|
|
|
#define SFC_ASSERT(exp) RTE_ASSERT(exp)
|
|
|
|
#endif
|
|
|
|
|
2016-11-29 16:19:03 +00:00
|
|
|
/* Log PMD message, automatically add prefix and \n */
|
|
|
|
#define sfc_panic(sa, fmt, args...) \
|
|
|
|
do { \
|
2017-05-18 14:00:03 +00:00
|
|
|
const struct sfc_adapter *_sa = (sa); \
|
2016-11-29 16:19:03 +00:00
|
|
|
\
|
|
|
|
rte_panic("sfc " PCI_PRI_FMT " #%" PRIu8 ": " fmt "\n", \
|
2017-05-18 14:00:03 +00:00
|
|
|
_sa->pci_addr.domain, _sa->pci_addr.bus, \
|
|
|
|
_sa->pci_addr.devid, _sa->pci_addr.function, \
|
|
|
|
_sa->port_id, ##args); \
|
2016-11-29 16:19:03 +00:00
|
|
|
} while (0)
|
|
|
|
|
2016-11-29 16:18:33 +00:00
|
|
|
#endif /* _SFC_DEBUG_H_ */
|