Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Add support for MBUFTRACE.



details:   https://anonhg.NetBSD.org/src/rev/6253ed4b4fb8
branches:  trunk
changeset: 745775:6253ed4b4fb8
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Mar 12 03:01:46 2020 +0000

description:
Add support for MBUFTRACE.

diffstat:

 sys/dev/ic/aic6915.c   |  7 +++++--
 sys/dev/ic/elinkxl.c   |  6 ++++--
 sys/dev/ic/hme.c       |  5 +++--
 sys/dev/ic/rtl8169.c   |  5 +++--
 sys/dev/ic/rtl81x9.c   |  6 ++++--
 sys/dev/ic/smc83c170.c |  7 +++++--
 6 files changed, 24 insertions(+), 12 deletions(-)

diffs (204 lines):

diff -r 068b7d4abae7 -r 6253ed4b4fb8 sys/dev/ic/aic6915.c
--- a/sys/dev/ic/aic6915.c      Wed Mar 11 23:47:40 2020 +0000
+++ b/sys/dev/ic/aic6915.c      Thu Mar 12 03:01:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic6915.c,v 1.42 2020/02/07 00:56:48 thorpej Exp $     */
+/*     $NetBSD: aic6915.c,v 1.43 2020/03/12 03:01:46 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.42 2020/02/07 00:56:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.43 2020/03/12 03:01:46 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -404,6 +404,7 @@
                                    "unable to allocate Tx mbuf\n");
                                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) {
@@ -769,6 +770,7 @@
                            ds->ds_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) {
@@ -1203,6 +1205,7 @@
        MGETHDR(m, M_DONTWAIT, MT_DATA);
        if (m == NULL)
                return (ENOBUFS);
+       MCLAIM(m, &sc->sc_ethercom.ec_rx_mowner);
 
        MCLGET(m, M_DONTWAIT);
        if ((m->m_flags & M_EXT) == 0) {
diff -r 068b7d4abae7 -r 6253ed4b4fb8 sys/dev/ic/elinkxl.c
--- a/sys/dev/ic/elinkxl.c      Wed Mar 11 23:47:40 2020 +0000
+++ b/sys/dev/ic/elinkxl.c      Thu Mar 12 03:01:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elinkxl.c,v 1.137 2020/02/10 07:48:02 msaitoh Exp $    */
+/*     $NetBSD: elinkxl.c,v 1.138 2020/03/12 03:01:46 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.137 2020/02/10 07:48:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.138 2020/03/12 03:01:46 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1084,6 +1084,7 @@
                                aprint_error("aborting\n");
                                goto out;
                        }
+                       MCLAIM(mn, &sc->sc_ethercom.ec_tx_mowner);
                        if (mb_head->m_pkthdr.len > MHLEN) {
                                MCLGET(mn, M_DONTWAIT);
                                if ((mn->m_flags & M_EXT) == 0) {
@@ -1801,6 +1802,7 @@
 
        MGETHDR(m, M_DONTWAIT, MT_DATA);
        if (m != NULL) {
+               MCLAIM(m, &sc->sc_ethercom.ec_rx_mowner);
                MCLGET(m, M_DONTWAIT);
                if ((m->m_flags & M_EXT) == 0) {
                        m_freem(m);
diff -r 068b7d4abae7 -r 6253ed4b4fb8 sys/dev/ic/hme.c
--- a/sys/dev/ic/hme.c  Wed Mar 11 23:47:40 2020 +0000
+++ b/sys/dev/ic/hme.c  Thu Mar 12 03:01:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hme.c,v 1.107 2020/02/07 00:56:48 thorpej Exp $        */
+/*     $NetBSD: hme.c,v 1.108 2020/03/12 03:01:46 thorpej Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.107 2020/02/07 00:56:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.108 2020/03/12 03:01:46 thorpej Exp $");
 
 /* #define HMEDEBUG */
 
@@ -695,6 +695,7 @@
        MGETHDR(m0, M_DONTWAIT, MT_DATA);
        if (m0 == 0)
                return (0);
