summaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet/sfp.c
diff options
context:
space:
mode:
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;
}