bgpd: Reevaluate es_evi_vtep active state on disable-ead-evi-rx config flap

Update es_evi_vtep active state and add/delete es_vtep accordingly to
zebra for remote ES.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
This commit is contained in:
Ameya Dharkar 2021-03-09 16:37:52 -08:00
parent b58b399c5b
commit acd1d9bc43
3 changed files with 43 additions and 1 deletions

View File

@ -3847,3 +3847,39 @@ void bgp_evpn_mh_finish(void)
XFREE(MTYPE_BGP_EVPN_MH_INFO, bgp_mh_info);
}
/* This function is called when disable-ead-evi-rx knob flaps */
void bgp_evpn_switch_ead_evi_rx(void)
{
struct bgp *bgp;
struct bgp_evpn_es *es;
struct bgp_evpn_es_evi *es_evi;
struct listnode *evi_node = NULL;
struct listnode *evi_next = NULL;
struct bgp_evpn_es_evi_vtep *vtep;
struct listnode *vtep_node = NULL;
struct listnode *vtep_next = NULL;
bgp = bgp_get_evpn();
if (!bgp)
return;
/*
* Process all the remote es_evi_vteps and reevaluate if the es_evi_vtep
* is active.
*/
RB_FOREACH(es, bgp_es_rb_head, &bgp_mh_info->es_rb_tree) {
if (!CHECK_FLAG(es->flags, BGP_EVPNES_REMOTE))
continue;
for (ALL_LIST_ELEMENTS(es->es_evi_list, evi_node, evi_next,
es_evi)) {
if (!CHECK_FLAG(es_evi->flags, BGP_EVPNES_EVI_REMOTE))
continue;
for (ALL_LIST_ELEMENTS(es_evi->es_evi_vtep_list,
vtep_node, vtep_next, vtep))
bgp_evpn_es_evi_vtep_re_eval_active(bgp, vtep);
}
}
}

View File

@ -376,5 +376,6 @@ extern bool bgp_evpn_path_es_use_nhg(struct bgp *bgp_vrf,
extern void bgp_evpn_es_vrf_show(struct vty *vty, bool uj,
struct bgp_evpn_es *es);
extern void bgp_evpn_es_vrf_show_esi(struct vty *vty, esi_t *esi, bool uj);
extern void bgp_evpn_switch_ead_evi_rx(void);
#endif /* _FRR_BGP_EVPN_MH_H */

View File

@ -3767,7 +3767,12 @@ DEFPY (bgp_evpn_ead_evi_rx_disable,
NO_STR
"Activate PE on EAD-ES even if EAD-EVI is not received\n")
{
bgp_mh_info->ead_evi_rx = no? true :false;
bool ead_evi_rx = no? true :false;
if (ead_evi_rx != bgp_mh_info->ead_evi_rx) {
bgp_mh_info->ead_evi_rx = ead_evi_rx;
bgp_evpn_switch_ead_evi_rx();
}
return CMD_SUCCESS;
}