Commit 751a587a authored by Jiri Benc's avatar Jiri Benc Committed by David S. Miller

route: fix breakage after moving lwtunnel state

__recnt and related fields need to be in its own cacheline for performance
reasons. Commit 61adedf3 ("route: move lwtunnel state to dst_entry")
broke that on 32bit archs, causing BUILD_BUG_ON in dst_hold to be triggered.

This patch fixes the breakage by moving the lwtunnel state to the end of
dst_entry on 32bit archs. Unfortunately, this makes it share the cacheline
with __refcnt and may affect performance, thus further patches may be
needed.
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Fixes: 61adedf3 ("route: move lwtunnel state to dst_entry")
Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 31fbde99
...@@ -44,7 +44,6 @@ struct dst_entry { ...@@ -44,7 +44,6 @@ struct dst_entry {
#else #else
void *__pad1; void *__pad1;
#endif #endif
struct lwtunnel_state *lwtstate;
int (*input)(struct sk_buff *); int (*input)(struct sk_buff *);
int (*output)(struct sock *sk, struct sk_buff *skb); int (*output)(struct sock *sk, struct sk_buff *skb);
...@@ -85,11 +84,12 @@ struct dst_entry { ...@@ -85,11 +84,12 @@ struct dst_entry {
__u32 __pad2; __u32 __pad2;
#endif #endif
#ifdef CONFIG_64BIT
struct lwtunnel_state *lwtstate;
/* /*
* Align __refcnt to a 64 bytes alignment * Align __refcnt to a 64 bytes alignment
* (L1_CACHE_SIZE would be too much) * (L1_CACHE_SIZE would be too much)
*/ */
#ifdef CONFIG_64BIT
long __pad_to_align_refcnt[1]; long __pad_to_align_refcnt[1];
#endif #endif
/* /*
...@@ -99,6 +99,9 @@ struct dst_entry { ...@@ -99,6 +99,9 @@ struct dst_entry {
atomic_t __refcnt; /* client references */ atomic_t __refcnt; /* client references */
int __use; int __use;
unsigned long lastuse; unsigned long lastuse;
#ifndef CONFIG_64BIT
struct lwtunnel_state *lwtstate;
#endif
union { union {
struct dst_entry *next; struct dst_entry *next;
struct rtable __rcu *rt_next; struct rtable __rcu *rt_next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment