Source-Changes-HG archive

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

[src/trunk]: src/sys/dev if_percpuq(9) automatically increments if_ipackets, ...



details:   https://anonhg.NetBSD.org/src/rev/e074a5b333f8
branches:  trunk
changeset: 966447:e074a5b333f8
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Oct 30 07:26:28 2019 +0000

description:
if_percpuq(9) automatically increments if_ipackets, so don't add number of
RX frames from device's statistics counter to if_ipackets to avoid double
count.

diffstat:

 sys/dev/ic/aic6915.c  |  6 ++----
 sys/dev/ic/elinkxl.c  |  6 ++----
 sys/dev/ic/i82557.c   |  5 ++---
 sys/dev/pci/if_age.c  |  6 ++----
 sys/dev/pci/if_alc.c  |  4 +---
 sys/dev/pci/if_ale.c  |  6 ++----
 sys/dev/pci/if_ste.c  |  8 ++++----
 sys/dev/pci/if_stge.c |  7 +++----
 sys/dev/pci/if_tl.c   |  5 ++---
 sys/dev/pci/if_txp.c  |  5 ++---
 sys/dev/pci/if_vte.c  |  5 ++---
 11 files changed, 24 insertions(+), 39 deletions(-)

diffs (287 lines):

diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/ic/aic6915.c
--- a/sys/dev/ic/aic6915.c      Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/ic/aic6915.c      Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic6915.c,v 1.39 2019/05/28 07:41:48 msaitoh Exp $     */
+/*     $NetBSD: aic6915.c,v 1.40 2019/10/30 07:26:28 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.39 2019/05/28 07:41:48 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.40 2019/10/30 07:26:28 msaitoh Exp $");
 
 
 #include <sys/param.h>
@@ -855,8 +855,6 @@
            stats.TransmitAbortDueToExcessingDeferral +
            stats.FramesLostDueToInternalTransmitErrors;
 
-       ifp->if_ipackets += stats.ReceiveOKFrames;
-
        ifp->if_ierrors += stats.ReceiveCRCErrors + stats.AlignmentErrors +
            stats.ReceiveFramesTooLong + stats.ReceiveFramesTooShort +
            stats.ReceiveFramesJabbersError +
diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/ic/elinkxl.c
--- a/sys/dev/ic/elinkxl.c      Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/ic/elinkxl.c      Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elinkxl.c,v 1.132 2019/09/13 07:55:06 msaitoh Exp $    */
+/*     $NetBSD: elinkxl.c,v 1.133 2019/10/30 07:26:28 msaitoh Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.132 2019/09/13 07:55:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.133 2019/10/30 07:26:28 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1487,8 +1487,6 @@
 
        GO_WINDOW(6);
        upperok = bus_space_read_1(iot, ioh, UPPER_FRAMES_OK);
-       ifp->if_ipackets += bus_space_read_1(iot, ioh, RX_FRAMES_OK);
-       ifp->if_ipackets += (upperok & 0x03) << 8;
        ifp->if_opackets += bus_space_read_1(iot, ioh, TX_FRAMES_OK);
        ifp->if_opackets += (upperok & 0x30) << 4;
        ifp->if_ierrors += bus_space_read_1(iot, ioh, RX_OVERRUNS);
diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/ic/i82557.c
--- a/sys/dev/ic/i82557.c       Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/ic/i82557.c       Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i82557.c,v 1.155 2019/09/20 09:00:50 maxv Exp $        */
+/*     $NetBSD: i82557.c,v 1.156 2019/10/30 07:26:28 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.155 2019/09/20 09:00:50 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.156 2019/10/30 07:26:28 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1479,7 +1479,6 @@
        ifp->if_opackets += le32toh(sp->tx_good);
        ifp->if_collisions += le32toh(sp->tx_total_collisions);
        if (sp->rx_good) {
-               ifp->if_ipackets += le32toh(sp->rx_good);
                sc->sc_rxidle = 0;
        } else if (sc->sc_flags & FXPF_RECV_WORKAROUND) {
                sc->sc_rxidle++;
diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/pci/if_age.c
--- a/sys/dev/pci/if_age.c      Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/pci/if_age.c      Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_age.c,v 1.61 2019/09/20 08:58:25 maxv Exp $ */
+/*     $NetBSD: if_age.c,v 1.62 2019/10/30 07:26:28 msaitoh Exp $ */
 /*     $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $        */
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.61 2019/09/20 08:58:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.62 2019/10/30 07:26:28 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -2043,8 +2043,6 @@
            smb->tx_late_colls + smb->tx_underrun +
            smb->tx_pkts_truncated;
 
-       ifp->if_ipackets += smb->rx_frames;
-
        ifp->if_ierrors += smb->rx_crcerrs + smb->rx_lenerrs +
            smb->rx_runts + smb->rx_pkts_truncated +
            smb->rx_fifo_oflows + smb->rx_desc_oflows +
diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/pci/if_alc.c
--- a/sys/dev/pci/if_alc.c      Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/pci/if_alc.c      Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_alc.c,v 1.42 2019/10/17 09:13:48 msaitoh Exp $      */
+/*     $NetBSD: if_alc.c,v 1.43 2019/10/30 07:26:28 msaitoh Exp $      */
 /*     $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $        */
 /*-
  * Copyright (c) 2009, Pyun YongHyeon <yongari%FreeBSD.org@localhost>
@@ -2276,8 +2276,6 @@
        ifp->if_oerrors += smb->tx_late_colls + smb->tx_excess_colls +
            smb->tx_underrun + smb->tx_pkts_truncated;
 
-       ifp->if_ipackets += smb->rx_frames;
-
        ifp->if_ierrors += smb->rx_crcerrs + smb->rx_lenerrs +
            smb->rx_runts + smb->rx_pkts_truncated +
            smb->rx_fifo_oflows + smb->rx_rrs_errs +
diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/pci/if_ale.c
--- a/sys/dev/pci/if_ale.c      Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/pci/if_ale.c      Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ale.c,v 1.33 2019/07/09 08:46:59 msaitoh Exp $      */
+/*     $NetBSD: if_ale.c,v 1.34 2019/10/30 07:26:28 msaitoh Exp $      */
 
 /*-
  * Copyright (c) 2008, Pyun YongHyeon <yongari%FreeBSD.org@localhost>
@@ -32,7 +32,7 @@
 /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.33 2019/07/09 08:46:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.34 2019/10/30 07:26:28 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -1273,8 +1273,6 @@
        ifp->if_oerrors += smb->tx_abort + smb->tx_late_colls +
            smb->tx_underrun;
 
-       ifp->if_ipackets += smb->rx_frames;
-
        ifp->if_ierrors += smb->rx_crcerrs + smb->rx_lenerrs +
            smb->rx_runts + smb->rx_pkts_truncated +
            smb->rx_fifo_oflows + smb->rx_rrs_errs +
diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/pci/if_ste.c
--- a/sys/dev/pci/if_ste.c      Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/pci/if_ste.c      Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ste.c,v 1.56 2019/05/28 07:41:49 msaitoh Exp $      */
+/*     $NetBSD: if_ste.c,v 1.57 2019/10/30 07:26:28 msaitoh Exp $      */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.56 2019/05/28 07:41:49 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.57 2019/10/30 07:26:28 msaitoh Exp $");
 
 
 #include <sys/param.h>
@@ -1099,8 +1099,8 @@
 
        ifp->if_opackets +=
            (u_int) bus_space_read_2(st, sh, STE_FramesTransmittedOK);
-       ifp->if_ipackets +=
-           (u_int) bus_space_read_2(st, sh, STE_FramesReceivedOK);
+
+       (u_int) bus_space_read_2(st, sh, STE_FramesReceivedOK);
 
        ifp->if_collisions +=
            (u_int) bus_space_read_1(st, sh, STE_LateCollisions) +
diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/pci/if_stge.c
--- a/sys/dev/pci/if_stge.c     Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/pci/if_stge.c     Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_stge.c,v 1.71 2019/10/07 11:53:40 msaitoh Exp $     */
+/*     $NetBSD: if_stge.c,v 1.72 2019/10/30 07:26:28 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.71 2019/10/07 11:53:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.72 2019/10/30 07:26:28 msaitoh Exp $");
 
 
 #include <sys/param.h>
@@ -1295,8 +1295,7 @@
 
        (void) bus_space_read_4(st, sh, STGE_OctetRcvOk);
 
-       ifp->if_ipackets +=
-           bus_space_read_4(st, sh, STGE_FramesRcvdOk);
+       (void) bus_space_read_4(st, sh, STGE_FramesRcvdOk);
 
        ifp->if_ierrors +=
            (u_int) bus_space_read_2(st, sh, STGE_FramesLostRxErrors);
diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/pci/if_tl.c
--- a/sys/dev/pci/if_tl.c       Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/pci/if_tl.c       Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tl.c,v 1.116 2019/05/28 07:41:49 msaitoh Exp $      */
+/*     $NetBSD: if_tl.c,v 1.117 2019/10/30 07:26:28 msaitoh Exp $      */
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.116 2019/05/28 07:41:49 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.117 2019/10/30 07:26:28 msaitoh Exp $");
 
 #undef TLDEBUG
 #define TL_PRIV_STATS
@@ -1527,7 +1527,6 @@
        oerr_underr = reg >> 24;
 
        reg =  tl_intreg_read(sc, TL_INT_STATS_RX);
-       ifp->if_ipackets += reg & 0x00ffffff;
        ierr_overr = reg >> 24;
 
        reg =  tl_intreg_read(sc, TL_INT_STATS_FERR);
diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/pci/if_txp.c
--- a/sys/dev/pci/if_txp.c      Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/pci/if_txp.c      Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_txp.c,v 1.59 2019/07/09 08:46:59 msaitoh Exp $ */
+/* $NetBSD: if_txp.c,v 1.60 2019/10/30 07:26:28 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.59 2019/07/09 08:46:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.60 2019/10/30 07:26:28 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -1373,7 +1373,6 @@
        ifp->if_collisions += ext[0].ext_2 + ext[0].ext_3 + ext[1].ext_2 +
            ext[1].ext_3;
        ifp->if_opackets += rsp->rsp_par2;
-       ifp->if_ipackets += ext[2].ext_3;
 
 out:
        if (rsp != NULL)
diff -r 91e1edf4b2aa -r e074a5b333f8 sys/dev/pci/if_vte.c
--- a/sys/dev/pci/if_vte.c      Wed Oct 30 05:35:36 2019 +0000
+++ b/sys/dev/pci/if_vte.c      Wed Oct 30 07:26:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vte.c,v 1.26 2019/05/28 07:41:49 msaitoh Exp $      */
+/*     $NetBSD: if_vte.c,v 1.27 2019/10/30 07:26:28 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2011 Manuel Bouyer.  All rights reserved.
@@ -55,7 +55,7 @@
 /* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.26 2019/05/28 07:41:49 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.27 2019/10/30 07:26:28 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -946,7 +946,6 @@
        /* Update ifp counters. */
        ifp->if_opackets = stat->tx_frames;
        ifp->if_oerrors = stat->tx_late_colls + stat->tx_underruns;
-       ifp->if_ipackets = stat->rx_frames;
        ifp->if_ierrors = stat->rx_crcerrs + stat->rx_runts +
            stat->rx_long_frames + stat->rx_fifo_full;
 }



Home | Main Index | Thread Index | Old Index