]> git.proxmox.com Git - mirror_frr.git/commit
zebra: Remove linked list and replace with new LIST
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 30 Apr 2019 22:04:57 +0000 (18:04 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 2 May 2019 20:21:38 +0000 (16:21 -0400)
commitaa57abfbb57c2dd31eeb26d6988af57cb2e15a6b
tree14af5a974b27a670ca9f484d00a3ea55a0701d2f
parent21fee7927f427a02ed814396505f9654a2e1bcce
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>
zebra/rib.h
zebra/zebra_rib.c
zebra/zebra_rnh.c
zebra/zebra_rnh.h
zebra/zebra_vrf.c