summaryrefslogtreecommitdiff
path: root/zebra/zebra_vrf.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-02-06 10:23:58 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-03-27 16:22:22 -0400
commit699dae230db72cdb75c9e2c0237d602a48dbf61f (patch)
tree6fc306d202c849f43917f9f55ec304e9c8cfcdc2 /zebra/zebra_vrf.c
parentc86ba6c283689d0fd9f7dce9c29fdbbea7d0a0b2 (diff)
zebra: Modify NHT to occur when needed.
Currently nexthop tracking is performed for all nexthops that are being tracked after a group of contexts are passed back from the data plane for post install processing. This is inefficient and leaves us sending nexthop tracking changes at an accelerated pace, when we think we've changed a route. Additionally every route change will cause us to relook at all nexthops we are tracking irrelevant if they are possibly related to the route change or not. Let's modify the code base to track the rnh's off of the rib table's rn, `rib_dest_t`. So after we process a node, install it into the data plane, in rib_process_result we can look at the `rib_dest_t` associated with the rn and see that a nexthop depended on this route node. If so, refigure it. Additionally we will store rnh's that are not resolved on the 0.0.0.0/0 nexthop tracking list. As such when a route node changes we can quickly walk up the rib tree and notice that it needs to be reprocessed as well. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_vrf.c')
-rw-r--r--zebra/zebra_vrf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c
index 89bda4276e..2d721ec8a1 100644
--- a/zebra/zebra_vrf.c
+++ b/zebra/zebra_vrf.c
@@ -354,7 +354,12 @@ void zebra_rtable_node_cleanup(struct route_table *table,
rib_unlink(node, re);
}
- XFREE(MTYPE_RIB_DEST, node->info);
+ if (node->info) {
+ rib_dest_t *dest = node->info;
+
+ list_delete(&dest->nht);
+ XFREE(MTYPE_RIB_DEST, node->info);
+ }
}
static void zebra_rnhtable_node_cleanup(struct route_table *table,