summaryrefslogtreecommitdiff
path: root/zebra/zebra_vxlan.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@nvidia.com>2021-10-15 11:47:25 -0700
committerChirag Shah <chirag@nvidia.com>2022-03-10 17:27:15 -0800
commitae9e6beaeae78bc7fe119b7bb772c7e2278e5514 (patch)
tree77f80538f248fe6485ce9f5201579e6b504f7934 /zebra/zebra_vxlan.c
parentdb88997872172af52a21c8324d83640136ef2787 (diff)
zebra: remove host prefix mapping in rmac
RMAC keeping list of nexthops to keep track of its existiance, remove the (old way) host prefix mapping. Ticket: #2798406 Reviewed By: Testing Done: TORS1# show evpn rmac vni 4001 mac 44:38:39:ff:ff:01 MAC: 44:38:39:ff:ff:01 Remote VTEP: 36.0.0.11 Refcount: 0 Prefixes: Signed-off-by: Chirag Shah <chirag@nvidia.com>
Diffstat (limited to 'zebra/zebra_vxlan.c')
-rw-r--r--zebra/zebra_vxlan.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index 6a2bac522c..43045bd7ca 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -1382,8 +1382,6 @@ static int zl3vni_remote_rmac_add(struct zebra_l3vni *zl3vni,
zl3vni_rmac_install(zl3vni, zrmac);
}
- rb_find_or_add_host(&zrmac->host_rb, host_prefix);
-
return 0;
}
@@ -1396,20 +1394,7 @@ static void zl3vni_remote_rmac_del(struct zebra_l3vni *zl3vni,
{
struct ipaddr ipv4_vtep;
- rb_delete_host(&zrmac->host_rb, host_prefix);
-
- if (RB_EMPTY(host_rb_tree_entry, &zrmac->host_rb)) {
- /* uninstall from kernel */
- zl3vni_rmac_uninstall(zl3vni, zrmac);
-
- /* Send RMAC for FPM processing */
- hook_call(zebra_rmac_update, zrmac, zl3vni, true,
- "RMAC deleted");
-
- /* del the rmac entry */
- zl3vni_rmac_del(zl3vni, zrmac);
- /* if nh is already deleted fall back to one in the list */
- } else if (!zl3vni_nh_lookup(zl3vni, vtep_ip)) {
+ if (!zl3vni_nh_lookup(zl3vni, vtep_ip)) {
memset(&ipv4_vtep, 0, sizeof(struct ipaddr));
ipv4_vtep.ipa_type = IPADDR_V4;
if (vtep_ip->ipa_type == IPADDR_V6)
@@ -1441,6 +1426,23 @@ static void zl3vni_remote_rmac_del(struct zebra_l3vni *zl3vni,
/* install rmac in kernel */
zl3vni_rmac_install(zl3vni, zrmac);
}
+
+ if (!listcount(zrmac->nh_list)) {
+ /* uninstall from kernel */
+ zl3vni_rmac_uninstall(zl3vni, zrmac);
+
+ /* Send RMAC for FPM processing */
+ hook_call(zebra_rmac_update, zrmac, zl3vni, true,
+ "RMAC deleted");
+
+ if (IS_ZEBRA_DEBUG_VXLAN)
+ zlog_debug(
+ "L3VNI %u RMAC %pEA vtep_ip %pIA delete",
+ zl3vni->vni, &zrmac->macaddr, vtep_ip);
+
+ /* del the rmac entry */
+ zl3vni_rmac_del(zl3vni, zrmac);
+ }
}
}