mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 14:40:47 +00:00
bgpd: Optimize memory usage for bgp_aggregate struct
``` struct bgp_aggregate { uint8_t summary_only; /* 0 1 */ uint8_t as_set; /* 1 1 */ uint8_t origin; /* 2 1 */ _Bool med_mismatched; /* 3 1 */ _Bool med_initialized; /* 4 1 */ _Bool match_med; /* 5 1 */ /* XXX 2 bytes hole, try to pack */ struct { char * name; /* 8 8 */ struct route_map * map; /* 16 8 */ } rmap; /* 8 16 */ long unsigned int count; /* 24 8 */ long unsigned int incomplete_origin_count; /* 32 8 */ long unsigned int egp_origin_count; /* 40 8 */ struct hash * community_hash; /* 48 8 */ struct hash * ecommunity_hash; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct hash * lcommunity_hash; /* 64 8 */ struct hash * aspath_hash; /* 72 8 */ struct community * community; /* 80 8 */ struct ecommunity * ecommunity; /* 88 8 */ struct lcommunity * lcommunity; /* 96 8 */ struct aspath * aspath; /* 104 8 */ safi_t safi; /* 112 4 */ uint32_t med_matched_value; /* 116 4 */ char * suppress_map_name; /* 120 8 */ /* --- cacheline 2 boundary (128 bytes) --- */ struct route_map * suppress_map; /* 128 8 */ /* size: 136, cachelines: 3, members: 22 */ /* sum members: 134, holes: 1, sum holes: 2 */ /* last cacheline: 8 bytes */ }; ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
0804038916
commit
a699cc1796
@ -416,6 +416,17 @@ struct bgp_aggregate {
|
||||
/* AS set generation. */
|
||||
uint8_t as_set;
|
||||
|
||||
/* Optional modify flag to override ORIGIN */
|
||||
uint8_t origin;
|
||||
|
||||
/** Are there MED mismatches? */
|
||||
bool med_mismatched;
|
||||
/* MED matching state. */
|
||||
/** Did we get the first MED value? */
|
||||
bool med_initialized;
|
||||
/** Match only equal MED. */
|
||||
bool match_med;
|
||||
|
||||
/* Route-map for aggregated route. */
|
||||
struct {
|
||||
char *name;
|
||||
@ -431,9 +442,6 @@ struct bgp_aggregate {
|
||||
/* Count of routes of origin type egp under this aggregate. */
|
||||
unsigned long egp_origin_count;
|
||||
|
||||
/* Optional modify flag to override ORIGIN */
|
||||
uint8_t origin;
|
||||
|
||||
/* Hash containing the communities of all the
|
||||
* routes under this aggregate.
|
||||
*/
|
||||
@ -469,13 +477,6 @@ struct bgp_aggregate {
|
||||
/* SAFI configuration. */
|
||||
safi_t safi;
|
||||
|
||||
/** Match only equal MED. */
|
||||
bool match_med;
|
||||
/* MED matching state. */
|
||||
/** Did we get the first MED value? */
|
||||
bool med_initialized;
|
||||
/** Are there MED mismatches? */
|
||||
bool med_mismatched;
|
||||
/** MED value found in current group. */
|
||||
uint32_t med_matched_value;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user