diff options
author | Damjan Marion <damarion@cisco.com> | 2018-04-17 19:26:31 +0200 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-04-17 20:13:17 +0000 |
commit | 89b16e66a4f3df9c3851702a3d186947ed377f82 (patch) | |
tree | 73e3b45857b7f6da187427e00c7730351f4e0ba7 /src/plugins/dpdk/device/format.c | |
parent | 669d07dc016757b856e1014a415996cf9f0ebc58 (diff) |
dpdk: print device flags in the 'show hardware' output
Change-Id: I0d10f13a56420b119fdfad97dcc135b245c269e1
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 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c index 36f921d598b..d37cc8c0664 100644 --- a/src/plugins/dpdk/device/format.c +++ b/src/plugins/dpdk/device/format.c @@ -255,6 +255,21 @@ format_dpdk_device_name (u8 * s, va_list * args) return ret; } +u8 * +format_dpdk_device_flags (u8 * s, va_list * args) +{ + dpdk_device_t *xd = va_arg (*args, dpdk_device_t *); + u8 *t = 0; + +#define _(a, b, c) if (xd->flags & (1 << a)) \ +t = format (t, "%s%s", t ? " ":"", c); + foreach_dpdk_device_flags +#undef _ + s = format (s, "%v", t); + vec_free (t); + return s; +} + static u8 * format_dpdk_device_type (u8 * s, va_list * args) { @@ -463,6 +478,8 @@ format_dpdk_device (u8 * s, va_list * args) s = format (s, "%U\n%Ucarrier %U", format_dpdk_device_type, xd->device_index, format_white_space, indent + 2, format_dpdk_link_status, xd); + s = format (s, "%Uflags: %U\n", + format_white_space, indent + 2, format_dpdk_device_flags, xd); rte_eth_dev_info_get (xd->device_index, &di); |