summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-01-29 15:00:07 +0100
committerDonatas Abraitis <donatas@opensourcerouting.org>2024-01-30 07:12:59 +0100
commit0804038916212cf8902595aeab016877e3b08bb2 (patch)
tree474dd4d861243b93a8ce43189bf2d1a5736f32dc /bgpd
parentbgpd: Optimize memory usage for attr struct (diff)
downloadfrr-0804038916212cf8902595aeab016877e3b08bb2.tar.xz
frr-0804038916212cf8902595aeab016877e3b08bb2.zip
bgpd: Optimize memory usage for bgp_static struct
``` struct bgp_static { int backdoor; /* 0 4 */ uint32_t label_index; /* 4 4 */ uint8_t valid; /* 8 1 */ /* XXX 1 byte hole, try to pack */ uint16_t encap_tunneltype; /* 10 2 */ uint32_t igpmetric; /* 12 4 */ struct in_addr igpnexthop; /* 16 4 */ uint32_t atomic; /* 20 4 */ struct { char * name; /* 24 8 */ struct route_map * map; /* 32 8 */ } rmap; /* 24 16 */ struct prefix_rd prd __attribute__((__aligned__(8))); /* 40 16 */ char * prd_pretty; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ mpls_label_t label; /* 64 4 */ /* XXX 4 bytes hole, try to pack */ esi_t * eth_s_id; /* 72 8 */ struct ethaddr * router_mac; /* 80 8 */ struct prefix gatewayIp __attribute__((__aligned__(8))); /* 88 56 */ /* size: 144, cachelines: 3, members: 14 */ /* sum members: 139, holes: 2, sum holes: 5 */ /* forced alignments: 2 */ /* last cacheline: 16 bytes */ } __attribute__((__aligned__(8))); /* saved 8 bytes! */ ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_route.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index 0599e8dce..a3f7ba2d7 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -369,6 +369,8 @@ struct bgp_static {
/* Import check status. */
uint8_t valid;
+ uint16_t encap_tunneltype;
+
/* IGP metric. */
uint32_t igpmetric;
@@ -394,7 +396,6 @@ struct bgp_static {
/* EVPN */
esi_t *eth_s_id;
struct ethaddr *router_mac;
- uint16_t encap_tunneltype;
struct prefix gatewayIp;
};