aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/snmp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/snmp.h')
-rw-r--r--include/net/snmp.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 27461d6dd46f..479083a78b0c 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -72,14 +72,24 @@ struct icmpmsg_mib {
72 72
73/* ICMP6 (IPv6-ICMP) */ 73/* ICMP6 (IPv6-ICMP) */
74#define ICMP6_MIB_MAX __ICMP6_MIB_MAX 74#define ICMP6_MIB_MAX __ICMP6_MIB_MAX
75/* per network ns counters */
75struct icmpv6_mib { 76struct icmpv6_mib {
76 unsigned long mibs[ICMP6_MIB_MAX]; 77 unsigned long mibs[ICMP6_MIB_MAX];
77}; 78};
79/* per device counters, (shared on all cpus) */
80struct icmpv6_mib_device {
81 atomic_long_t mibs[ICMP6_MIB_MAX];
82};
78 83
79#define ICMP6MSG_MIB_MAX __ICMP6MSG_MIB_MAX 84#define ICMP6MSG_MIB_MAX __ICMP6MSG_MIB_MAX
85/* per network ns counters */
80struct icmpv6msg_mib { 86struct icmpv6msg_mib {
81 unsigned long mibs[ICMP6MSG_MIB_MAX]; 87 unsigned long mibs[ICMP6MSG_MIB_MAX];
82}; 88};
89/* per device counters, (shared on all cpus) */
90struct icmpv6msg_mib_device {
91 atomic_long_t mibs[ICMP6MSG_MIB_MAX];
92};
83 93
84 94
85/* TCP */ 95/* TCP */
@@ -114,6 +124,8 @@ struct linux_xfrm_mib {
114 */ 124 */
115#define DEFINE_SNMP_STAT(type, name) \ 125#define DEFINE_SNMP_STAT(type, name) \
116 __typeof__(type) __percpu *name[2] 126 __typeof__(type) __percpu *name[2]
127#define DEFINE_SNMP_STAT_ATOMIC(type, name) \
128 __typeof__(type) *name
117#define DECLARE_SNMP_STAT(type, name) \ 129#define DECLARE_SNMP_STAT(type, name) \
118 extern __typeof__(type) __percpu *name[2] 130 extern __typeof__(type) __percpu *name[2]
119 131
@@ -124,6 +136,8 @@ struct linux_xfrm_mib {
124 __this_cpu_inc(mib[0]->mibs[field]) 136 __this_cpu_inc(mib[0]->mibs[field])
125#define SNMP_INC_STATS_USER(mib, field) \ 137#define SNMP_INC_STATS_USER(mib, field) \
126 this_cpu_inc(mib[1]->mibs[field]) 138 this_cpu_inc(mib[1]->mibs[field])
139#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) \
140 atomic_long_inc(&mib->mibs[field])
127#define SNMP_INC_STATS(mib, field) \ 141#define SNMP_INC_STATS(mib, field) \
128 this_cpu_inc(mib[!in_softirq()]->mibs[field]) 142 this_cpu_inc(mib[!in_softirq()]->mibs[field])
129#define SNMP_DEC_STATS(mib, field) \ 143#define SNMP_DEC_STATS(mib, field) \