diff options
Diffstat (limited to 'include/net/snmp.h')
-rw-r--r-- | include/net/snmp.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/net/snmp.h b/include/net/snmp.h index 57c93628695f..8c842e06bec8 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -153,6 +153,11 @@ struct linux_xfrm_mib { | |||
153 | per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]--; \ | 153 | per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]--; \ |
154 | put_cpu(); \ | 154 | put_cpu(); \ |
155 | } while (0) | 155 | } while (0) |
156 | #define SNMP_ADD_STATS(mib, field, addend) \ | ||
157 | do { \ | ||
158 | per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field] += addend; \ | ||
159 | put_cpu(); \ | ||
160 | } while (0) | ||
156 | #define SNMP_ADD_STATS_BH(mib, field, addend) \ | 161 | #define SNMP_ADD_STATS_BH(mib, field, addend) \ |
157 | (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field] += addend) | 162 | (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field] += addend) |
158 | #define SNMP_ADD_STATS_USER(mib, field, addend) \ | 163 | #define SNMP_ADD_STATS_USER(mib, field, addend) \ |
@@ -160,5 +165,17 @@ struct linux_xfrm_mib { | |||
160 | per_cpu_ptr(mib[1], get_cpu())->mibs[field] += addend; \ | 165 | per_cpu_ptr(mib[1], get_cpu())->mibs[field] += addend; \ |
161 | put_cpu(); \ | 166 | put_cpu(); \ |
162 | } while (0) | 167 | } while (0) |
163 | 168 | #define SNMP_UPD_PO_STATS(mib, basefield, addend) \ | |
169 | do { \ | ||
170 | __typeof__(mib[0]) ptr = per_cpu_ptr(mib[!in_softirq()], get_cpu());\ | ||
171 | ptr->mibs[basefield##PKTS]++; \ | ||
172 | ptr->mibs[basefield##OCTETS] += addend;\ | ||
173 | put_cpu(); \ | ||
174 | } while (0) | ||
175 | #define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \ | ||
176 | do { \ | ||
177 | __typeof__(mib[0]) ptr = per_cpu_ptr(mib[!in_softirq()], raw_smp_processor_id());\ | ||
178 | ptr->mibs[basefield##PKTS]++; \ | ||
179 | ptr->mibs[basefield##OCTETS] += addend;\ | ||
180 | } while (0) | ||
164 | #endif | 181 | #endif |