diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c index 07ce44244d0a..b39c00264ad5 100644 --- a/sys/kern/uipc_mbuf2.c +++ b/sys/kern/uipc_mbuf2.c @@ -66,23 +66,13 @@ * @(#)uipc_mbuf.c 8.4 (Berkeley) 2/14/95 */ -#define PULLDOWN_STAT /*#define PULLDOWN_DEBUG*/ -#ifdef PULLDOWN_STAT -#include "opt_inet.h" -#endif - #include #include #include #include #include -#if defined(PULLDOWN_STAT) && defined(INET6) -#include -#include -#include -#endif /* * ensure that [off, off + len) is contiguous on the mbuf chain "m". @@ -103,10 +93,6 @@ m_pulldown(m, off, len, offp) struct mbuf *n, *o; int hlen, tlen, olen; int sharedcluster; -#if defined(PULLDOWN_STAT) && defined(INET6) - static struct mbuf *prev = NULL; - int prevlen = 0, prevmlen = 0; -#endif /* check invalid arguments. */ if (m == NULL) @@ -116,72 +102,6 @@ m_pulldown(m, off, len, offp) return NULL; /* impossible */ } -#if defined(PULLDOWN_STAT) && defined(INET6) - ip6stat.ip6s_pulldown++; -#endif - -#if defined(PULLDOWN_STAT) && defined(INET6) - /* statistics for m_pullup */ - ip6stat.ip6s_pullup++; - if (off + len > MHLEN) - ip6stat.ip6s_pullup_fail++; - else { - int dlen, mlen; - - dlen = (prev == m) ? prevlen : m->m_len; - mlen = (prev == m) ? prevmlen : m->m_len + M_TRAILINGSPACE(m); - - if (dlen >= off + len) - ip6stat.ip6s_pullup--; /* call will not be made! */ - else if ((m->m_flags & M_EXT) != 0) { - ip6stat.ip6s_pullup_alloc++; - ip6stat.ip6s_pullup_copy++; - } else { - if (mlen >= off + len) - ip6stat.ip6s_pullup_copy++; - else { - ip6stat.ip6s_pullup_alloc++; - ip6stat.ip6s_pullup_copy++; - } - } - - prevlen = off + len; - prevmlen = MHLEN; - } - - /* statistics for m_pullup2 */ - ip6stat.ip6s_pullup2++; - if (off + len > MCLBYTES) - ip6stat.ip6s_pullup2_fail++; - else { - int dlen, mlen; - - dlen = (prev == m) ? prevlen : m->m_len; - mlen = (prev == m) ? prevmlen : m->m_len + M_TRAILINGSPACE(m); - prevlen = off + len; - prevmlen = mlen; - - if (dlen >= off + len) - ip6stat.ip6s_pullup2--; /* call will not be made! */ - else if ((m->m_flags & M_EXT) != 0) { - ip6stat.ip6s_pullup2_alloc++; - ip6stat.ip6s_pullup2_copy++; - prevmlen = (off + len > MHLEN) ? MCLBYTES : MHLEN; - } else { - if (mlen >= off + len) - ip6stat.ip6s_pullup2_copy++; - else { - ip6stat.ip6s_pullup2_alloc++; - ip6stat.ip6s_pullup2_copy++; - prevmlen = (off + len > MHLEN) ? MCLBYTES - : MHLEN; - } - } - } - - prev = m; -#endif - #ifdef PULLDOWN_DEBUG { struct mbuf *t; @@ -213,10 +133,6 @@ m_pulldown(m, off, len, offp) if ((off == 0 || offp) && len <= n->m_len - off) goto ok; -#if defined(PULLDOWN_STAT) && defined(INET6) - ip6stat.ip6s_pulldown_copy++; -#endif - /* * when len < n->m_len - off and off != 0, it is a special case. * len bytes from sits in single mbuf, but the caller does @@ -293,9 +209,6 @@ m_pulldown(m, off, len, offp) * now, we need to do the hard way. don't m_copy as there's no room * on both end. */ -#if defined(PULLDOWN_STAT) && defined(INET6) - ip6stat.ip6s_pulldown_alloc++; -#endif MGET(o, M_DONTWAIT, m->m_type); if (o == NULL) { m_freem(m); diff --git a/sys/netinet/ip6.h b/sys/netinet/ip6.h index c194043d2d5c..77d1ab657612 100644 --- a/sys/netinet/ip6.h +++ b/sys/netinet/ip6.h @@ -214,36 +214,30 @@ struct ip6_frag { * supposed to never be matched but is prepared just in case. */ -#ifdef INET6 -#define IP6_EXTHDR_STAT(x) x -#else -#define IP6_EXTHDR_STAT(x) -#endif - #define IP6_EXTHDR_CHECK(m, off, hlen, ret) \ do { \ if ((m)->m_next != NULL) { \ if (((m)->m_flags & M_LOOP) && \ ((m)->m_len < (off) + (hlen)) && \ (((m) = m_pullup((m), (off) + (hlen))) == NULL)) { \ - IP6_EXTHDR_STAT(ip6stat.ip6s_exthdrtoolong++); \ + ip6stat.ip6s_exthdrtoolong++; \ return ret; \ } else if ((m)->m_flags & M_EXT) { \ if ((m)->m_len < (off) + (hlen)) { \ - IP6_EXTHDR_STAT(ip6stat.ip6s_exthdrtoolong++); \ + ip6stat.ip6s_exthdrtoolong++; \ m_freem(m); \ return ret; \ } \ } else { \ if ((m)->m_len < (off) + (hlen)) { \ - IP6_EXTHDR_STAT(ip6stat.ip6s_exthdrtoolong++); \ + ip6stat.ip6s_exthdrtoolong++; \ m_freem(m); \ return ret; \ } \ } \ } else { \ if ((m)->m_len < (off) + (hlen)) { \ - IP6_EXTHDR_STAT(ip6stat.ip6s_tooshort++); \ + ip6stat.ip6s_tooshort++; \ in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated); \ m_freem(m); \ return ret; \ @@ -265,7 +259,6 @@ do { \ do { \ struct mbuf *t; \ int tmp; \ - IP6_EXTHDR_STAT(ip6stat.ip6s_exthdrget++); \ if ((m)->m_len >= (off) + (len)) \ (val) = (typ)(mtod((m), caddr_t) + (off)); \ else { \ @@ -284,7 +277,6 @@ do { \ #define IP6_EXTHDR_GET0(val, typ, m, off, len) \ do { \ struct mbuf *t; \ - IP6_EXTHDR_STAT(ip6stat.ip6s_exthdrget0++); \ if ((off) == 0) \ (val) = (typ)mtod(m, caddr_t); \ else { \ diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index f6f38247ec5f..234b2e9b13d0 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -170,20 +170,6 @@ struct ip6stat { u_quad_t ip6s_exthdrtoolong; /* ext hdr are not continuous */ u_quad_t ip6s_nogif; /* no match gif found */ u_quad_t ip6s_toomanyhdr; /* discarded due to too many headers */ - /* XXX the following two items are not really AF_INET6 thing */ - u_quad_t ip6s_exthdrget; /* # of calls to IP6_EXTHDR_GET */ - u_quad_t ip6s_exthdrget0; /* # of calls to IP6_EXTHDR_GET0 */ - u_quad_t ip6s_pulldown; /* # of calls to m_pulldown */ - u_quad_t ip6s_pulldown_copy; /* # of mbuf copies in m_pulldown */ - u_quad_t ip6s_pulldown_alloc; /* # of mbuf allocs in m_pulldown */ - u_quad_t ip6s_pullup; /* # of calls to m_pullup */ - u_quad_t ip6s_pullup_copy; /* # of possible m_pullup copies */ - u_quad_t ip6s_pullup_alloc; /* # of possible m_pullup mallocs */ - u_quad_t ip6s_pullup_fail; /* # of possible m_pullup failures */ - u_quad_t ip6s_pullup2; /* # of calls to m_pullup2 */ - u_quad_t ip6s_pullup2_copy; /* # of possible m_pullup2 copies */ - u_quad_t ip6s_pullup2_alloc; /* # of possible m_pullup2 mallocs */ - u_quad_t ip6s_pullup2_fail; /* # of possible m_pullup2 failures */ /* * statistics for improvement of the source address selection