summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_fsm.c
diff options
context:
space:
mode:
authorYuqing Zhao <xiaopanghu99@163.com>2023-07-31 14:34:48 +0200
committerYuqing Zhao <xiaopanghu99@163.com>2023-08-22 03:35:46 +0200
commit6e7f305e54f4828d58cb4b2e4c815d82a4cbe560 (patch)
tree4c01b7351f468d2139053b3cc5095e4bde67c6bd /bgpd/bgp_fsm.c
parentMerge pull request #8790 from donaldsharp/peer_connection (diff)
downloadfrr-6e7f305e54f4828d58cb4b2e4c815d82a4cbe560.tar.xz
frr-6e7f305e54f4828d58cb4b2e4c815d82a4cbe560.zip
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>
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r--bgpd/bgp_fsm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 63e9fa7bc..8241a9f82 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -723,7 +723,7 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi)
if (bgp_debug_neighbor_events(peer))
zlog_debug(
"%pBP Long-lived set stale community (LLGR_STALE) for: %pFX",
- peer, &dest->p);
+ peer, &dest->rn->p);
attr = *pi->attr;
bgp_attr_add_llgr_community(&attr);
@@ -751,7 +751,7 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi)
if (bgp_debug_neighbor_events(peer))
zlog_debug(
"%pBP Long-lived set stale community (LLGR_STALE) for: %pFX",
- peer, &dest->p);
+ peer, &dest->rn->p);
attr = *pi->attr;
bgp_attr_add_llgr_community(&attr);