aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/neighbour.h7
-rw-r--r--include/net/netfilter/nf_conntrack.h4
2 files changed, 3 insertions, 8 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 3817fda82a80..f28403ff7648 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -90,12 +90,7 @@ struct neigh_statistics
90 unsigned long unres_discards; /* number of unresolved drops */ 90 unsigned long unres_discards; /* number of unresolved drops */
91}; 91};
92 92
93#define NEIGH_CACHE_STAT_INC(tbl, field) \ 93#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 94
100struct neighbour 95struct neighbour
101{ 96{
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index cbdd6284996d..dde549779e42 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -295,11 +295,11 @@ extern unsigned int nf_conntrack_htable_size;
295extern unsigned int nf_conntrack_max; 295extern unsigned int nf_conntrack_max;
296 296
297#define NF_CT_STAT_INC(net, count) \ 297#define NF_CT_STAT_INC(net, count) \
298 (per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++) 298 __this_cpu_inc((net)->ct.stat->count)
299#define NF_CT_STAT_INC_ATOMIC(net, count) \ 299#define NF_CT_STAT_INC_ATOMIC(net, count) \
300do { \ 300do { \
301 local_bh_disable(); \ 301 local_bh_disable(); \
302 per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++; \ 302 __this_cpu_inc((net)->ct.stat->count); \
303 local_bh_enable(); \ 303 local_bh_enable(); \
304} while (0) 304} while (0)
305 305