diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-01-29 16:21:21 +0200 |
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-01-30 08:12:59 +0200 |
| commit | 48856741bd7583af2a37740e197e8a198df20b91 (patch) | |
| tree | d835568609c3a90c4bbb751423d80f47a16e5f2f /bgpd/bgp_damp.h | |
| parent | a699cc1796db61601b9246a7439126ced5fe2e9f (diff) | |
bgpd: Optimize memory usage for bgp_damp_config struct
```
struct bgp_damp_config {
unsigned int suppress_value; /* 0 4 */
unsigned int reuse_limit; /* 4 4 */
time_t max_suppress_time; /* 8 8 */
time_t half_life; /* 16 8 */
unsigned int reuse_list_size; /* 24 4 */
unsigned int reuse_index_size; /* 28 4 */
unsigned int ceiling; /* 32 4 */
unsigned int decay_rate_per_tick; /* 36 4 */
unsigned int decay_array_size; /* 40 4 */
unsigned int reuse_scale_factor; /* 44 4 */
double scale_factor; /* 48 8 */
double * decay_array; /* 56 8 */
/* --- cacheline 1 boundary (64 bytes) --- */
int * reuse_index; /* 64 8 */
struct bgp_damp_info * * reuse_list; /* 72 8 */
int reuse_offset; /* 80 4 */
safi_t safi; /* 84 4 */
struct bgp_damp_info * no_reuse_list; /* 88 8 */
struct event * t_reuse; /* 96 8 */
afi_t afi; /* 104 4 */
/* size: 112, cachelines: 2, members: 19 */
/* padding: 4 */
/* last cacheline: 48 bytes */
}; /* saved 8 bytes! */
```
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_damp.h')
| -rw-r--r-- | bgpd/bgp_damp.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_damp.h b/bgpd/bgp_damp.h index 4aff52c09c..6033c34bfd 100644 --- a/bgpd/bgp_damp.h +++ b/bgpd/bgp_damp.h @@ -74,8 +74,8 @@ struct bgp_damp_config { unsigned int ceiling; /* Max value a penalty can attain */ unsigned int decay_rate_per_tick; /* Calculated from half-life */ unsigned int decay_array_size; /* Calculated using config parameters */ - double scale_factor; unsigned int reuse_scale_factor; + double scale_factor; /* Decay array per-set based. */ double *decay_array; @@ -86,6 +86,7 @@ struct bgp_damp_config { /* Reuse list array per-set based. */ struct bgp_damp_info **reuse_list; int reuse_offset; + safi_t safi; /* All dampening information which is not on reuse list. */ struct bgp_damp_info *no_reuse_list; @@ -94,7 +95,6 @@ struct bgp_damp_config { struct event *t_reuse; afi_t afi; - safi_t safi; }; #define BGP_DAMP_NONE 0 |
