summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-04-11 23:35:20 +0000
committerrwatson <rwatson@FreeBSD.org>2009-04-11 23:35:20 +0000
commit692f8aa2fac966ef1adc29843ad741d355db1ecd (patch)
tree10c5a6d474eb50a7cbc30483b13c043872a03382 /sys/contrib
parent000707192e4b75299e3d0c78425c7da549319f08 (diff)
downloadFreeBSD-src-692f8aa2fac966ef1adc29843ad741d355db1ecd.zip
FreeBSD-src-692f8aa2fac966ef1adc29843ad741d355db1ecd.tar.gz
Update stats in struct ipstat using four new macros, IPSTAT_ADD(),
IPSTAT_INC(), IPSTAT_SUB(), and IPSTAT_DEC(), rather than directly manipulating the fields across the kernel. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structures. MFC after: 3 days
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/pf/net/pf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c
index 7aad507..241f2b1 100644
--- a/sys/contrib/pf/net/pf.c
+++ b/sys/contrib/pf/net/pf.c
@@ -6153,7 +6153,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
if (r->rt == PF_FASTROUTE) {
in_rtalloc(ro, 0);
if (ro->ro_rt == 0) {
- V_ipstat.ips_noroute++;
+ IPSTAT_INC(ips_noroute);
goto bad;
}
@@ -6284,7 +6284,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
if ((ifp->if_capabilities & IFCAP_CSUM_IPv4) &&
ifp->if_bridge == NULL) {
m0->m_pkthdr.csum_flags |= M_IPV4_CSUM_OUT;
- V_ipstat.ips_outhwcsum++;
+ IPSTAT_INC(ips_outhwcsum);
} else {
ip->ip_sum = 0;
ip->ip_sum = in_cksum(m0, ip->ip_hl << 2);
@@ -6303,7 +6303,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
* Must be able to put at least 8 bytes per fragment.
*/
if (ip->ip_off & htons(IP_DF)) {
- V_ipstat.ips_cantfrag++;
+ IPSTAT_INC(ips_cantfrag);
if (r->rt != PF_DUPTO) {
#ifdef __FreeBSD__
/* icmp_error() expects host byte ordering */
@@ -6360,7 +6360,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
}
if (error == 0)
- V_ipstat.ips_fragmented++;
+ IPSTAT_INC(ips_fragmented);
done:
if (r->rt != PF_DUPTO)
OpenPOWER on IntegriCloud