diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-10-15 05:40:06 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-15 15:26:42 -0400 |
commit | 8e7999c44ee95e1e90ac91c83557a04e2948f160 (patch) | |
tree | 4295add7b91114fd43eef37d70b664858776dd0d /include/net | |
parent | 1e4b82873af0f21002e37a81ef063d2e5410deb3 (diff) |
[INET]: Consolidate the xxx_evictor
The evictors collect some statistics for ipv4 and ipv6,
so make it return the number of evicted queues and account
them all at once in the caller.
The XXX_ADD_STATS_BH() macros are just for this case,
but maybe there are places in code, that can make use of
them as well.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/inet_frag.h | 1 | ||||
-rw-r--r-- | include/net/ip.h | 1 | ||||
-rw-r--r-- | include/net/ipv6.h | 9 |
3 files changed, 11 insertions, 0 deletions
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 2dd1cd4e7f44..cf583cf7e9ef 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
@@ -49,5 +49,6 @@ void inet_frags_fini(struct inet_frags *); | |||
49 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); | 49 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); |
50 | void inet_frag_destroy(struct inet_frag_queue *q, | 50 | void inet_frag_destroy(struct inet_frag_queue *q, |
51 | struct inet_frags *f, int *work); | 51 | struct inet_frags *f, int *work); |
52 | int inet_frag_evictor(struct inet_frags *f); | ||
52 | 53 | ||
53 | #endif | 54 | #endif |
diff --git a/include/net/ip.h b/include/net/ip.h index e6aa955e241c..840dd91b513b 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -160,6 +160,7 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics); | |||
160 | #define IP_INC_STATS(field) SNMP_INC_STATS(ip_statistics, field) | 160 | #define IP_INC_STATS(field) SNMP_INC_STATS(ip_statistics, field) |
161 | #define IP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ip_statistics, field) | 161 | #define IP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ip_statistics, field) |
162 | #define IP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ip_statistics, field) | 162 | #define IP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ip_statistics, field) |
163 | #define IP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(ip_statistics, field, val) | ||
163 | DECLARE_SNMP_STAT(struct linux_mib, net_statistics); | 164 | DECLARE_SNMP_STAT(struct linux_mib, net_statistics); |
164 | #define NET_INC_STATS(field) SNMP_INC_STATS(net_statistics, field) | 165 | #define NET_INC_STATS(field) SNMP_INC_STATS(net_statistics, field) |
165 | #define NET_INC_STATS_BH(field) SNMP_INC_STATS_BH(net_statistics, field) | 166 | #define NET_INC_STATS_BH(field) SNMP_INC_STATS_BH(net_statistics, field) |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index b29d76c715d2..a0f1042037f2 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -120,12 +120,21 @@ extern int sysctl_mld_max_msf; | |||
120 | SNMP_INC_STATS##modifier(statname##_statistics, (field)); \ | 120 | SNMP_INC_STATS##modifier(statname##_statistics, (field)); \ |
121 | }) | 121 | }) |
122 | 122 | ||
123 | #define _DEVADD(statname, modifier, idev, field, val) \ | ||
124 | ({ \ | ||
125 | struct inet6_dev *_idev = (idev); \ | ||
126 | if (likely(_idev != NULL)) \ | ||
127 | SNMP_ADD_STATS##modifier((_idev)->stats.statname, (field), (val)); \ | ||
128 | SNMP_ADD_STATS##modifier(statname##_statistics, (field), (val));\ | ||
129 | }) | ||
130 | |||
123 | /* MIBs */ | 131 | /* MIBs */ |
124 | DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); | 132 | DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); |
125 | 133 | ||
126 | #define IP6_INC_STATS(idev,field) _DEVINC(ipv6, , idev, field) | 134 | #define IP6_INC_STATS(idev,field) _DEVINC(ipv6, , idev, field) |
127 | #define IP6_INC_STATS_BH(idev,field) _DEVINC(ipv6, _BH, idev, field) | 135 | #define IP6_INC_STATS_BH(idev,field) _DEVINC(ipv6, _BH, idev, field) |
128 | #define IP6_INC_STATS_USER(idev,field) _DEVINC(ipv6, _USER, idev, field) | 136 | #define IP6_INC_STATS_USER(idev,field) _DEVINC(ipv6, _USER, idev, field) |
137 | #define IP6_ADD_STATS_BH(idev,field,val) _DEVADD(ipv6, _BH, idev, field, val) | ||
129 | 138 | ||
130 | DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); | 139 | DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); |
131 | DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics); | 140 | DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics); |