summaryrefslogtreecommitdiff
path: root/zebra/zebra_vrf.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-04-30 18:04:57 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-05-02 16:21:38 -0400
commitaa57abfbb57c2dd31eeb26d6988af57cb2e15a6b (patch)
tree14af5a974b27a670ca9f484d00a3ea55a0701d2f /zebra/zebra_vrf.c
parent21fee7927f427a02ed814396505f9654a2e1bcce (diff)
zebra: Remove linked list and replace with new LIST
The `struct rib_dest_t` was being used to store the linked list of rnh's associated with the node. This was taking up a bunch of memory. Replace with new data structure supplied by David and see the memory reductions associated with 1 million routes in the zebra rib: Old: Memory statistics for zebra: System allocator statistics: Total heap allocated: 675 MiB Holding block headers: 0 bytes Used small blocks: 0 bytes Used ordinary blocks: 567 MiB Free small blocks: 39 MiB Free ordinary blocks: 69 MiB Ordinary blocks: 0 Small blocks: 0 Holding blocks: 0 New: Memory statistics for zebra: System allocator statistics: Total heap allocated: 574 MiB Holding block headers: 0 bytes Used small blocks: 0 bytes Used ordinary blocks: 536 MiB Free small blocks: 33 MiB Free ordinary blocks: 4600 KiB Ordinary blocks: 0 Small blocks: 0 Holding blocks: 0 `struct rnh` was moved to rib.h because of the tangled web of structure dependancies. This data structure is used in numerous places so it should be ok for the moment. Future work might be needed to do a better job of splitting up data structures and function definitions. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_vrf.c')
-rw-r--r--zebra/zebra_vrf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c
index 2d721ec8a1..f0b99f41fc 100644
--- a/zebra/zebra_vrf.c
+++ b/zebra/zebra_vrf.c
@@ -357,7 +357,7 @@ void zebra_rtable_node_cleanup(struct route_table *table,
if (node->info) {
rib_dest_t *dest = node->info;
- list_delete(&dest->nht);
+ rnh_list_fini(&dest->nht);
XFREE(MTYPE_RIB_DEST, node->info);
}
}