summaryrefslogtreecommitdiffstats
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-08-02 19:43:32 +0000
committerrwatson <rwatson@FreeBSD.org>2009-08-02 19:43:32 +0000
commit5c6699ad3da677119a855665cf574faa86b982fc (patch)
treea40bf95a151eb088ca45c32ee899b724ba74dcea /sys/net/if_bridge.c
parentb08de52c2d9909520082a33aafe53c6ee39df7d7 (diff)
downloadFreeBSD-src-5c6699ad3da677119a855665cf574faa86b982fc.zip
FreeBSD-src-5c6699ad3da677119a855665cf574faa86b982fc.tar.gz
Many network stack subsystems use a single global data structure to hold
all pertinent statatistics for the subsystem. These structures are sometimes "borrowed" by kernel modules that require a place to store statistics for similar events. Add KPI accessor functions for statistics structures referenced by kernel modules so that they no longer encode certain specifics of how the data structures are named and stored. This change is intended to make it easier to move to per-CPU network stats following 8.0-RELEASE. The following modules are affected by this change: if_bridge if_cxgb if_gif ip_mroute ipdivert pf In practice, most of these statistics consumers should, in fact, maintain their own statistics data structures rather than borrowing structures from the base network stack. However, that change is too agressive for this point in the release cycle. Reviewed by: bz Approved by: re (kib)
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index ced953a..f1a79cb 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -3244,12 +3244,12 @@ bridge_ip_checkbasic(struct mbuf **mp)
if ((m = m_copyup(m, sizeof(struct ip),
(max_linkhdr + 3) & ~3)) == NULL) {
/* XXXJRT new stat, please */
- IPSTAT_INC(ips_toosmall);
+ KMOD_IPSTAT_INC(ips_toosmall);
goto bad;
}
} else if (__predict_false(m->m_len < sizeof (struct ip))) {
if ((m = m_pullup(m, sizeof (struct ip))) == NULL) {
- IPSTAT_INC(ips_toosmall);
+ KMOD_IPSTAT_INC(ips_toosmall);
goto bad;
}
}
@@ -3257,17 +3257,17 @@ bridge_ip_checkbasic(struct mbuf **mp)
if (ip == NULL) goto bad;
if (ip->ip_v != IPVERSION) {
- IPSTAT_INC(ips_badvers);
+ KMOD_IPSTAT_INC(ips_badvers);
goto bad;
}
hlen = ip->ip_hl << 2;
if (hlen < sizeof(struct ip)) { /* minimum header length */
- IPSTAT_INC(ips_badhlen);
+ KMOD_IPSTAT_INC(ips_badhlen);
goto bad;
}
if (hlen > m->m_len) {
if ((m = m_pullup(m, hlen)) == 0) {
- IPSTAT_INC(ips_badhlen);
+ KMOD_IPSTAT_INC(ips_badhlen);
goto bad;
}
ip = mtod(m, struct ip *);
@@ -3284,7 +3284,7 @@ bridge_ip_checkbasic(struct mbuf **mp)
}
}
if (sum) {
- IPSTAT_INC(ips_badsum);
+ KMOD_IPSTAT_INC(ips_badsum);
goto bad;
}
@@ -3295,7 +3295,7 @@ bridge_ip_checkbasic(struct mbuf **mp)
* Check for additional length bogosity
*/
if (len < hlen) {
- IPSTAT_INC(ips_badlen);
+ KMOD_IPSTAT_INC(ips_badlen);
goto bad;
}
@@ -3305,7 +3305,7 @@ bridge_ip_checkbasic(struct mbuf **mp)
* Drop packet if shorter than we expect.
*/
if (m->m_pkthdr.len < len) {
- IPSTAT_INC(ips_tooshort);
+ KMOD_IPSTAT_INC(ips_tooshort);
goto bad;
}
@@ -3418,7 +3418,7 @@ bridge_fragment(struct ifnet *ifp, struct mbuf *m, struct ether_header *eh,
}
if (error == 0)
- IPSTAT_INC(ips_fragmented);
+ KMOD_IPSTAT_INC(ips_fragmented);
return (error);
OpenPOWER on IntegriCloud