diff options
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r-- | include/net/neighbour.h | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 3817fda82a80..da1d58be31b7 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -37,8 +37,7 @@ | |||
37 | 37 | ||
38 | struct neighbour; | 38 | struct neighbour; |
39 | 39 | ||
40 | struct neigh_parms | 40 | struct neigh_parms { |
41 | { | ||
42 | #ifdef CONFIG_NET_NS | 41 | #ifdef CONFIG_NET_NS |
43 | struct net *net; | 42 | struct net *net; |
44 | #endif | 43 | #endif |
@@ -70,8 +69,7 @@ struct neigh_parms | |||
70 | int locktime; | 69 | int locktime; |
71 | }; | 70 | }; |
72 | 71 | ||
73 | struct neigh_statistics | 72 | struct neigh_statistics { |
74 | { | ||
75 | unsigned long allocs; /* number of allocated neighs */ | 73 | unsigned long allocs; /* number of allocated neighs */ |
76 | unsigned long destroys; /* number of destroyed neighs */ | 74 | unsigned long destroys; /* number of destroyed neighs */ |
77 | unsigned long hash_grows; /* number of hash resizes */ | 75 | unsigned long hash_grows; /* number of hash resizes */ |
@@ -90,15 +88,9 @@ struct neigh_statistics | |||
90 | unsigned long unres_discards; /* number of unresolved drops */ | 88 | unsigned long unres_discards; /* number of unresolved drops */ |
91 | }; | 89 | }; |
92 | 90 | ||
93 | #define NEIGH_CACHE_STAT_INC(tbl, field) \ | 91 | #define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field) |
94 | do { \ | ||
95 | preempt_disable(); \ | ||
96 | (per_cpu_ptr((tbl)->stats, smp_processor_id())->field)++; \ | ||
97 | preempt_enable(); \ | ||
98 | } while (0) | ||
99 | 92 | ||
100 | struct neighbour | 93 | struct neighbour { |
101 | { | ||
102 | struct neighbour *next; | 94 | struct neighbour *next; |
103 | struct neigh_table *tbl; | 95 | struct neigh_table *tbl; |
104 | struct neigh_parms *parms; | 96 | struct neigh_parms *parms; |
@@ -122,8 +114,7 @@ struct neighbour | |||
122 | u8 primary_key[0]; | 114 | u8 primary_key[0]; |
123 | }; | 115 | }; |
124 | 116 | ||
125 | struct neigh_ops | 117 | struct neigh_ops { |
126 | { | ||
127 | int family; | 118 | int family; |
128 | void (*solicit)(struct neighbour *, struct sk_buff*); | 119 | void (*solicit)(struct neighbour *, struct sk_buff*); |
129 | void (*error_report)(struct neighbour *, struct sk_buff*); | 120 | void (*error_report)(struct neighbour *, struct sk_buff*); |
@@ -133,8 +124,7 @@ struct neigh_ops | |||
133 | int (*queue_xmit)(struct sk_buff*); | 124 | int (*queue_xmit)(struct sk_buff*); |
134 | }; | 125 | }; |
135 | 126 | ||
136 | struct pneigh_entry | 127 | struct pneigh_entry { |
137 | { | ||
138 | struct pneigh_entry *next; | 128 | struct pneigh_entry *next; |
139 | #ifdef CONFIG_NET_NS | 129 | #ifdef CONFIG_NET_NS |
140 | struct net *net; | 130 | struct net *net; |
@@ -149,8 +139,7 @@ struct pneigh_entry | |||
149 | */ | 139 | */ |
150 | 140 | ||
151 | 141 | ||
152 | struct neigh_table | 142 | struct neigh_table { |
153 | { | ||
154 | struct neigh_table *next; | 143 | struct neigh_table *next; |
155 | int family; | 144 | int family; |
156 | int entry_size; | 145 | int entry_size; |
@@ -175,7 +164,7 @@ struct neigh_table | |||
175 | rwlock_t lock; | 164 | rwlock_t lock; |
176 | unsigned long last_rand; | 165 | unsigned long last_rand; |
177 | struct kmem_cache *kmem_cachep; | 166 | struct kmem_cache *kmem_cachep; |
178 | struct neigh_statistics *stats; | 167 | struct neigh_statistics __percpu *stats; |
179 | struct neighbour **hash_buckets; | 168 | struct neighbour **hash_buckets; |
180 | unsigned int hash_mask; | 169 | unsigned int hash_mask; |
181 | __u32 hash_rnd; | 170 | __u32 hash_rnd; |
@@ -262,10 +251,8 @@ extern void neigh_seq_stop(struct seq_file *, void *); | |||
262 | 251 | ||
263 | extern int neigh_sysctl_register(struct net_device *dev, | 252 | extern int neigh_sysctl_register(struct net_device *dev, |
264 | struct neigh_parms *p, | 253 | struct neigh_parms *p, |
265 | int p_id, int pdev_id, | ||
266 | char *p_name, | 254 | char *p_name, |
267 | proc_handler *proc_handler, | 255 | proc_handler *proc_handler); |
268 | ctl_handler *strategy); | ||
269 | extern void neigh_sysctl_unregister(struct neigh_parms *p); | 256 | extern void neigh_sysctl_unregister(struct neigh_parms *p); |
270 | 257 | ||
271 | static inline void __neigh_parms_put(struct neigh_parms *parms) | 258 | static inline void __neigh_parms_put(struct neigh_parms *parms) |