mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-24 16:26:43 +00:00
zebra: evpn pip mac vlan up-down event
macvlan interface up/down event triggers bgp to send updates for evpn routes with changed RMAC and nexthop IP values. Ticket:CM-26190 Reviewed By: Testing Done: Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
This commit is contained in:
parent
0ca1058096
commit
0056f687d7
@ -1060,7 +1060,9 @@ void if_up(struct interface *ifp)
|
||||
zif->link_ifindex);
|
||||
if (link_if)
|
||||
zebra_vxlan_svi_up(ifp, link_if);
|
||||
}
|
||||
} else if (IS_ZEBRA_IF_MACVLAN(ifp))
|
||||
zebra_vxlan_macvlan_up(ifp);
|
||||
|
||||
}
|
||||
|
||||
/* Interface goes down. We have to manage different behavior of based
|
||||
@ -1092,7 +1094,8 @@ void if_down(struct interface *ifp)
|
||||
zif->link_ifindex);
|
||||
if (link_if)
|
||||
zebra_vxlan_svi_down(ifp, link_if);
|
||||
}
|
||||
} else if (IS_ZEBRA_IF_MACVLAN(ifp))
|
||||
zebra_vxlan_macvlan_down(ifp);
|
||||
|
||||
|
||||
/* Notify to the protocol daemons. */
|
||||
|
||||
@ -8562,6 +8562,67 @@ int zebra_vxlan_svi_up(struct interface *ifp, struct interface *link_if)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle MAC-VLAN interface going down.
|
||||
* L3VNI: When MAC-VLAN interface goes down,
|
||||
* find its associated SVI and update type2/type-5 routes
|
||||
* with SVI as RMAC
|
||||
*/
|
||||
void zebra_vxlan_macvlan_down(struct interface *ifp)
|
||||
{
|
||||
zebra_l3vni_t *zl3vni = NULL;
|
||||
struct zebra_if *zif, *link_zif;
|
||||
struct interface *link_ifp, *link_if;
|
||||
|
||||
zif = ifp->info;
|
||||
assert(zif);
|
||||
link_ifp = zif->link;
|
||||
link_zif = link_ifp->info;
|
||||
assert(link_zif);
|
||||
|
||||
link_if = if_lookup_by_index_per_ns(zebra_ns_lookup(NS_DEFAULT),
|
||||
link_zif->link_ifindex);
|
||||
|
||||
zl3vni = zl3vni_from_svi(link_ifp, link_if);
|
||||
if (zl3vni) {
|
||||
zl3vni->mac_vlan_if = NULL;
|
||||
if (is_l3vni_oper_up(zl3vni))
|
||||
zebra_vxlan_process_l3vni_oper_up(zl3vni);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle MAC-VLAN interface going up.
|
||||
* L3VNI: When MAC-VLAN interface comes up,
|
||||
* find its associated SVI and update type-2 routes
|
||||
* with MAC-VLAN's MAC as RMAC and for type-5 routes
|
||||
* use SVI's MAC as RMAC.
|
||||
*/
|
||||
void zebra_vxlan_macvlan_up(struct interface *ifp)
|
||||
{
|
||||
zebra_l3vni_t *zl3vni = NULL;
|
||||
struct zebra_if *zif, *link_zif;
|
||||
struct interface *link_ifp, *link_if;
|
||||
|
||||
zif = ifp->info;
|
||||
assert(zif);
|
||||
link_ifp = zif->link;
|
||||
link_zif = link_ifp->info;
|
||||
assert(link_zif);
|
||||
|
||||
link_if = if_lookup_by_index_per_ns(zebra_ns_lookup(NS_DEFAULT),
|
||||
link_zif->link_ifindex);
|
||||
zl3vni = zl3vni_from_svi(link_ifp, link_if);
|
||||
if (zl3vni) {
|
||||
/* associate with macvlan (VRR) interface */
|
||||
zl3vni->mac_vlan_if = ifp;
|
||||
|
||||
/* process oper-up */
|
||||
if (is_l3vni_oper_up(zl3vni))
|
||||
zebra_vxlan_process_l3vni_oper_up(zl3vni);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle VxLAN interface down
|
||||
*/
|
||||
|
||||
@ -217,6 +217,8 @@ extern int zebra_vxlan_clear_dup_detect_vni(struct vty *vty,
|
||||
extern void zebra_vxlan_handle_result(struct zebra_dplane_ctx *ctx);
|
||||
|
||||
extern void zebra_evpn_init(void);
|
||||
extern void zebra_vxlan_macvlan_up(struct interface *ifp);
|
||||
extern void zebra_vxlan_macvlan_down(struct interface *ifp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user