1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: "Jason A. Donenfeld" <Jason@zx2c4.com>
3 Date: Mon, 22 Feb 2021 17:25:46 +0100
4 Subject: [PATCH] wireguard: peer: put frequently used members above cache
7 commit 5a0598695634a6bb4126818902dd9140cd9df8b6 upstream.
9 The is_dead boolean is checked for every single packet, while the
10 internal_id member is used basically only for pr_debug messages. So it
11 makes sense to hoist up is_dead into some space formerly unused by a
12 struct hole, while demoting internal_api to below the lowest struct
15 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
16 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
17 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
19 drivers/net/wireguard/peer.h | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
22 --- a/drivers/net/wireguard/peer.h
23 +++ b/drivers/net/wireguard/peer.h
24 @@ -39,6 +39,7 @@ struct wg_peer {
25 struct crypt_queue tx_queue, rx_queue;
26 struct sk_buff_head staged_packet_queue;
29 struct noise_keypairs keypairs;
30 struct endpoint endpoint;
31 struct dst_cache endpoint_cache;
32 @@ -61,9 +62,8 @@ struct wg_peer {
34 struct list_head peer_list;
35 struct list_head allowedips_list;
37 struct napi_struct napi;
42 struct wg_peer *wg_peer_create(struct wg_device *wg,