summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.h
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-01-29 15:18:54 +0100
committerDonatas Abraitis <donatas@opensourcerouting.org>2024-01-30 07:12:59 +0100
commita699cc1796db61601b9246a7439126ced5fe2e9f (patch)
tree1d3abdf7d14d1e7eb26b9e4d5f4f139a4649326e /bgpd/bgp_route.h
parentbgpd: Optimize memory usage for bgp_static struct (diff)
downloadfrr-a699cc1796db61601b9246a7439126ced5fe2e9f.tar.xz
frr-a699cc1796db61601b9246a7439126ced5fe2e9f.zip
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>
Diffstat (limited to 'bgpd/bgp_route.h')
-rw-r--r--bgpd/bgp_route.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index a3f7ba2d7..fde3e861c 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -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;