hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/wireguard/allowedips.h
....@@ -15,14 +15,11 @@
1515 struct allowedips_node {
1616 struct wg_peer __rcu *peer;
1717 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));
2318 u8 cidr, bit_at_a, bit_at_b, bitlen;
19
+ u8 bits[16] __aligned(__alignof(u64));
2420
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;
2623 union {
2724 struct list_head peer_list;
2825 struct rcu_head rcu;
....@@ -33,7 +30,7 @@
3330 struct allowedips_node __rcu *root4;
3431 struct allowedips_node __rcu *root6;
3532 u64 seq;
36
-};
33
+} __aligned(4); /* We pack the lower 2 bits of &root, but m68k only gives 16-bit alignment. */
3734
3835 void wg_allowedips_init(struct allowedips *table);
3936 void wg_allowedips_free(struct allowedips *table, struct mutex *mutex);
....@@ -56,4 +53,7 @@
5653 bool wg_allowedips_selftest(void);
5754 #endif
5855
56
+int wg_allowedips_slab_init(void);
57
+void wg_allowedips_slab_uninit(void);
58
+
5959 #endif /* _WG_ALLOWEDIPS_H */