summaryrefslogtreecommitdiff
path: root/zebra/zebra_evpn_mac.c
diff options
context:
space:
mode:
authorAnuradha Karuppiah <anuradhak@nvidia.com>2021-08-10 14:31:34 -0700
committerAnuradha Karuppiah <anuradhak@nvidia.com>2021-10-15 10:43:41 -0700
commit09de6e45505715ee85d0a4bcd47d9b03ad2b7610 (patch)
treea69f25152292cb5fc1dac1c1fc5b4518c9bf1fde /zebra/zebra_evpn_mac.c
parent38f681e1cac07dac996ae952c99684501cf820c6 (diff)
zebra: defer local MAC dataplane install on an ES till the ES-EVI is created
When an ES is deleted and re-added bgpd can start sending MAC-IP sync updates before the dataplane and zebra have setup the VLAN membership for the ES. Such MAC entries are not installed in the dataplane till the ES-EVI is created. Ticket: #2668488 Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Diffstat (limited to 'zebra/zebra_evpn_mac.c')
-rw-r--r--zebra/zebra_evpn_mac.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c
index 472e53b730..c1bb19d4e5 100644
--- a/zebra/zebra_evpn_mac.c
+++ b/zebra/zebra_evpn_mac.c
@@ -1342,6 +1342,25 @@ int zebra_evpn_sync_mac_dp_install(struct zebra_mac *mac, bool set_inactive,
struct zebra_if *zif;
struct interface *br_ifp;
+ /* If the ES-EVI doesn't exist defer install. When the ES-EVI is
+ * created we will attempt to install the mac entry again
+ */
+ if (mac->es) {
+ struct zebra_evpn_es_evi *es_evi;
+
+ es_evi = zebra_evpn_es_evi_find(mac->es, mac->zevpn);
+ if (!es_evi) {
+ if (IS_ZEBRA_DEBUG_EVPN_MH_MAC)
+ zlog_debug(
+ "%s: dp-install sync-mac vni %u mac %pEA es %s 0x%x %sskipped, no es-evi",
+ caller, zevpn->vni, &mac->macaddr,
+ mac->es ? mac->es->esi_str : "-",
+ mac->flags,
+ set_inactive ? "inactive " : "");
+ return -1;
+ }
+ }
+
/* get the access vlan from the vxlan_device */
zebra_evpn_mac_get_access_info(mac, &ifp, &vid);