summaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet/sfp.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-09-24 15:17:36 +0200
committerNeale Ranns <nranns@cisco.com>2018-09-25 12:16:57 +0000
commitc45e190f70e0317b62eeec23ad92a80b81e0b384 (patch)
tree9bfdc43d65562da147585a6efb7e042fefc75275 /src/vnet/ethernet/sfp.c
parentfe4e48f617f3e0f62880adebdcfb5989aa4e6db7 (diff)
dpdk: show pluggable info in 'show hardware'
module: id SFP/SFP+/SFP28, compatibility: 40g_active_cable vendor: Amphenol, part NDCCGF-I202 revision: C, serial: APF1711202351C, date code: 170318 cable length: 2m Change-Id: Ife35607b4f078f7b56737fe066ad4cbd247a7504 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/ethernet/sfp.c')
-rw-r--r--src/vnet/ethernet/sfp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/vnet/ethernet/sfp.c b/src/vnet/ethernet/sfp.c
index 0ebdb99339b..182fdbf1d55 100644
--- a/src/vnet/ethernet/sfp.c
+++ b/src/vnet/ethernet/sfp.c
@@ -35,7 +35,7 @@ format_sfp_id (u8 * s, va_list * args)
char *t = 0;
switch (id)
{
-#define _(f) case SFP_ID_##f: t = #f; break;
+#define _(f,str) case SFP_ID_##f: t = str; break;
foreach_sfp_id
#undef _
default:
@@ -84,8 +84,7 @@ format_sfp_eeprom (u8 * s, va_list * args)
u32 indent = format_get_indent (s);
int i;
- if (e->id != SFP_ID_sfp)
- s = format (s, "id %U, ", format_sfp_id, e->id);
+ s = format (s, "id %U, ", format_sfp_id, e->id);
s = format (s, "compatibility:");
for (i = 0; i < SFP_N_COMPATIBILITY; i++)
@@ -105,6 +104,10 @@ format_sfp_eeprom (u8 * s, va_list * args)
e->vendor_serial_number, format_space_terminated,
sizeof (e->vendor_date_code), e->vendor_date_code);
+ if (e->length[4])
+ s = format (s, "\n%Ucable length: %um", format_white_space, indent,
+ e->length[4]);
+
return s;
}