diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-04-11 23:35:20 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-04-11 23:35:20 +0000 |
commit | 692f8aa2fac966ef1adc29843ad741d355db1ecd (patch) | |
tree | 10c5a6d474eb50a7cbc30483b13c043872a03382 /sys/netinet/raw_ip.c | |
parent | 000707192e4b75299e3d0c78425c7da549319f08 (diff) | |
download | FreeBSD-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/netinet/raw_ip.c')
-rw-r--r-- | sys/netinet/raw_ip.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index b536eb7..0775168 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -345,7 +345,7 @@ rip_input(struct mbuf *m, int off) (struct sockaddr *)&group, (struct sockaddr *)&ripsrc); if (blocked != MCAST_PASS) { - V_ipstat.ips_notmember++; + IPSTAT_INC(ips_notmember); continue; } } @@ -364,12 +364,12 @@ rip_input(struct mbuf *m, int off) INP_INFO_RUNLOCK(&V_ripcbinfo); if (last != NULL) { if (rip_append(last, ip, m, &ripsrc) != 0) - V_ipstat.ips_delivered--; + IPSTAT_INC(ips_delivered); INP_RUNLOCK(last); } else { m_freem(m); - V_ipstat.ips_noproto++; - V_ipstat.ips_delivered--; + IPSTAT_INC(ips_noproto); + IPSTAT_DEC(ips_delivered); } } @@ -450,7 +450,7 @@ rip_output(struct mbuf *m, struct socket *so, u_long dst) * XXX prevent ip_output from overwriting header fields. */ flags |= IP_RAWOUTPUT; - V_ipstat.ips_rawout++; + IPSTAT_INC(ips_rawout); } if (inp->inp_flags & INP_ONESBCAST) |