Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Stop callout for statistics while the interface ...



details:   https://anonhg.NetBSD.org/src/rev/beae42ef1670
branches:  trunk
changeset: 849267:beae42ef1670
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Tue Feb 25 07:41:32 2020 +0000

description:
Stop callout for statistics while the interface is not running

diffstat:

 sys/dev/pci/if_ixl.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r e83d58f4e3a2 -r beae42ef1670 sys/dev/pci/if_ixl.c
--- a/sys/dev/pci/if_ixl.c      Tue Feb 25 07:35:54 2020 +0000
+++ b/sys/dev/pci/if_ixl.c      Tue Feb 25 07:41:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ixl.c,v 1.49 2020/02/25 07:35:54 yamaguchi Exp $    */
+/*     $NetBSD: if_ixl.c,v 1.50 2020/02/25 07:41:32 yamaguchi Exp $    */
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.49 2020/02/25 07:35:54 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.50 2020/02/25 07:41:32 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1448,7 +1448,6 @@
 
        ixl_stats_update(sc);
        sc->sc_stats_counters.isc_has_offset = true;
-       callout_schedule(&sc->sc_stats_callout, mstohz(sc->sc_stats_intval));
 
        if (pmf_device_register(self, NULL, NULL) != true)
                aprint_debug_dev(self, "couldn't establish power handler\n");
@@ -2133,6 +2132,8 @@
                return error;
        }
 
+       callout_schedule(&sc->sc_stats_callout, mstohz(sc->sc_stats_intval));
+
        return 0;
 }
 
@@ -2246,6 +2247,7 @@
        KASSERT(mutex_owned(&sc->sc_cfg_lock));
 
        CLR(ifp->if_flags, IFF_RUNNING | IFF_OACTIVE);
+       callout_stop(&sc->sc_stats_callout);
 
        for (i = 0; i < sc->sc_nqueue_pairs; i++) {
                txr = sc->sc_qps[i].qp_txr;



Home | Main Index | Thread Index | Old Index