]> 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 00:28:57 +0000 (20:28 -0400)
commit0a45d974729e1495626783212b1bbaa829eb6b1e
tree2fdc3b5aa49a2c8c543029b14b191a9e3b0bc444
parent820b3b6596b3aa973378dda64a838e338279ee06
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