Skip to contentSkip to conversation

neighbor: Improve neighbour struct layout

PATCH Applied David Ahern 2 participants 2 messages Dec 13, 2018 – Dec 15, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 neighbor: Improve neighbour struct layout

From: David Ahern <[email protected]>

Move arp_queue_len_bytes ahead of arp_queue to remove two 4-byte holes. Ensure ha element is always 8-byte aligned.

---
 include/net/neighbour.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/net/neighbour.h +2 -2
index ef0a60448a96..30fd50adf234 100644
@@ -140,8 +140,8 @@ struct neighbour {
 	unsigned long		updated;
 	rwlock_t		lock;
 	refcount_t		refcnt;
-	struct sk_buff_head	arp_queue;
 	unsigned int		arp_queue_len_bytes;
+	struct sk_buff_head	arp_queue;
 	struct timer_list	timer;
 	unsigned long		used;
 	atomic_t		probes;
@@ -150,7 +150,7 @@ struct neighbour {
 	__u8			type;
 	__u8			dead;
 	seqlock_t		ha_lock;
-	unsigned char		ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))];
+	unsigned char		ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))] __aligned(8);
 	struct hh_cache		hh;
 	int			(*output)(struct neighbour *, struct sk_buff *);
 	const struct neigh_ops	*ops;
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw

From: David Ahern <[email protected]>
Date: Thu, 13 Dec 2018 08:16:50 -0800

Quoted 6 lines

From: David Ahern <[email protected]>

Move arp_queue_len_bytes ahead of arp_queue to remove two 4-byte holes. Ensure ha element is always 8-byte aligned.

Applied, thanks David.

I'm doing a build check on this so it'll take a little bit before it's actually pushed out.