summaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2017-01-16 17:01:56 +0100
committerJohn Lo <loj@cisco.com>2017-02-21 00:00:12 +0000
commit65e845785f21e6b43c026f092e982171eec1f641 (patch)
treeb0fed4d7d055d61e1c659030eef8950ab8460151 /src/vnet/ethernet
parent9745aceb240d4586c47869203f48479c58e0f86e (diff)
VPP-540 : pbb tag rewrite details
Extended sw_interface_dump to provide 802.1ah (pbb) tag rewrite info if present. Extended log "l2-output" to provide raw data to display result of prospetive pbb tag rewrite. Tracing is moved after l2output_vtr to show these changes. Change-Id: I8b7cb865dc67ce21afab402cc086dac35f7c0f07 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'src/vnet/ethernet')
-rw-r--r--src/vnet/ethernet/format.c38
1 files changed, 10 insertions, 28 deletions
diff --git a/src/vnet/ethernet/format.c b/src/vnet/ethernet/format.c
index 4edef5adbeb..5b58999861a 100644
--- a/src/vnet/ethernet/format.c
+++ b/src/vnet/ethernet/format.c
@@ -88,30 +88,6 @@ format_ethernet_vlan_tci (u8 * s, va_list * va)
}
u8 *
-format_ethernet_pbb (u8 * s, va_list * va)
-{
- u32 b_tag = va_arg (*va, u32);
- u32 i_tag = va_arg (*va, u32);
- u32 vid = (b_tag & 0xfff);
- u32 bdei = (b_tag >> 12) & 1;
- u32 bpcp = (b_tag >> 13);
- u32 sid = (i_tag & 0xffffff);
- u8 ires = (i_tag >> 24) & 3;
- u8 iuca = (i_tag >> 27) & 1;
- u8 idei = (i_tag >> 28) & 1;
- u8 ipcp = (i_tag >> 29);
-
- s =
- format (s, "B_tag %04X (vid %d, dei %d, pcp %d), ", b_tag, vid, bdei,
- bpcp);
- s =
- format (s, "I_tag %08X (sid %d, res %d, dei %d, pcp %d)", i_tag, sid,
- ires, iuca, idei, ipcp);
-
- return s;
-}
-
-u8 *
format_ethernet_header_with_length (u8 * s, va_list * args)
{
ethernet_pbb_header_packed_t *ph =
@@ -177,10 +153,16 @@ format_ethernet_header_with_length (u8 * s, va_list * args)
}
else
{
- s = format (s, "\n%UPBB header : %U", format_white_space, indent,
- format_ethernet_pbb,
- clib_net_to_host_u16 (ph->priority_dei_id),
- clib_net_to_host_u32 (ph->priority_dei_uca_res_sid));
+ s =
+ format (s, " %s b-tag %04X",
+ (clib_net_to_host_u16 (ph->b_type) ==
+ ETHERNET_TYPE_DOT1AD) ? "802.1ad" : "",
+ clib_net_to_host_u16 (ph->priority_dei_id));
+ s =
+ format (s, " %s i-tag %08X",
+ (clib_net_to_host_u16 (ph->i_type) ==
+ ETHERNET_TYPE_DOT1AH) ? "802.1ah" : "",
+ clib_net_to_host_u32 (ph->priority_dei_uca_res_sid));
}
return s;