From: Alexander Chernavin Date: Fri, 26 Apr 2019 14:43:09 +0000 (-0400) Subject: IF: return VTR attributes for all ifs in dump API X-Git-Tag: v20.01-rc0~719 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F96%2F19196%2F1;p=vpp.git IF: return VTR attributes for all ifs in dump API With this commit, VTR attributes are shown not only for subinterfaces but for all interfaces. Change-Id: I498185d905c0bf48431cddb916165f8e9c841b1f Signed-off-by: Alexander Chernavin --- diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c index 4cd2ec95b0f..b896433e959 100644 --- a/src/vnet/interface_api.c +++ b/src/vnet/interface_api.c @@ -239,38 +239,38 @@ send_sw_interface_details (vpe_api_main_t * am, mp->sub_default = sub->eth.flags.default_sub; mp->sub_outer_vlan_id_any = sub->eth.flags.outer_vlan_id_any; mp->sub_inner_vlan_id_any = sub->eth.flags.inner_vlan_id_any; + } - /* vlan tag rewrite data */ - u32 vtr_op = L2_VTR_DISABLED; - u32 vtr_push_dot1q = 0, vtr_tag1 = 0, vtr_tag2 = 0; + /* vlan tag rewrite data */ + u32 vtr_op = L2_VTR_DISABLED; + u32 vtr_push_dot1q = 0, vtr_tag1 = 0, vtr_tag2 = 0; - if (l2vtr_get (am->vlib_main, am->vnet_main, swif->sw_if_index, - &vtr_op, &vtr_push_dot1q, &vtr_tag1, &vtr_tag2) != 0) - { - // error - default to disabled - mp->vtr_op = ntohl (L2_VTR_DISABLED); - clib_warning ("cannot get vlan tag rewrite for sw_if_index %d", - swif->sw_if_index); - } - else - { - mp->vtr_op = ntohl (vtr_op); - mp->vtr_push_dot1q = ntohl (vtr_push_dot1q); - mp->vtr_tag1 = ntohl (vtr_tag1); - mp->vtr_tag2 = ntohl (vtr_tag2); - } + if (l2vtr_get (am->vlib_main, am->vnet_main, swif->sw_if_index, + &vtr_op, &vtr_push_dot1q, &vtr_tag1, &vtr_tag2) != 0) + { + // error - default to disabled + mp->vtr_op = ntohl (L2_VTR_DISABLED); + clib_warning ("cannot get vlan tag rewrite for sw_if_index %d", + swif->sw_if_index); + } + else + { + mp->vtr_op = ntohl (vtr_op); + mp->vtr_push_dot1q = ntohl (vtr_push_dot1q); + mp->vtr_tag1 = ntohl (vtr_tag1); + mp->vtr_tag2 = ntohl (vtr_tag2); } /* pbb tag rewrite data */ ethernet_header_t eth_hdr; - u32 vtr_op = L2_VTR_DISABLED; + u32 pbb_vtr_op = L2_VTR_DISABLED; u16 outer_tag = 0; u16 b_vlanid = 0; u32 i_sid = 0; clib_memset (ð_hdr, 0, sizeof (eth_hdr)); if (!l2pbb_get (am->vlib_main, am->vnet_main, swif->sw_if_index, - &vtr_op, &outer_tag, ð_hdr, &b_vlanid, &i_sid)) + &pbb_vtr_op, &outer_tag, ð_hdr, &b_vlanid, &i_sid)) { mp->sub_dot1ah = 1; clib_memcpy (mp->b_dmac, eth_hdr.dst_address,