+       MCLAIM(m0, &sc->sc_ethercom.ec_rx_mowner);
        m_set_rcvif(m0, ifp);
        m0->m_pkthdr.len = totlen;
        len = MHLEN;
diff -r 068b7d4abae7 -r 6253ed4b4fb8 sys/dev/ic/rtl8169.c
--- a/sys/dev/ic/rtl8169.c      Wed Mar 11 23:47:40 2020 +0000
+++ b/sys/dev/ic/rtl8169.c      Thu Mar 12 03:01:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl8169.c,v 1.164 2020/02/07 00:56:48 thorpej Exp $    */
+/*     $NetBSD: rtl8169.c,v 1.165 2020/03/12 03:01:46 thorpej Exp $    */
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.164 2020/02/07 00:56:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.165 2020/03/12 03:01:46 thorpej Exp $");
 /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
 
 /*
@@ -1076,6 +1076,7 @@
                if (n == NULL)
                        return ENOBUFS;
 
+               MCLAIM(n, &sc->ethercom.ec_rx_mowner);
                MCLGET(n, M_DONTWAIT);
                if ((n->m_flags & M_EXT) == 0) {
                        m_freem(n);
diff -r 068b7d4abae7 -r 6253ed4b4fb8 sys/dev/ic/rtl81x9.c
--- a/sys/dev/ic/rtl81x9.c      Wed Mar 11 23:47:40 2020 +0000
+++ b/sys/dev/ic/rtl81x9.c      Thu Mar 12 03:01:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl81x9.c,v 1.110 2020/02/07 00:56:48 thorpej Exp $    */
+/*     $NetBSD: rtl81x9.c,v 1.111 2020/03/12 03:01:46 thorpej Exp $    */
 
 /*
  * Copyright (c) 1997, 1998
@@ -86,7 +86,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.110 2020/02/07 00:56:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.111 2020/03/12 03:01:46 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -1034,6 +1034,7 @@
                        if_statinc(ifp, if_ierrors);
                        goto next_packet;
                }
+               MCLAIM(m, &sc->ethercom.ec_rx_mowner);
                if (total_len > (MHLEN - RTK_ETHER_ALIGN)) {
                        MCLGET(m, M_DONTWAIT);
                        if ((m->m_flags & M_EXT) == 0) {
@@ -1255,6 +1256,7 @@
                                    device_xname(sc->sc_dev));
                                break;
                        }
+                       MCLAIM(m_new, &sc->ethercom.ec_rx_mowner);
                        if (m_head->m_pkthdr.len > MHLEN) {
                                MCLGET(m_new, M_DONTWAIT);
                                if ((m_new->m_flags & M_EXT) == 0) {
diff -r 068b7d4abae7 -r 6253ed4b4fb8 sys/dev/ic/smc83c170.c
--- a/sys/dev/ic/smc83c170.c    Wed Mar 11 23:47:40 2020 +0000
+++ b/sys/dev/ic/smc83c170.c    Thu Mar 12 03:01:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smc83c170.c,v 1.93 2020/02/07 00:56:48 thorpej Exp $   */
+/*     $NetBSD: smc83c170.c,v 1.94 2020/03/12 03:01:46 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.93 2020/02/07 00:56:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.94 2020/03/12 03:01:46 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -415,6 +415,7 @@
                                    device_xname(sc->sc_dev));
                                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) {
@@ -687,6 +688,7 @@
                                MGETHDR(m, M_DONTWAIT, MT_DATA);
                                if (m == NULL)
                                        goto dropit;
+                               MCLAIM(m, &sc->sc_ethercom.ec_rx_mowner);
                                memcpy(mtod(m, void *),
                                    mtod(ds->ds_mbuf, void *), len);
                                EPIC_INIT_RXDESC(sc, i);
@@ -1220,6 +1222,7 @@
        MGETHDR(m, M_DONTWAIT, MT_DATA);
        if (m == NULL)
                return ENOBUFS;
+       MCLAIM(m, &sc->sc_ethercom.ec_rx_mowner);
 
        MCLGET(m, M_DONTWAIT);
        if ((m->m_flags & M_EXT) == 0) {



Home | Main Index | Thread Index | Old Index