diff options
author | Neil Horman <nhorman@tuxdriver.com> | 2009-04-27 05:45:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-27 05:45:02 -0400 |
commit | edf391ff17232f097d72441c9ad467bcb3b5db18 (patch) | |
tree | 3d1566e92aff168be842f6033695d234b6597180 /include/net/snmp.h | |
parent | 06bd12c3b861f8ca9e1215428b19dc0026c6268f (diff) |
snmp: add missing counters for RFC 4293
The IP MIB (RFC 4293) defines stats for InOctets, OutOctets, InMcastOctets and
OutMcastOctets:
http://tools.ietf.org/html/rfc4293
But it seems we don't track those in any way that easy to separate from other
protocols. This patch adds those missing counters to the stats file. Tested
successfully by me
With help from Eric Dumazet.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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 |