diff options
author | Damjan Marion <damarion@cisco.com> | 2017-05-11 16:53:02 +0200 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2017-05-15 19:03:22 +0000 |
commit | 12059c9b6da0536a74d3003cebed61225a8a8ee7 (patch) | |
tree | 59d52a498eb13ef94fa05aa51f5759f00a13c7ba /src/plugins/dpdk/device/format.c | |
parent | 7bfa119ead548fcca869bac7e777ce7137dc933b (diff) |
dpdk: improve error handling during device initialization
Change-Id: Ib390164abb07ca0d38fd49e7e2e6b4e9ea856405
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/format.c')
-rw-r--r-- | src/plugins/dpdk/device/format.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c index 3b75563d0b5..0b67eae3c45 100644 --- a/src/plugins/dpdk/device/format.c +++ b/src/plugins/dpdk/device/format.c @@ -377,6 +377,20 @@ format_dpdk_tx_offload_caps (u8 * s, va_list * args) #undef _ u8 * +format_dpdk_device_errors (u8 * s, va_list * args) +{ + dpdk_device_t *xd = va_arg (*args, dpdk_device_t *); + clib_error_t *e; + uword indent = format_get_indent (s); + + vec_foreach (e, xd->errors) + { + s = format (s, "%U%v\n", format_white_space, indent, e->what); + } + return s; +} + +u8 * format_dpdk_device (u8 * s, va_list * args) { u32 dev_instance = va_arg (*args, u32); @@ -511,6 +525,12 @@ format_dpdk_device (u8 * s, va_list * args) vec_free (xs); } + if (vec_len (xd->errors)) + { + s = format (s, "%UErrors:\n %U", format_white_space, indent, + format_dpdk_device_errors, xd); + } + return s; } |