1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright (c) 2016-2018 Solarflare Communications Inc.
6 * This software was jointly developed between OKTET Labs (under contract
7 * for Solarflare) and Solarflare Communications, Inc.
13 /* Log PMD message, automatically add prefix and \n */
14 #define SFC_LOG(sa, level, ...) \
16 const struct sfc_adapter *__sa = (sa); \
19 RTE_FMT("sfc_efx " PCI_PRI_FMT " #%" PRIu8 ": " \
20 RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
21 __sa->pci_addr.domain, \
23 __sa->pci_addr.devid, \
24 __sa->pci_addr.function, \
26 RTE_FMT_TAIL(__VA_ARGS__,))); \
29 #define sfc_err(sa, ...) \
30 SFC_LOG(sa, ERR, __VA_ARGS__)
32 #define sfc_warn(sa, ...) \
33 SFC_LOG(sa, WARNING, __VA_ARGS__)
35 #define sfc_notice(sa, ...) \
36 SFC_LOG(sa, NOTICE, __VA_ARGS__)
38 #define sfc_info(sa, ...) \
39 SFC_LOG(sa, INFO, __VA_ARGS__)
41 #define sfc_log_init(sa, ...) \
43 const struct sfc_adapter *_sa = (sa); \
45 if (_sa->debug_init) \
48 RTE_FMT_HEAD(__VA_ARGS__,), \
50 RTE_FMT_TAIL(__VA_ARGS__,))); \
53 #endif /* _SFC_LOG_H_ */