| .. | .. |
|---|
| 15 | 15 | struct allowedips_node { |
|---|
| 16 | 16 | struct wg_peer __rcu *peer; |
|---|
| 17 | 17 | struct allowedips_node __rcu *bit[2]; |
|---|
| 18 | | - /* While it may seem scandalous that we waste space for v4, |
|---|
| 19 | | - * we're alloc'ing to the nearest power of 2 anyway, so this |
|---|
| 20 | | - * doesn't actually make a difference. |
|---|
| 21 | | - */ |
|---|
| 22 | | - u8 bits[16] __aligned(__alignof(u64)); |
|---|
| 23 | 18 | u8 cidr, bit_at_a, bit_at_b, bitlen; |
|---|
| 19 | + u8 bits[16] __aligned(__alignof(u64)); |
|---|
| 24 | 20 | |
|---|
| 25 | | - /* Keep rarely used list at bottom to be beyond cache line. */ |
|---|
| 21 | + /* Keep rarely used members at bottom to be beyond cache line. */ |
|---|
| 22 | + unsigned long parent_bit_packed; |
|---|
| 26 | 23 | union { |
|---|
| 27 | 24 | struct list_head peer_list; |
|---|
| 28 | 25 | struct rcu_head rcu; |
|---|
| .. | .. |
|---|
| 33 | 30 | struct allowedips_node __rcu *root4; |
|---|
| 34 | 31 | struct allowedips_node __rcu *root6; |
|---|
| 35 | 32 | u64 seq; |
|---|
| 36 | | -}; |
|---|
| 33 | +} __aligned(4); /* We pack the lower 2 bits of &root, but m68k only gives 16-bit alignment. */ |
|---|
| 37 | 34 | |
|---|
| 38 | 35 | void wg_allowedips_init(struct allowedips *table); |
|---|
| 39 | 36 | void wg_allowedips_free(struct allowedips *table, struct mutex *mutex); |
|---|
| .. | .. |
|---|
| 56 | 53 | bool wg_allowedips_selftest(void); |
|---|
| 57 | 54 | #endif |
|---|
| 58 | 55 | |
|---|
| 56 | +int wg_allowedips_slab_init(void); |
|---|
| 57 | +void wg_allowedips_slab_uninit(void); |
|---|
| 58 | + |
|---|
| 59 | 59 | #endif /* _WG_ALLOWEDIPS_H */ |
|---|