summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-04-11 22:07:19 +0000
committerrwatson <rwatson@FreeBSD.org>2009-04-11 22:07:19 +0000
commitb79ff9a30db8d3975296e0b1fe8978691f774694 (patch)
treed7e60241b428cfa595a3f0e0d467ee67548c9488 /sys/contrib
parent90c1837110aba860c5442bc9151ef6f8e60160a0 (diff)
downloadFreeBSD-src-b79ff9a30db8d3975296e0b1fe8978691f774694.zip
FreeBSD-src-b79ff9a30db8d3975296e0b1fe8978691f774694.tar.gz
Update stats in struct tcpstat using two new macros, TCPSTAT_ADD() and
TCPSTAT_INC(), 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c
index d69372b..7aad507 100644
--- a/sys/contrib/pf/net/pf.c
+++ b/sys/contrib/pf/net/pf.c
@@ -6291,7 +6291,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
}
/* Update relevant hardware checksum stats for TCP/UDP */
if (m0->m_pkthdr.csum_flags & M_TCPV4_CSUM_OUT)
- V_tcpstat.tcps_outhwcsum++;
+ TCPSTAT_INC(tcpstat.tcps_outhwcsum);
else if (m0->m_pkthdr.csum_flags & M_UDPV4_CSUM_OUT)
V_udpstat.udps_outhwcsum++;
error = (*ifp->if_output)(ifp, m0, sintosa(dst), NULL);
@@ -6635,7 +6635,7 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p, sa_family_t a
case IPPROTO_TCP:
{
INIT_VNET_INET(curvnet);
- V_tcpstat.tcps_rcvbadsum++;
+ TCPSTAT_INC(tcps_rcvbadsum);
break;
}
case IPPROTO_UDP:
@@ -6741,7 +6741,7 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p,
m->m_pkthdr.csum_flags |= flag_bad;
switch (p) {
case IPPROTO_TCP:
- V_tcpstat.tcps_rcvbadsum++;
+ TCPSTAT_INC(tcps_rcvbadsum);
break;
case IPPROTO_UDP:
V_udpstat.udps_badsum++;
OpenPOWER on IntegriCloud