Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys pullup (approved by releng-1-5)
details: https://anonhg.NetBSD.org/src/rev/046f0fbd2df7
branches: netbsd-1-5
changeset: 488502:046f0fbd2df7
user: itojun <itojun%NetBSD.org@localhost>
date: Fri Jul 14 06:14:33 2000 +0000
description:
pullup (approved by releng-1-5)
remove m_pulldown statistics code. it is highly experimental and belong
to kame tree only (not for *bsd).
1.4 -> 1.5 syssrc/sys/kern/uipc_mbuf2.c
1.8 -> 1.9 syssrc/sys/netinet/ip6.h
1.13 -> 1.14 syssrc/sys/netinet6/ip6_var.h
diffstat:
sys/kern/uipc_mbuf2.c | 91 +-------------------------------------------------
sys/netinet/ip6.h | 18 ++-------
sys/netinet6/ip6_var.h | 16 +--------
3 files changed, 7 insertions(+), 118 deletions(-)
diffs (236 lines):
diff -r 7bcf1a08b765 -r 046f0fbd2df7 sys/kern/uipc_mbuf2.c
--- a/sys/kern/uipc_mbuf2.c Fri Jul 14 05:49:37 2000 +0000
+++ b/sys/kern/uipc_mbuf2.c Fri Jul 14 06:14:33 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_mbuf2.c,v 1.4 2000/03/01 12:49:29 itojun Exp $ */
+/* $NetBSD: uipc_mbuf2.c,v 1.4.4.1 2000/07/14 06:14:33 itojun Exp $ */
/* $KAME: uipc_mbuf2.c,v 1.15 2000/02/22 14:01:37 itojun Exp $ */
/*
@@ -65,25 +65,13 @@
* @(#)uipc_mbuf.c 8.4 (Berkeley) 2/14/95
*/
-#define PULLDOWN_STAT
/*#define PULLDOWN_DEBUG*/
-#ifdef PULLDOWN_STAT
-#if defined(__NetBSD__) || (defined(__FreeBSD__) && __FreeBSD__ >= 3)
-#include "opt_inet.h"
-#endif
-#endif
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
-#if defined(PULLDOWN_STAT) && defined(INET6)
-#include <netinet/in.h>
-#include <netinet/ip6.h>
-#include <netinet6/ip6_var.h>
-#endif
/*
* ensure that [off, off + len) is contiguous on the mbuf chain "m".
@@ -104,10 +92,6 @@
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)
@@ -117,72 +101,6 @@
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;
@@ -214,10 +132,6 @@
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 <n, off> sits in single mbuf, but the caller does
@@ -302,9 +216,6 @@
* 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 -r 7bcf1a08b765 -r 046f0fbd2df7 sys/netinet/ip6.h
--- a/sys/netinet/ip6.h Fri Jul 14 05:49:37 2000 +0000
+++ b/sys/netinet/ip6.h Fri Jul 14 06:14:33 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6.h,v 1.6.4.2 2000/07/03 22:53:01 thorpej Exp $ */
+/* $NetBSD: ip6.h,v 1.6.4.3 2000/07/14 06:14:34 itojun Exp $ */
/* $KAME: ip6.h,v 1.9 2000/07/02 21:01:32 itojun Exp $ */
/*
@@ -216,36 +216,30 @@
* 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; \
@@ -267,7 +261,6 @@
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 { \
@@ -286,7 +279,6 @@
#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 -r 7bcf1a08b765 -r 046f0fbd2df7 sys/netinet6/ip6_var.h
--- a/sys/netinet6/ip6_var.h Fri Jul 14 05:49:37 2000 +0000
+++ b/sys/netinet6/ip6_var.h Fri Jul 14 06:14:33 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_var.h,v 1.12 2000/03/21 23:53:31 itojun Exp $ */
+/* $NetBSD: ip6_var.h,v 1.12.4.1 2000/07/14 06:14:34 itojun Exp $ */
/* $KAME: ip6_var.h,v 1.28 2000/03/09 00:46:12 itojun Exp $ */
/*
@@ -170,20 +170,6 @@
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
Home |
Main Index |
Thread Index |
Old Index