From 65e845785f21e6b43c026f092e982171eec1f641 Mon Sep 17 00:00:00 2001 From: Pavel Kotucek Date: Mon, 16 Jan 2017 17:01:56 +0100 Subject: 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 --- src/vnet/ethernet/format.c | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) (limited to 'src/vnet/ethernet/format.c') 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 @@ -87,30 +87,6 @@ format_ethernet_vlan_tci (u8 * s, va_list * va) return s; } -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) { @@ -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; -- cgit 1.2.3-korg