summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/dpdk.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-04-18 17:00:18 +0200
committerFlorin Coras <florin.coras@gmail.com>2018-04-18 18:00:56 +0000
commit5b6ae8de4fd0d7855f8f38426dd4524ebcb15fee (patch)
tree98a8b6ad2dd5a5f4edfb828f4b07961cb4ac05c7 /src/plugins/dpdk/device/dpdk.h
parente78fab8f5b8afe5bb1b0a2003f1a2384b07ed87f (diff)
dpdk: improve logging
- use of vlib_log for non-dataplane logging - redirect of dpdk logs trough unix pipe into vlib_log - "show dpdk physmem" cli Change-Id: I5da70f9c130273072a8cc80d169df31fc216b2c2 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/dpdk.h')
-rw-r--r--src/plugins/dpdk/device/dpdk.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index d52e96634e2..896617bd55f 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -400,6 +400,9 @@ typedef struct
/* API message ID base */
u16 msg_id_base;
+
+ /* logging */
+ vlib_log_class_t log_default;
} dpdk_main_t;
extern dpdk_main_t dpdk_main;
@@ -450,6 +453,15 @@ typedef enum
DPDK_N_ERROR,
} dpdk_error_t;
+#define dpdk_log_err(...) \
+ vlib_log(VLIB_LOG_LEVEL_ERR, dpdk_main.log_default, __VA_ARGS__)
+#define dpdk_log_warn(...) \
+ vlib_log(VLIB_LOG_LEVEL_WARNING, dpdk_main.log_default, __VA_ARGS__)
+#define dpdk_log_notice(...) \
+ vlib_log(VLIB_LOG_LEVEL_NOTICE, dpdk_main.log_default, __VA_ARGS__)
+#define dpdk_log_info(...) \
+ vlib_log(VLIB_LOG_LEVEL_INFO, dpdk_main.log_default, __VA_ARGS__)
+
void dpdk_update_link_state (dpdk_device_t * xd, f64 now);
format_function_t format_dpdk_device_name;