aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dst.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/dst.h')
-rw-r--r--include/net/dst.h39
1 files changed, 11 insertions, 28 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index d49d607dd2b3..c63d2c37f6e9 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -34,13 +34,9 @@ struct sk_buff;
34 34
35struct dst_entry { 35struct dst_entry {
36 struct net_device *dev; 36 struct net_device *dev;
37 struct rcu_head rcu_head;
38 struct dst_entry *child;
39 struct dst_ops *ops; 37 struct dst_ops *ops;
40 unsigned long _metrics; 38 unsigned long _metrics;
41 unsigned long expires; 39 unsigned long expires;
42 struct dst_entry *path;
43 struct dst_entry *from;
44#ifdef CONFIG_XFRM 40#ifdef CONFIG_XFRM
45 struct xfrm_state *xfrm; 41 struct xfrm_state *xfrm;
46#else 42#else
@@ -59,8 +55,6 @@ struct dst_entry {
59#define DST_XFRM_QUEUE 0x0040 55#define DST_XFRM_QUEUE 0x0040
60#define DST_METADATA 0x0080 56#define DST_METADATA 0x0080
61 57
62 short error;
63
64 /* A non-zero value of dst->obsolete forces by-hand validation 58 /* A non-zero value of dst->obsolete forces by-hand validation
65 * of the route entry. Positive values are set by the generic 59 * of the route entry. Positive values are set by the generic
66 * dst layer to indicate that the entry has been forcefully 60 * dst layer to indicate that the entry has been forcefully
@@ -76,35 +70,24 @@ struct dst_entry {
76#define DST_OBSOLETE_KILL -2 70#define DST_OBSOLETE_KILL -2
77 unsigned short header_len; /* more space at head required */ 71 unsigned short header_len; /* more space at head required */
78 unsigned short trailer_len; /* space to reserve at tail */ 72 unsigned short trailer_len; /* space to reserve at tail */
79 unsigned short __pad3;
80 73
81#ifdef CONFIG_IP_ROUTE_CLASSID
82 __u32 tclassid;
83#else
84 __u32 __pad2;
85#endif
86
87#ifdef CONFIG_64BIT
88 /*
89 * Align __refcnt to a 64 bytes alignment
90 * (L1_CACHE_SIZE would be too much)
91 */
92 long __pad_to_align_refcnt[2];
93#endif
94 /* 74 /*
95 * __refcnt wants to be on a different cache line from 75 * __refcnt wants to be on a different cache line from
96 * input/output/ops or performance tanks badly 76 * input/output/ops or performance tanks badly
97 */ 77 */
98 atomic_t __refcnt; /* client references */ 78#ifdef CONFIG_64BIT
79 atomic_t __refcnt; /* 64-bit offset 64 */
80#endif
99 int __use; 81 int __use;
100 unsigned long lastuse; 82 unsigned long lastuse;
101 struct lwtunnel_state *lwtstate; 83 struct lwtunnel_state *lwtstate;
102 union { 84 struct rcu_head rcu_head;
103 struct dst_entry *next; 85 short error;
104 struct rtable __rcu *rt_next; 86 short __pad;
105 struct rt6_info __rcu *rt6_next; 87 __u32 tclassid;
106 struct dn_route __rcu *dn_next; 88#ifndef CONFIG_64BIT
107 }; 89 atomic_t __refcnt; /* 32-bit offset 64 */
90#endif
108}; 91};
109 92
110struct dst_metrics { 93struct dst_metrics {
@@ -250,7 +233,7 @@ static inline void dst_hold(struct dst_entry *dst)
250{ 233{
251 /* 234 /*
252 * If your kernel compilation stops here, please check 235 * If your kernel compilation stops here, please check
253 * __pad_to_align_refcnt declaration in struct dst_entry 236 * the placement of __refcnt in struct dst_entry
254 */ 237 */
255 BUILD_BUG_ON(offsetof(struct dst_entry, __refcnt) & 63); 238 BUILD_BUG_ON(offsetof(struct dst_entry, __refcnt) & 63);
256 WARN_ON(atomic_inc_not_zero(&dst->__refcnt) == 0); 239 WARN_ON(atomic_inc_not_zero(&dst->__refcnt) == 0);