bgpd: Optimize memory for bgp_adj_out struct

```
struct bgp_adj_out {
	struct rb_entry            adj_entry;            /*     0    32 */

	/* XXX last struct has 4 bytes of padding */

	struct update_subgroup *   subgroup;             /*    32     8 */
	struct {
		struct bgp_adj_out * tqe_next;           /*    40     8 */
		struct bgp_adj_out * * tqe_prev;         /*    48     8 */
	} subgrp_adj_train;                              /*    40    16 */
	struct bgp_dest *          dest;                 /*    56     8 */
	/* --- cacheline 1 boundary (64 bytes) --- */
	uint32_t                   addpath_tx_id;        /*    64     4 */
	uint32_t                   attr_hash;            /*    68     4 */
	struct attr *              attr;                 /*    72     8 */
	struct bgp_advertise *     adv;                  /*    80     8 */

	/* size: 88, cachelines: 2, members: 8 */
	/* paddings: 1, sum paddings: 4 */
	/* last cacheline: 24 bytes */
};   /* saved 8 bytes! */
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2024-02-09 17:18:22 +02:00
parent b7987eca20
commit 1fce318efc

View File

@ -69,14 +69,14 @@ struct bgp_adj_out {
uint32_t addpath_tx_id;
/* Attribute hash */
uint32_t attr_hash;
/* Advertised attribute. */
struct attr *attr;
/* Advertisement information. */
struct bgp_advertise *adv;
/* Attribute hash */
uint32_t attr_hash;
};
RB_HEAD(bgp_adj_out_rb, bgp_adj_out);