From aaafc3216727276a6daf5f2fc5a050b5601e1eb3 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 25 Sep 2018 18:39:37 -0400 Subject: [PATCH] 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 --- bgpd/bgp_table.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.39.5