summaryrefslogtreecommitdiffstats
path: root/src/plugins/avf/avf.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-06-17 20:44:19 +0200
committerFlorin Coras <florin.coras@gmail.com>2019-06-18 02:08:21 +0000
commit217e7c9741596e3ad424f80b3f746faf050c2161 (patch)
tree9aac68e47f8a23cf647fb6b4e4edd241126d13f3 /src/plugins/avf/avf.h
parentdfa47ddf85adc1245647d4108a1a7a15c2b79969 (diff)
avf: add logging macros and improve logging
Type: feature Change-Id: I3d7009505ddbb2c41d8619d9195c6a5373fa9a04 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/avf/avf.h')
-rw-r--r--src/plugins/avf/avf.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/avf/avf.h b/src/plugins/avf/avf.h
index 9836451e012..b0779f2706b 100644
--- a/src/plugins/avf/avf.h
+++ b/src/plugins/avf/avf.h
@@ -38,6 +38,21 @@
#define AVF_TXD_CMD_RS AVF_TXD_CMD(1)
#define AVF_TXD_CMD_RSV AVF_TXD_CMD(2)
+#define avf_log_err(dev, f, ...) \
+ vlib_log (VLIB_LOG_LEVEL_ERR, avf_main.log_class, "%U: " f, \
+ format_vlib_pci_addr, &dev->pci_addr, \
+ ## __VA_ARGS__)
+
+#define avf_log_warn(dev, f, ...) \
+ vlib_log (VLIB_LOG_LEVEL_WARNING, avf_main.log_class, "%U: " f, \
+ format_vlib_pci_addr, &dev->pci_addr, \
+ ## __VA_ARGS__)
+
+#define avf_log_debug(dev, f, ...) \
+ vlib_log (VLIB_LOG_LEVEL_DEBUG, avf_main.log_class, "%U: " f, \
+ format_vlib_pci_addr, &dev->pci_addr, \
+ ## __VA_ARGS__)
+
#define foreach_avf_device_flags \
_(0, INITIALIZED, "initialized") \
_(1, ERROR, "error") \
@@ -158,6 +173,7 @@ typedef struct
u32 rss_key_size;
u32 rss_lut_size;
virtchnl_link_speed_t link_speed;
+ vlib_pci_addr_t pci_addr;
/* stats */
virtchnl_eth_stats_t eth_stats;