diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 15 | ||||
-rw-r--r-- | include/net/dst.h | 18 | ||||
-rw-r--r-- | include/net/neighbour.h | 2 |
3 files changed, 11 insertions, 24 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 75382378a1ba..5ccc0cb8352b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -252,14 +252,7 @@ struct netdev_hw_addr_list { | |||
252 | netdev_hw_addr_list_for_each(ha, &(dev)->mc) | 252 | netdev_hw_addr_list_for_each(ha, &(dev)->mc) |
253 | 253 | ||
254 | struct hh_cache { | 254 | struct hh_cache { |
255 | atomic_t hh_refcnt; /* number of users */ | 255 | u16 hh_len; |
256 | /* | ||
257 | * We want hh_output, hh_len, hh_lock and hh_data be a in a separate | ||
258 | * cache line on SMP. | ||
259 | * They are mostly read, but hh_refcnt may be changed quite frequently, | ||
260 | * incurring cache line ping pongs. | ||
261 | */ | ||
262 | u16 hh_len ____cacheline_aligned_in_smp; | ||
263 | u16 __pad; | 256 | u16 __pad; |
264 | int (*hh_output)(struct sk_buff *skb); | 257 | int (*hh_output)(struct sk_buff *skb); |
265 | seqlock_t hh_lock; | 258 | seqlock_t hh_lock; |
@@ -273,12 +266,6 @@ struct hh_cache { | |||
273 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; | 266 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; |
274 | }; | 267 | }; |
275 | 268 | ||
276 | static inline void hh_cache_put(struct hh_cache *hh) | ||
277 | { | ||
278 | if (atomic_dec_and_test(&hh->hh_refcnt)) | ||
279 | kfree(hh); | ||
280 | } | ||
281 | |||
282 | /* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. | 269 | /* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. |
283 | * Alternative is: | 270 | * Alternative is: |
284 | * dev->hard_header_len ? (dev->hard_header_len + | 271 | * dev->hard_header_len ? (dev->hard_header_len + |
diff --git a/include/net/dst.h b/include/net/dst.h index e12ddfb9eb16..0dd7ccbc0dd5 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -38,7 +38,6 @@ struct dst_entry { | |||
38 | unsigned long expires; | 38 | unsigned long expires; |
39 | struct dst_entry *path; | 39 | struct dst_entry *path; |
40 | struct neighbour *neighbour; | 40 | struct neighbour *neighbour; |
41 | struct hh_cache *hh; | ||
42 | #ifdef CONFIG_XFRM | 41 | #ifdef CONFIG_XFRM |
43 | struct xfrm_state *xfrm; | 42 | struct xfrm_state *xfrm; |
44 | #else | 43 | #else |
@@ -47,6 +46,14 @@ struct dst_entry { | |||
47 | int (*input)(struct sk_buff*); | 46 | int (*input)(struct sk_buff*); |
48 | int (*output)(struct sk_buff*); | 47 | int (*output)(struct sk_buff*); |
49 | 48 | ||
49 | int flags; | ||
50 | #define DST_HOST 0x0001 | ||
51 | #define DST_NOXFRM 0x0002 | ||
52 | #define DST_NOPOLICY 0x0004 | ||
53 | #define DST_NOHASH 0x0008 | ||
54 | #define DST_NOCACHE 0x0010 | ||
55 | #define DST_NOCOUNT 0x0020 | ||
56 | |||
50 | short error; | 57 | short error; |
51 | short obsolete; | 58 | short obsolete; |
52 | unsigned short header_len; /* more space at head required */ | 59 | unsigned short header_len; /* more space at head required */ |
@@ -62,7 +69,7 @@ struct dst_entry { | |||
62 | * (L1_CACHE_SIZE would be too much) | 69 | * (L1_CACHE_SIZE would be too much) |
63 | */ | 70 | */ |
64 | #ifdef CONFIG_64BIT | 71 | #ifdef CONFIG_64BIT |
65 | long __pad_to_align_refcnt[1]; | 72 | long __pad_to_align_refcnt[2]; |
66 | #endif | 73 | #endif |
67 | /* | 74 | /* |
68 | * __refcnt wants to be on a different cache line from | 75 | * __refcnt wants to be on a different cache line from |
@@ -71,13 +78,6 @@ struct dst_entry { | |||
71 | atomic_t __refcnt; /* client references */ | 78 | atomic_t __refcnt; /* client references */ |
72 | int __use; | 79 | int __use; |
73 | unsigned long lastuse; | 80 | unsigned long lastuse; |
74 | int flags; | ||
75 | #define DST_HOST 0x0001 | ||
76 | #define DST_NOXFRM 0x0002 | ||
77 | #define DST_NOPOLICY 0x0004 | ||
78 | #define DST_NOHASH 0x0008 | ||
79 | #define DST_NOCACHE 0x0010 | ||
80 | #define DST_NOCOUNT 0x0020 | ||
81 | union { | 81 | union { |
82 | struct dst_entry *next; | 82 | struct dst_entry *next; |
83 | struct rtable __rcu *rt_next; | 83 | struct rtable __rcu *rt_next; |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 6fe8c2cd5acb..bd8f9f09ab5c 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -108,7 +108,7 @@ struct neighbour { | |||
108 | __u8 dead; | 108 | __u8 dead; |
109 | seqlock_t ha_lock; | 109 | seqlock_t ha_lock; |
110 | unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; | 110 | unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; |
111 | struct hh_cache *hh; | 111 | struct hh_cache hh; |
112 | int (*output)(struct sk_buff *skb); | 112 | int (*output)(struct sk_buff *skb); |
113 | const struct neigh_ops *ops; | 113 | const struct neigh_ops *ops; |
114 | struct rcu_head rcu; | 114 | struct rcu_head rcu; |