summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_evpn_mh.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_evpn_mh.c')
-rw-r--r--bgpd/bgp_evpn_mh.c46
1 files changed, 31 insertions, 15 deletions
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c
index ffb1b17..d88c52d 100644
--- a/bgpd/bgp_evpn_mh.c
+++ b/bgpd/bgp_evpn_mh.c
@@ -37,7 +37,7 @@
#include "bgpd/bgp_zebra.h"
#include "bgpd/bgp_addpath.h"
#include "bgpd/bgp_label.h"
-#include "bgpd/bgp_nht.h"
+#include "bgpd/bgp_nhg.h"
#include "bgpd/bgp_mpath.h"
#include "bgpd/bgp_trace.h"
@@ -441,6 +441,10 @@ int bgp_evpn_mh_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
? "esr"
: (vpn ? "ead-evi" : "ead-es"),
&attr->mp_nexthop_global_in);
+
+ frrtrace(4, frr_bgp, evpn_mh_local_ead_es_evi_route_upd,
+ &es->esi, (vpn ? vpn->vni : 0), evp->prefix.route_type,
+ attr->mp_nexthop_global_in);
}
/* Return back the route entry. */
@@ -491,6 +495,8 @@ static int bgp_evpn_mh_route_delete(struct bgp *bgp, struct bgp_evpn_es *es,
: (vpn ? "ead-evi" : "ead-es"),
&es->originator_ip);
+ frrtrace(4, frr_bgp, evpn_mh_local_ead_es_evi_route_del, &es->esi,
+ (vpn ? vpn->vni : 0), p->prefix.route_type, es->originator_ip);
/* Next, locate route node in the global EVPN routing table.
* Note that this table is a 2-level tree (RD-level + Prefix-level)
*/
@@ -2999,8 +3005,8 @@ static struct bgp_evpn_es_vrf *bgp_evpn_es_vrf_create(struct bgp_evpn_es *es,
listnode_add(es->es_vrf_list, &es_vrf->es_listnode);
/* setup the L3 NHG id for the ES */
- es_vrf->nhg_id = bgp_l3nhg_id_alloc();
- es_vrf->v6_nhg_id = bgp_l3nhg_id_alloc();
+ es_vrf->nhg_id = bgp_nhg_id_alloc();
+ es_vrf->v6_nhg_id = bgp_nhg_id_alloc();
if (BGP_DEBUG(evpn_mh, EVPN_MH_ES))
zlog_debug("es %s vrf %u nhg %u v6_nhg %d create", es->esi_str,
@@ -3028,10 +3034,10 @@ static void bgp_evpn_es_vrf_delete(struct bgp_evpn_es_vrf *es_vrf)
/* Remove the NHG resources */
bgp_evpn_l3nhg_deactivate(es_vrf);
if (es_vrf->nhg_id)
- bgp_l3nhg_id_free(es_vrf->nhg_id);
+ bgp_nhg_id_free(es_vrf->nhg_id);
es_vrf->nhg_id = 0;
if (es_vrf->v6_nhg_id)
- bgp_l3nhg_id_free(es_vrf->v6_nhg_id);
+ bgp_nhg_id_free(es_vrf->v6_nhg_id);
es_vrf->v6_nhg_id = 0;
/* remove from the ES's VRF list */
@@ -3460,6 +3466,10 @@ static void bgp_evpn_es_evi_vtep_add(struct bgp *bgp,
evi_vtep->es_evi->vpn->vni, &evi_vtep->vtep_ip,
ead_es ? "ead_es" : "ead_evi");
+ frrtrace(4, frr_bgp, evpn_mh_es_evi_vtep_add,
+ &evi_vtep->es_evi->es->esi, evi_vtep->es_evi->vpn->vni,
+ evi_vtep->vtep_ip, ead_es);
+
if (ead_es)
SET_FLAG(evi_vtep->flags, BGP_EVPN_EVI_VTEP_EAD_PER_ES);
else
@@ -3484,6 +3494,10 @@ static void bgp_evpn_es_evi_vtep_del(struct bgp *bgp,
evi_vtep->es_evi->vpn->vni, &evi_vtep->vtep_ip,
ead_es ? "ead_es" : "ead_evi");
+ frrtrace(4, frr_bgp, evpn_mh_es_evi_vtep_del,
+ &evi_vtep->es_evi->es->esi, evi_vtep->es_evi->vpn->vni,
+ evi_vtep->vtep_ip, ead_es);
+
if (ead_es)
UNSET_FLAG(evi_vtep->flags, BGP_EVPN_EVI_VTEP_EAD_PER_ES);
else
@@ -4443,13 +4457,13 @@ static void bgp_evpn_nh_zebra_update_send(struct bgp_evpn_nh *nh, bool add)
stream_putw_at(s, 0, stream_get_endp(s));
- if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) {
+ if (BGP_DEBUG(evpn_mh, EVPN_MH_ES) || bgp_debug_zebra(NULL)) {
if (add)
- zlog_debug("evpn vrf %s nh %s rmac %pEA add to zebra",
+ zlog_debug("evpn %s nh %s rmac %pEA add to zebra",
nh->bgp_vrf->name_pretty, nh->nh_str,
&nh->rmac);
- else if (BGP_DEBUG(evpn_mh, EVPN_MH_ES))
- zlog_debug("evpn vrf %s nh %s del to zebra",
+ else
+ zlog_debug("evpn %s nh %s del to zebra",
nh->bgp_vrf->name_pretty, nh->nh_str);
}
@@ -4632,7 +4646,7 @@ static void bgp_evpn_nh_update_ref_pi(struct bgp_evpn_nh *nh)
continue;
if (BGP_DEBUG(evpn_mh, EVPN_MH_ES))
- zlog_debug("evpn vrf %s nh %s ref_pi update",
+ zlog_debug("evpn %s nh %s ref_pi update",
nh->bgp_vrf->name_pretty, nh->nh_str);
nh->ref_pi = pi;
/* If we have a new pi copy rmac from it and update
@@ -4710,11 +4724,12 @@ static void bgp_evpn_path_nh_unlink(struct bgp_path_evpn_nh_info *nh_info)
pi = nh_info->pi;
if (BGP_DEBUG(evpn_mh, EVPN_MH_RT))
- zlog_debug("path %s unlinked from nh %s %s",
+ zlog_debug("path %s unlinked from %s nh %s pathcount %u",
pi->net ? prefix2str(&pi->net->rn->p, prefix_buf,
sizeof(prefix_buf))
: "",
- nh->bgp_vrf->name_pretty, nh->nh_str);
+ nh->bgp_vrf->name_pretty, nh->nh_str,
+ listcount(nh->pi_list));
list_delete_node(nh->pi_list, &nh_info->nh_listnode);
@@ -4745,7 +4760,7 @@ static void bgp_evpn_path_nh_link(struct bgp *bgp_vrf, struct bgp_path_info *pi)
if (!bgp_vrf->evpn_nh_table) {
if (BGP_DEBUG(evpn_mh, EVPN_MH_RT))
- zlog_debug("path %pFX linked to vrf %s failed",
+ zlog_debug("path %pFX linked to %s failed",
&pi->net->rn->p, bgp_vrf->name_pretty);
return;
}
@@ -4793,8 +4808,9 @@ static void bgp_evpn_path_nh_link(struct bgp *bgp_vrf, struct bgp_path_info *pi)
bgp_evpn_path_nh_unlink(nh_info);
if (BGP_DEBUG(evpn_mh, EVPN_MH_RT))
- zlog_debug("path %pFX linked to nh %s %s", &pi->net->rn->p,
- nh->bgp_vrf->name_pretty, nh->nh_str);
+ zlog_debug("path %pFX linked to %s nh %s pathcount %u",
+ &pi->net->rn->p, nh->bgp_vrf->name_pretty,
+ nh->nh_str, listcount(nh->pi_list));
/* link mac-ip path to the new nh */
nh_info->nh = nh;