diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-01-31 13:37:25 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2024-02-01 07:54:35 -0500 | 
| commit | bb1e1265aac482eaf52ab5ab7d0dab63da7d15b3 (patch) | |
| tree | 1b7718fcc950c0f330825cd1ab24f4cfd530d357 /bgpd/bgp_route.h | |
| parent | a8e8f1bc72b7b638d29dc6c0bf78679487a3331d (diff) | |
bgpd: Save memory when using bgp_path_info_extra and vnc
Structure size of bgp_path_info_extra when compiled
with vnc is 184 bytes.  Reduce this size to 72 bytes
when compiled w/ vnc but not necessarily turned
on vnc.
With 2 full bgp feeds this saves aproximately 100mb
when compiling with vnc and not using vnc.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_route.h')
| -rw-r--r-- | bgpd/bgp_route.h | 56 | 
1 files changed, 30 insertions, 26 deletions
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 18a60341f7..2d82f0f206 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -193,33 +193,9 @@ struct bgp_path_info_extra_vrfleak {  	struct prefix nexthop_orig;  }; -/* Ancillary information to struct bgp_path_info, - * used for uncommonly used data (aggregation, MPLS, etc.) - * and lazily allocated to save memory. - */ -struct bgp_path_info_extra { -	/* Pointer to dampening structure.  */ -	struct bgp_damp_info *damp_info; - -	/** List of aggregations that suppress this path. */ -	struct list *aggr_suppressors; - -	/* Nexthop reachability check.  */ -	uint32_t igpmetric; - -	/* MPLS label(s) - VNI(s) for EVPN-VxLAN  */ -	mpls_label_t label[BGP_MAX_LABELS]; -	uint32_t num_labels; - -	/* timestamp of the rib installation */ -	time_t bgp_rib_uptime; - -	/*For EVPN*/ -	struct bgp_path_info_extra_evpn *evpn; -  #ifdef ENABLE_BGP_VNC +struct bgp_path_info_extra_vnc {  	union { -  		struct {  			void *rfapi_handle; /* export: NVE advertising this  					       route */ @@ -242,8 +218,36 @@ struct bgp_path_info_extra {  			struct prefix aux_prefix; /* AFI_L2VPN: the IP addr,  						     if family set */  		} import; -  	} vnc; +}; +#endif + +/* Ancillary information to struct bgp_path_info, + * used for uncommonly used data (aggregation, MPLS, etc.) + * and lazily allocated to save memory. + */ +struct bgp_path_info_extra { +	/* Pointer to dampening structure.  */ +	struct bgp_damp_info *damp_info; + +	/** List of aggregations that suppress this path. */ +	struct list *aggr_suppressors; + +	/* Nexthop reachability check.  */ +	uint32_t igpmetric; + +	/* MPLS label(s) - VNI(s) for EVPN-VxLAN  */ +	mpls_label_t label[BGP_MAX_LABELS]; +	uint32_t num_labels; + +	/* timestamp of the rib installation */ +	time_t bgp_rib_uptime; + +	/*For EVPN*/ +	struct bgp_path_info_extra_evpn *evpn; + +#ifdef ENABLE_BGP_VNC +	struct bgp_path_info_extra_vnc *vnc;  #endif  	/* For flowspec*/  | 
