From: Anuradha Karuppiah Date: Tue, 19 May 2020 00:52:52 +0000 (-0700) Subject: zebra: change the nhg format from hex to dec for easy match up with the dp X-Git-Tag: base_7.6~208^2~3 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=dfa3d3d70ab64b50650dff6f0734aec6a4dc54d5;p=matthieu%2Ffrr.git zebra: change the nhg format from hex to dec for easy match up with the dp Dataplane/kernel prints the NHG and NH ids as decimal. Zebra was printing it as hex (to display type vs. val). This became a debugging hassle hence normalizing the format. Signed-off-by: Anuradha Karuppiah --- diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index 692dfca5d7..b08adc5541 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -1024,8 +1024,8 @@ static void zebra_evpn_nhg_update(struct zebra_evpn_es *es) nh_ids[i].id); strlcat(nh_str, nh_buf, sizeof(nh_str)); } - zlog_debug("es %s nhg 0x%x add %s", - es->esi_str, es->nhg_id, nh_str); + zlog_debug("es %s nhg %u add %s", es->esi_str, + es->nhg_id, nh_str); } es->flags |= ZEBRA_EVPNES_NHG_ACTIVE; @@ -1040,8 +1040,8 @@ static void zebra_evpn_nhg_update(struct zebra_evpn_es *es) } else { if (es->flags & ZEBRA_EVPNES_NHG_ACTIVE) { if (IS_ZEBRA_DEBUG_EVPN_MH_NH) - zlog_debug("es %s nhg 0x%x del", - es->esi_str, es->nhg_id); + zlog_debug("es %s nhg %u del", es->esi_str, + es->nhg_id); es->flags &= ~ZEBRA_EVPNES_NHG_ACTIVE; /* remove backup NHG from the br-port */ if ((es->flags & ZEBRA_EVPNES_LOCAL)) @@ -1065,9 +1065,8 @@ static void zebra_evpn_nh_add(struct zebra_evpn_es_vtep *es_vtep) return; if (IS_ZEBRA_DEBUG_EVPN_MH_NH) - zlog_debug("es %s vtep %pI4 nh 0x%x add", - es_vtep->es->esi_str, - &es_vtep->vtep_ip, es_vtep->nh_id); + zlog_debug("es %s vtep %pI4 nh %u add", es_vtep->es->esi_str, + &es_vtep->vtep_ip, es_vtep->nh_id); /* install the NH */ kernel_upd_mac_nh(es_vtep->nh_id, es_vtep->vtep_ip); /* add the NH to the parent NHG */ @@ -1082,9 +1081,8 @@ static void zebra_evpn_nh_del(struct zebra_evpn_es_vtep *es_vtep) return; if (IS_ZEBRA_DEBUG_EVPN_MH_NH) - zlog_debug("es %s vtep %pI4 nh 0x%x del", - es_vtep->es->esi_str, - &es_vtep->vtep_ip, es_vtep->nh_id); + zlog_debug("es %s vtep %pI4 nh %u del", es_vtep->es->esi_str, + &es_vtep->vtep_ip, es_vtep->nh_id); nh_id = es_vtep->nh_id; es_vtep->nh_id = 0; @@ -1427,7 +1425,7 @@ static struct zebra_evpn_es *zebra_evpn_es_new(esi_t *esi) es->nhg_id = zebra_evpn_nhid_alloc(true); if (IS_ZEBRA_DEBUG_EVPN_MH_ES) - zlog_debug("es %s nhg 0x%x new", es->esi_str, es->nhg_id); + zlog_debug("es %s nhg %u new", es->esi_str, es->nhg_id); return es; } @@ -1667,8 +1665,8 @@ static void zebra_evpn_es_local_info_set(struct zebra_evpn_es *es, return; if (IS_ZEBRA_DEBUG_EVPN_MH_ES) - zlog_debug("local es %s add; nhg 0x%x if %s", - es->esi_str, es->nhg_id, zif->ifp->name); + zlog_debug("local es %s add; nhg %u if %s", es->esi_str, + es->nhg_id, zif->ifp->name); es->flags |= ZEBRA_EVPNES_LOCAL; listnode_init(&es->local_es_listnode, es); @@ -1778,9 +1776,8 @@ static void zebra_evpn_local_es_del(struct zebra_evpn_es **esp) if (IS_ZEBRA_DEBUG_EVPN_MH_ES) { zif = es->zif; - zlog_debug("local es %s del; nhg 0x%x if %s", - es->esi_str, es->nhg_id, - zif ? zif->ifp->name : "-"); + zlog_debug("local es %s del; nhg %u if %s", es->esi_str, + es->nhg_id, zif ? zif->ifp->name : "-"); } /* remove all ES-EVIs associated with the ES */ @@ -1804,15 +1801,15 @@ static void zebra_evpn_es_remote_info_re_eval(struct zebra_evpn_es **esp) if (!(es->flags & ZEBRA_EVPNES_REMOTE)) { es->flags |= ZEBRA_EVPNES_REMOTE; if (IS_ZEBRA_DEBUG_EVPN_MH_ES) - zlog_debug("remote es %s add; nhg 0x%x", - es->esi_str, es->nhg_id); + zlog_debug("remote es %s add; nhg %u", + es->esi_str, es->nhg_id); } } else { if (es->flags & ZEBRA_EVPNES_REMOTE) { es->flags &= ~ZEBRA_EVPNES_REMOTE; if (IS_ZEBRA_DEBUG_EVPN_MH_ES) - zlog_debug("remote es %s del; nhg 0x%x", - es->esi_str, es->nhg_id); + zlog_debug("remote es %s del; nhg %u", + es->esi_str, es->nhg_id); zebra_evpn_es_free(esp); } } @@ -2398,7 +2395,7 @@ static void zebra_evpn_es_show_entry_detail(struct vty *vty, vty_out(vty, " DF: status: %s preference: %u\n", (es->flags & ZEBRA_EVPNES_NON_DF) ? "non-df" : "df", es->df_pref); - vty_out(vty, " Nexthop group: 0x%x\n", es->nhg_id); + vty_out(vty, " Nexthop group: %u\n", es->nhg_id); vty_out(vty, " VTEPs:\n"); for (ALL_LIST_ELEMENTS_RO(es->es_vtep_list, node, es_vtep)) { vty_out(vty, " %pI4", @@ -2409,7 +2406,7 @@ static void zebra_evpn_es_show_entry_detail(struct vty *vty, alg_buf, sizeof(alg_buf)), es_vtep->df_pref); - vty_out(vty, " nh: 0x%x\n", es_vtep->nh_id); + vty_out(vty, " nh: %u\n", es_vtep->nh_id); } vty_out(vty, "\n");