mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 23:29:36 +00:00
bgpd: rename some MH functions and take care of deffered logs etc.
Rename VTEP change functions for better readability, improve comments and add missing logs. No functional change. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
This commit is contained in:
parent
6c5f54180a
commit
2eef4f20d0
@ -69,8 +69,9 @@ static uint32_t bgp_evpn_es_get_active_vtep_cnt(struct bgp_evpn_es *es);
|
|||||||
static void bgp_evpn_l3nhg_update_on_vtep_chg(struct bgp_evpn_es *es);
|
static void bgp_evpn_l3nhg_update_on_vtep_chg(struct bgp_evpn_es *es);
|
||||||
static struct bgp_evpn_es *bgp_evpn_es_new(struct bgp *bgp, const esi_t *esi);
|
static struct bgp_evpn_es *bgp_evpn_es_new(struct bgp *bgp, const esi_t *esi);
|
||||||
static void bgp_evpn_es_free(struct bgp_evpn_es *es, const char *caller);
|
static void bgp_evpn_es_free(struct bgp_evpn_es *es, const char *caller);
|
||||||
static void bgp_evpn_es_path_all_update(struct bgp_evpn_es_vtep *es_vtep,
|
static void
|
||||||
bool active);
|
bgp_evpn_es_path_update_on_vtep_chg(struct bgp_evpn_es_vtep *es_vtep,
|
||||||
|
bool active);
|
||||||
|
|
||||||
esi_t zero_esi_buf, *zero_esi = &zero_esi_buf;
|
esi_t zero_esi_buf, *zero_esi = &zero_esi_buf;
|
||||||
|
|
||||||
@ -1243,7 +1244,7 @@ static void bgp_evpn_es_vtep_re_eval_active(struct bgp *bgp,
|
|||||||
* removed.
|
* removed.
|
||||||
*/
|
*/
|
||||||
bgp_evpn_l3nhg_update_on_vtep_chg(es_vtep->es);
|
bgp_evpn_l3nhg_update_on_vtep_chg(es_vtep->es);
|
||||||
bgp_evpn_es_path_all_update(es_vtep, new_active);
|
bgp_evpn_es_path_update_on_vtep_chg(es_vtep, new_active);
|
||||||
|
|
||||||
/* queue up the es for background consistency checks */
|
/* queue up the es for background consistency checks */
|
||||||
bgp_evpn_es_cons_checks_pend_add(es_vtep->es);
|
bgp_evpn_es_cons_checks_pend_add(es_vtep->es);
|
||||||
@ -1441,18 +1442,19 @@ void bgp_evpn_path_es_link(struct bgp_path_info *pi, vni_t vni, esi_t *esi)
|
|||||||
listnode_add(es->macip_path_list, &es_info->es_listnode);
|
listnode_add(es->macip_path_list, &es_info->es_listnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bgp_evpn_es_path_all_update(struct bgp_evpn_es_vtep *es_vtep,
|
static void
|
||||||
bool active)
|
bgp_evpn_es_path_update_on_vtep_chg(struct bgp_evpn_es_vtep *es_vtep,
|
||||||
|
bool active)
|
||||||
{
|
{
|
||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
struct bgp_path_es_info *es_info;
|
struct bgp_path_es_info *es_info;
|
||||||
struct bgp_path_info *pi;
|
struct bgp_path_info *pi;
|
||||||
struct bgp_path_info *parent_pi;
|
struct bgp_path_info *parent_pi;
|
||||||
struct bgp_evpn_es *es = es_vtep->es;
|
struct bgp_evpn_es *es = es_vtep->es;
|
||||||
char prefix_buf[PREFIX_STRLEN];
|
|
||||||
|
|
||||||
if (BGP_DEBUG(evpn_mh, EVPN_MH_RT))
|
if (BGP_DEBUG(evpn_mh, EVPN_MH_RT))
|
||||||
zlog_debug("update all paths linked to es %s", es->esi_str);
|
zlog_debug("update paths linked to es %s on vtep chg",
|
||||||
|
es->esi_str);
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(es->macip_path_list, node, es_info)) {
|
for (ALL_LIST_ELEMENTS_RO(es->macip_path_list, node, es_info)) {
|
||||||
pi = es_info->pi;
|
pi = es_info->pi;
|
||||||
@ -1470,10 +1472,9 @@ static void bgp_evpn_es_path_all_update(struct bgp_evpn_es_vtep *es_vtep,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (BGP_DEBUG(evpn_mh, EVPN_MH_RT))
|
if (BGP_DEBUG(evpn_mh, EVPN_MH_RT))
|
||||||
zlog_debug("update path %s linked to es %s",
|
zlog_debug(
|
||||||
prefix2str(&parent_pi->net->p, prefix_buf,
|
"update path %pFX linked to es %s on vtep chg",
|
||||||
sizeof(prefix_buf)),
|
&parent_pi->net->p, es->esi_str);
|
||||||
es->esi_str);
|
|
||||||
bgp_evpn_import_route_in_vrfs(parent_pi, active ? 1 : 0);
|
bgp_evpn_import_route_in_vrfs(parent_pi, active ? 1 : 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3170,13 +3171,30 @@ int bgp_evpn_remote_es_evi_del(struct bgp *bgp, struct bgpevpn *vpn,
|
|||||||
vpn->vni, &p->prefix.ead_addr.ip.ipaddr_v4);
|
vpn->vni, &p->prefix.ead_addr.ip.ipaddr_v4);
|
||||||
|
|
||||||
es = bgp_evpn_es_find(&p->prefix.ead_addr.esi);
|
es = bgp_evpn_es_find(&p->prefix.ead_addr.esi);
|
||||||
if (!es)
|
if (!es) {
|
||||||
/* XXX - error logs */
|
if (BGP_DEBUG(evpn_mh, EVPN_MH_ES))
|
||||||
|
zlog_debug("del remote %s es %s evi %u vtep %pI4, NO es",
|
||||||
|
p->prefix.ead_addr.eth_tag ? "ead-es"
|
||||||
|
: "ead-evi",
|
||||||
|
esi_to_str(&p->prefix.ead_addr.esi, buf,
|
||||||
|
sizeof(buf)),
|
||||||
|
vpn->vni,
|
||||||
|
&p->prefix.ead_addr.ip.ipaddr_v4);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
es_evi = bgp_evpn_es_evi_find(es, vpn);
|
es_evi = bgp_evpn_es_evi_find(es, vpn);
|
||||||
if (!es_evi)
|
if (!es_evi) {
|
||||||
/* XXX - error logs */
|
if (BGP_DEBUG(evpn_mh, EVPN_MH_ES))
|
||||||
|
zlog_debug(
|
||||||
|
"del remote %s es %s evi %u vtep %pI4, NO es-evi",
|
||||||
|
p->prefix.ead_addr.eth_tag ? "ead-es"
|
||||||
|
: "ead-evi",
|
||||||
|
esi_to_str(&p->prefix.ead_addr.esi, buf,
|
||||||
|
sizeof(buf)),
|
||||||
|
vpn->vni,
|
||||||
|
&p->prefix.ead_addr.ip.ipaddr_v4);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ead_es = !!p->prefix.ead_addr.eth_tag;
|
ead_es = !!p->prefix.ead_addr.eth_tag;
|
||||||
bgp_evpn_es_evi_vtep_del(bgp, es_evi, p->prefix.ead_addr.ip.ipaddr_v4,
|
bgp_evpn_es_evi_vtep_del(bgp, es_evi, p->prefix.ead_addr.ip.ipaddr_v4,
|
||||||
|
@ -100,7 +100,7 @@ struct bgp_evpn_es {
|
|||||||
/* List of ES-VRFs associated with this ES */
|
/* List of ES-VRFs associated with this ES */
|
||||||
struct list *es_vrf_list;
|
struct list *es_vrf_list;
|
||||||
|
|
||||||
/* List of MAC-IP global routes using this ES as destination -
|
/* List of MAC-IP VNI paths using this ES as destination -
|
||||||
* element is bgp_path_info_extra->es_info
|
* element is bgp_path_info_extra->es_info
|
||||||
*/
|
*/
|
||||||
struct list *macip_path_list;
|
struct list *macip_path_list;
|
||||||
|
@ -102,7 +102,7 @@ enum bgp_show_adj_route_type {
|
|||||||
#define BGP_NLRI_PARSE_ERROR_EVPN_TYPE1_SIZE -15
|
#define BGP_NLRI_PARSE_ERROR_EVPN_TYPE1_SIZE -15
|
||||||
#define BGP_NLRI_PARSE_ERROR -32
|
#define BGP_NLRI_PARSE_ERROR -32
|
||||||
|
|
||||||
/* MAC-IP/type-2 path_info in the global routing table is linked to the
|
/* MAC-IP/type-2 path_info in the VNI routing table is linked to the
|
||||||
* destination ES
|
* destination ES
|
||||||
*/
|
*/
|
||||||
struct bgp_path_es_info {
|
struct bgp_path_es_info {
|
||||||
|
Loading…
Reference in New Issue
Block a user