From: Donald Sharp Date: Tue, 25 Sep 2018 22:39:37 +0000 (-0400) Subject: bgpd: Reduce size of 'struct bgp_node' by 8 bytes X-Git-Tag: frr-7.1-dev~108^2~11 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=aaafc3216727276a6daf5f2fc5a050b5601e1eb3;p=matthieu%2Ffrr.git bgpd: Reduce size of 'struct bgp_node' by 8 bytes The ordering of data within the `struct bgp_node` was causing extra padding of data. Moving the version to a bit different spot allows for more efficient packing of data. Pre-change: (gdb) p sizeof(struct bgp_node) $1 = 152 (gdb) Post-change: (gdb) p sizeof(struct bgp_node) $1 = 144 (gdb) Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_table.h b/bgpd/bgp_table.h index c267b4fe8a..f306a05da1 100644 --- a/bgpd/bgp_table.h +++ b/bgpd/bgp_table.h @@ -60,9 +60,10 @@ struct bgp_node { STAILQ_ENTRY(bgp_node) pq; + uint64_t version; + mpls_label_t local_label; - uint64_t version; uint8_t flags; #define BGP_NODE_PROCESS_SCHEDULED (1 << 0) #define BGP_NODE_USER_CLEAR (1 << 1)