]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: vrf disable clean up evpn rmac nxthp cache 6780/head
authorChirag Shah <chirag@cumulusnetworks.com>
Mon, 6 Jul 2020 18:13:54 +0000 (11:13 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Tue, 21 Jul 2020 03:58:20 +0000 (20:58 -0700)
In networking restart event, l3vni (vxlan) interface followed by
associated vrf interfaces go down/deleted.
L3vni (oper) down event (from zebra to bgp) triggers to
clean up/un-import evpn routes (one-by-one) from the vrf table,
zebra internally removes the route entry from nexthop and RMAC hash.
When all the routes references in nexthop and RMAC db removed,
both (nexthop/rmac) are suppose to be uninstalled from the
bridge fdb and neigh table.
While evpn routes removal in progress, a vrf disable event removes
l3vni to its vrf association.
Subsequent bgp to evpn routes removal does not clean up thus evpn routes
reference to nexthop and RMAC remains in zebra hash.
bridge fdb and neigh tables are flushed out since networking restart brings down
all interfaces which results in flush of fdb and neigh tables.
By product is the zebra does not install nexthop and rmac when routes are re-imported
into vrf in VNI/VRF up event.

The fix is in vrf disable event to flush all l3vni's nexthop and rmac db.

Ticket:CM-30338
Reviewed By:CCR-10489
Testing Done:

Performed multiple networking restart and checked neigh and
bridge fdb tables for respective nexthop and router mac entry
programmed.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
zebra/zebra_vxlan.c

index 66441e1756f295949eff2fe5ab42f390c640e488..9a1cde3bc321e445d67fb734f69a2c3df9e2e08d 100644 (file)
@@ -9475,8 +9475,15 @@ int zebra_vxlan_vrf_disable(struct zebra_vrf *zvrf)
        if (!zl3vni)
                return 0;
 
-       zl3vni->vrf_id = VRF_UNKNOWN;
        zebra_vxlan_process_l3vni_oper_down(zl3vni);
+
+       /* delete and uninstall all rmacs */
+       hash_iterate(zl3vni->rmac_table, zl3vni_del_rmac_hash_entry, zl3vni);
+       /* delete and uninstall all next-hops */
+       hash_iterate(zl3vni->nh_table, zl3vni_del_nh_hash_entry, zl3vni);
+
+       zl3vni->vrf_id = VRF_UNKNOWN;
+
        return 0;
 }