]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: Convert from struct bgp_node to struct bgp_dest 14118/head
authorYuqing Zhao <xiaopanghu99@163.com>
Mon, 31 Jul 2023 12:34:48 +0000 (20:34 +0800)
committerYuqing Zhao <xiaopanghu99@163.com>
Tue, 22 Aug 2023 01:35:46 +0000 (09:35 +0800)
commit6e7f305e54f4828d58cb4b2e4c815d82a4cbe560
tree4c01b7351f468d2139053b3cc5095e4bde67c6bd
parent451fb24b17cb9272981d3809f755985d9ce52f79
bgpd: Convert from struct bgp_node to struct bgp_dest

This is based on @donaldsharp's work

The current code base is the struct bgp_node data structure.
The problem with this is that it creates a bunch of
extra data per route_node.
The table structure generates ‘holder’ nodes
that are never going to receive bgp routes,
and now the memory of those nodes is allocated
as if they are a full bgp_node.

After splitting up the bgp_node into bgp_dest and route_node,
the memory of ‘holder’ node which does not have any bgp data
will be allocated as the route_node, not the bgp_node,
and the memory usage is reduced.
The memory usage of BGP node will be reduced from 200B to 96B.
The total memory usage optimization of this part is ~16.00%.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Yuqing Zhao <xiaopanghu99@163.com>
14 files changed:
bgpd/bgp_bmp.c
bgpd/bgp_evpn.c
bgpd/bgp_evpn_mh.c
bgpd/bgp_evpn_private.h
bgpd/bgp_evpn_vty.c
bgpd/bgp_fsm.c
bgpd/bgp_route.c
bgpd/bgp_route.h
bgpd/bgp_table.c
bgpd/bgp_table.h
bgpd/bgp_zebra.c
bgpd/bgpd.h
lib/table.c
tests/bgpd/test_mpath.c