summaryrefslogtreecommitdiff
path: root/bgpd/bgp_attr.h
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-02-01 17:28:42 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2024-02-01 17:28:42 +0200
commit0223b98c5c329506500dfd3130ac9ff72314be98 (patch)
treeab9fb2c955d1885a4fc7f540c3b3e687de753502 /bgpd/bgp_attr.h
parenta2caf2b5e132ad6d50d83348d8efe9cdea72ec6e (diff)
bgpd: One more attr struct memory optimization
``` struct attr { struct aspath * aspath; /* 0 8 */ struct community * community; /* 8 8 */ long unsigned int refcnt; /* 16 8 */ _uint64_t flag; /* 24 8 */ struct in_addr nexthop; /* 32 4 */ uint32_t med; /* 36 4 */ uint32_t local_pref; /* 40 4 */ ifindex_t nh_ifindex; /* 44 4 */ uint8_t nh_flags; /* 48 1 */ uint8_t origin; /* 49 1 */ uint8_t es_flags; /* 50 1 */ uint8_t router_flag; /* 51 1 */ uint8_t distance; /* 52 1 */ uint8_t df_alg; /* 53 1 */ uint16_t df_pref; /* 54 2 */ enum pta_type pmsi_tnl_type; /* 56 4 */ uint32_t rmap_change_flags; /* 60 4 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct in6_addr mp_nexthop_global; /* 64 16 */ struct in6_addr mp_nexthop_local; /* 80 16 */ ifindex_t nh_lla_ifindex; /* 96 4 */ mpls_label_t label; /* 100 4 */ struct ecommunity * ecommunity; /* 104 8 */ struct ecommunity * ipv6_ecommunity; /* 112 8 */ struct lcommunity * lcommunity; /* 120 8 */ /* --- cacheline 2 boundary (128 bytes) --- */ struct cluster_list * cluster1; /* 128 8 */ struct transit * transit; /* 136 8 */ struct in_addr mp_nexthop_global_in; /* 144 4 */ struct in_addr aggregator_addr; /* 148 4 */ struct in_addr originator_id; /* 152 4 */ uint32_t weight; /* 156 4 */ as_t aggregator_as; /* 160 4 */ uint8_t mp_nexthop_len; /* 164 1 */ uint8_t mp_nexthop_prefer_global; /* 165 1 */ uint8_t sticky; /* 166 1 */ uint8_t default_gw; /* 167 1 */ route_tag_t tag; /* 168 4 */ uint32_t label_index; /* 172 4 */ struct bgp_attr_srv6_vpn * srv6_vpn; /* 176 8 */ struct bgp_attr_srv6_l3vpn * srv6_l3vpn; /* 184 8 */ /* --- cacheline 3 boundary (192 bytes) --- */ struct bgp_attr_encap_subtlv * encap_subtlvs; /* 192 8 */ struct bgp_attr_encap_subtlv * vnc_subtlvs; /* 200 8 */ struct bgp_route_evpn evpn_overlay; /* 208 36 */ uint32_t mm_seqnum; /* 244 4 */ uint32_t mm_sync_seqnum; /* 248 4 */ struct ethaddr rmac; /* 252 6 */ /* --- cacheline 4 boundary (256 bytes) was 2 bytes ago --- */ uint16_t encap_tunneltype; /* 258 2 */ uint32_t rmap_table_id; /* 260 4 */ uint32_t link_bw; /* 264 4 */ esi_t esi; /* 268 10 */ /* XXX 2 bytes hole, try to pack */ uint32_t srte_color; /* 280 4 */ enum nexthop_types_t nh_type; /* 284 4 */ enum blackhole_type bh_type; /* 288 4 */ uint32_t otc; /* 292 4 */ _uint64_t aigp_metric; /* 296 8 */ /* size: 304, cachelines: 5, members: 54 */ /* sum members: 302, holes: 1, sum holes: 2 */ /* last cacheline: 48 bytes */ }; /* saved 8 bytes! */ ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_attr.h')
-rw-r--r--bgpd/bgp_attr.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h
index 942de57112..d78f04c6dd 100644
--- a/bgpd/bgp_attr.h
+++ b/bgpd/bgp_attr.h
@@ -201,6 +201,10 @@ struct attr {
/* Distance as applied by Route map */
uint8_t distance;
+ /* EVPN DF preference for DF election on local ESs */
+ uint8_t df_alg;
+ uint16_t df_pref;
+
/* PMSI tunnel type (RFC 6514). */
enum pta_type pmsi_tnl_type;
@@ -215,6 +219,9 @@ struct attr {
/* ifIndex corresponding to mp_nexthop_local. */
ifindex_t nh_lla_ifindex;
+ /* MPLS label */
+ mpls_label_t label;
+
/* Extended Communities attribute. */
struct ecommunity *ecommunity;
@@ -262,13 +269,6 @@ struct attr {
/* Label index */
uint32_t label_index;
- /* MPLS label */
- mpls_label_t label;
-
- /* EVPN DF preference for DF election on local ESs */
- uint16_t df_pref;
- uint8_t df_alg;
-
/* SRv6 VPN SID */
struct bgp_attr_srv6_vpn *srv6_vpn;