summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>2003-02-26 06:31:08 +0000
committermatt <matt@NetBSD.org>2003-02-26 06:31:08 +0000
commit65e5548a17da8b0d96300259233dc2c90ebd5a24 (patch)
tree47cf39006303f7c165cc70f982d6115efe0dc1f4 /sys/dev
parent04ef5573bfe34f31d2ecca9e7c027704004134bf (diff)
Add MBUFTRACE kernel option.
Do a little mbuf rework while here. Change all uses of MGET*(*, M_WAIT, *) to m_get*(M_WAIT, *). These are not performance critical and making them call m_get saves considerable space. Add m_clget analogue of MCLGET and make corresponding change for M_WAIT uses. Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE. Begin to change netstat to use sysctl.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/gem.c6
-rw-r--r--sys/dev/ic/i82557.c7
-rw-r--r--sys/dev/ic/pdq_ifsubr.c5
-rw-r--r--sys/dev/ic/sgec.c5
-rw-r--r--sys/dev/ic/tulip.c7
-rw-r--r--sys/dev/kttcp.c8
6 files changed, 24 insertions, 14 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c
index 12d4c2a25f7..543e416f939 100644
--- a/sys/dev/ic/gem.c
+++ b/sys/dev/ic/gem.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gem.c,v 1.25 2003/02/20 00:55:21 matt Exp $ */
+/* $NetBSD: gem.c,v 1.26 2003/02/26 06:31:09 matt Exp $ */
/*
*
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.25 2003/02/20 00:55:21 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.26 2003/02/26 06:31:09 matt Exp $");
#include "bpfilter.h"
@@ -1047,6 +1047,7 @@ gem_start(ifp)
sc->sc_dev.dv_xname);
break;
}
+ MCLAIM(m, &sc->sc_ethercom.ec_tx_mowner);
if (m0->m_pkthdr.len > MHLEN) {
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
@@ -1503,6 +1504,7 @@ gem_add_rxbuf(struct gem_softc *sc, int idx)
if (m == NULL)
return (ENOBUFS);
+ MCLAIM(m, &sc->sc_ethercom.ec_rx_mowner);
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
m_freem(m);
diff --git a/sys/dev/ic/i82557.c b/sys/dev/ic/i82557.c
index b15dadf89dd..114ba155dbb 100644
--- a/sys/dev/ic/i82557.c
+++ b/sys/dev/ic/i82557.c
@@ -1,4 +1,4 @@
-/* $NetBSD: i82557.c,v 1.72 2003/02/04 17:50:53 thorpej Exp $ */
+/* $NetBSD: i82557.c,v 1.73 2003/02/26 06:31:09 matt Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.72 2003/02/04 17:50:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.73 2003/02/26 06:31:09 matt Exp $");
#include "bpfilter.h"
#include "rnd.h"
@@ -887,6 +887,7 @@ fxp_start(struct ifnet *ifp)
sc->sc_dev.dv_xname);
break;
}
+ MCLAIM(m, &sc->sc_ethercom.ec_tx_mowner);
if (m0->m_pkthdr.len > MHLEN) {
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
@@ -1206,6 +1207,7 @@ fxp_rxintr(struct fxp_softc *sc)
MGETHDR(m0, M_DONTWAIT, MT_DATA);
if (m == NULL)
goto dropit;
+ MCLAIM(m, &sc->sc_ethercom.ec_rx_mowner);
memcpy(mtod(m0, caddr_t),
mtod(m, caddr_t), len);
FXP_INIT_RFABUF(sc, m);
@@ -1830,6 +1832,7 @@ fxp_add_rfabuf(struct fxp_softc *sc, bus_dmamap_t rxmap, int unload)
if (m == NULL)
return (ENOBUFS);
+ MCLAIM(m, &sc->sc_ethercom.ec_rx_mowner);
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
m_freem(m);
diff --git a/sys/dev/ic/pdq_ifsubr.c b/sys/dev/ic/pdq_ifsubr.c
index 54a77eedd38..51336e99957 100644
--- a/sys/dev/ic/pdq_ifsubr.c
+++ b/sys/dev/ic/pdq_ifsubr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pdq_ifsubr.c,v 1.39 2002/03/05 04:12:58 itojun Exp $ */
+/* $NetBSD: pdq_ifsubr.c,v 1.40 2003/02/26 06:31:10 matt Exp $ */
/*-
* Copyright (c) 1995, 1996 Matt Thomas <matt@3am-software.com>
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.39 2002/03/05 04:12:58 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.40 2003/02/26 06:31:10 matt Exp $");
#ifdef __NetBSD__
#include "opt_inet.h"
@@ -792,6 +792,7 @@ pdq_os_databuf_alloc(
m_free(m);
return NULL;
}
+ MCLAIM(m, &PDQ_FDDICOM(sc)->ec_rx_mowner);
m->m_pkthdr.len = m->m_len = PDQ_OS_DATABUF_SIZE;
if (bus_dmamap_create(sc->sc_dmatag, PDQ_OS_DATABUF_SIZE,
diff --git a/sys/dev/ic/sgec.c b/sys/dev/ic/sgec.c
index a40e491b3b3..b8224f5f3b3 100644
--- a/sys/dev/ic/sgec.c
+++ b/sys/dev/ic/sgec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sgec.c,v 1.21 2003/01/15 22:05:38 bouyer Exp $ */
+/* $NetBSD: sgec.c,v 1.22 2003/02/26 06:31:10 matt Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
*
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.21 2003/01/15 22:05:38 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.22 2003/02/26 06:31:10 matt Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -563,6 +563,7 @@ ze_add_rxbuf(sc, i)
if (m == NULL)
return (ENOBUFS);
+ MCLAIM(m, &sc->sc_ec.ec_rx_mowner);
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
m_freem(m);
diff --git a/sys/dev/ic/tulip.c b/sys/dev/ic/tulip.c
index 7b9741d9ef2..1db05d95791 100644
--- a/sys/dev/ic/tulip.c
+++ b/sys/dev/ic/tulip.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tulip.c,v 1.121 2002/10/08 15:05:35 minoura Exp $ */
+/* $NetBSD: tulip.c,v 1.122 2003/02/26 06:31:10 matt Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.121 2002/10/08 15:05:35 minoura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.122 2003/02/26 06:31:10 matt Exp $");
#include "bpfilter.h"
@@ -755,6 +755,7 @@ tlp_start(ifp)
sc->sc_dev.dv_xname);
break;
}
+ MCLAIM(m, &sc->sc_ethercom.ec_tx_mowner);
if (m0->m_pkthdr.len > MHLEN) {
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
@@ -1324,6 +1325,7 @@ tlp_rxintr(sc)
rxs->rxs_dmamap->dm_mapsize, BUS_DMASYNC_PREREAD);
continue;
}
+ MCLAIM(m, &sc->sc_ethercom.ec_rx_mowner);
if (len > (MHLEN - 2)) {
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
@@ -2289,6 +2291,7 @@ tlp_add_rxbuf(sc, idx)
if (m == NULL)
return (ENOBUFS);
+ MCLAIM(m, &sc->sc_ethercom.ec_rx_mowner);
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
m_freem(m);
diff --git a/sys/dev/kttcp.c b/sys/dev/kttcp.c
index 14905eaad26..0432a2bfbf9 100644
--- a/sys/dev/kttcp.c
+++ b/sys/dev/kttcp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kttcp.c,v 1.8 2003/02/25 23:29:14 briggs Exp $ */
+/* $NetBSD: kttcp.c,v 1.9 2003/02/26 06:31:09 matt Exp $ */
/*
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -288,16 +288,16 @@ kttcp_sosend(struct socket *so, unsigned long long slen,
do {
do {
if (top == 0) {
- MGETHDR(m, M_WAIT, MT_DATA);
+ m = m_gethdr(M_WAIT, MT_DATA);
mlen = MHLEN;
m->m_pkthdr.len = 0;
m->m_pkthdr.rcvif = (struct ifnet *)0;
} else {
- MGET(m, M_WAIT, MT_DATA);
+ m = m_get(M_WAIT, MT_DATA);
mlen = MLEN;
}
if (resid >= MINCLSIZE && space >= MCLBYTES) {
- MCLGET(m, M_WAIT);
+ m_clget(m, M_WAIT);
if ((m->m_flags & M_EXT) == 0)
goto nopages;
mlen = MCLBYTES;