Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Detach sysctl and event counters in bge_release_...



details:   https://anonhg.NetBSD.org/src/rev/374dc2ed98f0
branches:  trunk
changeset: 352838:374dc2ed98f0
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Apr 12 05:50:52 2017 +0000

description:
Detach sysctl and event counters in bge_release_resources().

diffstat:

 sys/dev/pci/if_bge.c    |  21 +++++++++++++++++++--
 sys/dev/pci/if_bgevar.h |   4 +++-
 2 files changed, 22 insertions(+), 3 deletions(-)

diffs (60 lines):

diff -r 0f8c3cc90238 -r 374dc2ed98f0 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Wed Apr 12 05:08:00 2017 +0000
+++ b/sys/dev/pci/if_bge.c      Wed Apr 12 05:50:52 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.300 2016/12/15 09:28:05 ozaki-r Exp $     */
+/*     $NetBSD: if_bge.c,v 1.301 2017/04/12 05:50:52 msaitoh Exp $     */
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.300 2016/12/15 09:28:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.301 2017/04/12 05:50:52 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -4134,6 +4134,23 @@
 bge_release_resources(struct bge_softc *sc)
 {
 
+       /* Detach sysctl */
+       if (sc->bge_log != NULL)
+               sysctl_teardown(&sc->bge_log);
+
+#ifdef BGE_EVENT_COUNTERS
+       /* Detach event counters. */
+       evcnt_detach(&sc->bge_ev_intr);
+       evcnt_detach(&sc->bge_ev_intr_spurious);
+       evcnt_detach(&sc->bge_ev_intr_spurious2);
+       evcnt_detach(&sc->bge_ev_tx_xoff);
+       evcnt_detach(&sc->bge_ev_tx_xon);
+       evcnt_detach(&sc->bge_ev_rx_xoff);
+       evcnt_detach(&sc->bge_ev_rx_xon);
+       evcnt_detach(&sc->bge_ev_rx_macctl);
+       evcnt_detach(&sc->bge_ev_xoffentered);
+#endif /* BGE_EVENT_COUNTERS */
+
        /* Disestablish the interrupt handler */
        if (sc->bge_intrhand != NULL) {
                pci_intr_disestablish(sc->sc_pc, sc->bge_intrhand);
diff -r 0f8c3cc90238 -r 374dc2ed98f0 sys/dev/pci/if_bgevar.h
--- a/sys/dev/pci/if_bgevar.h   Wed Apr 12 05:08:00 2017 +0000
+++ b/sys/dev/pci/if_bgevar.h   Wed Apr 12 05:50:52 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bgevar.h,v 1.21 2015/11/18 10:26:57 msaitoh Exp $   */
+/*     $NetBSD: if_bgevar.h,v 1.22 2017/04/12 05:50:52 msaitoh Exp $   */
 /*
  * Copyright (c) 2001 Wind River Systems
  * Copyright (c) 1997, 1998, 1999, 2001
@@ -326,6 +326,8 @@
         * Event counters.
         */
        struct evcnt bge_ev_intr;       /* interrupts */
+       struct evcnt bge_ev_intr_spurious;  /* spurious intr. (taged status) */
+       struct evcnt bge_ev_intr_spurious2; /* spurious interrupts */
        struct evcnt bge_ev_tx_xoff;    /* send PAUSE(len>0) packets */
        struct evcnt bge_ev_tx_xon;     /* send PAUSE(len=0) packets */
        struct evcnt bge_ev_rx_xoff;    /* receive PAUSE(len>0) packets */



Home | Main Index | Thread Index | Old Index