net/sfc: add init on attach
[dpdk.git] / drivers / net / sfc / sfc_debug.h
index f18ac7d..a541ffc 100644 (file)
 #define SFC_ASSERT(exp)                        RTE_ASSERT(exp)
 #endif
 
+/* Log PMD message, automatically add prefix and \n */
+#define sfc_panic(sa, fmt, args...) \
+       do {                                                            \
+               const struct rte_eth_dev *_dev = (sa)->eth_dev;         \
+               const struct rte_pci_device *_pci_dev = SFC_DEV_TO_PCI(_dev); \
+                                                                       \
+               rte_panic("sfc " PCI_PRI_FMT " #%" PRIu8 ": " fmt "\n", \
+                         _pci_dev->addr.domain, _pci_dev->addr.bus,    \
+                         _pci_dev->addr.devid, _pci_dev->addr.function,\
+                         _dev->data->port_id, ##args);                 \
+       } while (0)
+
 #endif /* _SFC_DEBUG_H_ */