Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/4e0e0b281179
branches:  trunk
changeset: 464762:4e0e0b281179
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Oct 21 08:22:06 2019 +0000

description:
if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.

diffstat:

 sys/arch/arm/ep93xx/epe.c                |  5 ++---
 sys/arch/mac68k/nubus/if_netdock_nubus.c |  8 +++-----
 sys/dev/ic/i82586.c                      |  5 ++---
 sys/dev/pcmcia/if_cnw.c                  |  5 ++---
 sys/dev/pcmcia/if_ray.c                  |  5 ++---
 sys/dev/qbus/if_il.c                     |  5 ++---
 sys/dev/qbus/if_qt.c                     |  5 ++---
 7 files changed, 15 insertions(+), 23 deletions(-)

diffs (185 lines):

diff -r 1a5e00276e7c -r 4e0e0b281179 sys/arch/arm/ep93xx/epe.c
--- a/sys/arch/arm/ep93xx/epe.c Mon Oct 21 08:00:58 2019 +0000
+++ b/sys/arch/arm/ep93xx/epe.c Mon Oct 21 08:22:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: epe.c,v 1.44 2019/05/30 02:32:17 msaitoh Exp $ */
+/*     $NetBSD: epe.c,v 1.45 2019/10/21 08:22:06 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.44 2019/05/30 02:32:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.45 2019/10/21 08:22:06 msaitoh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -256,7 +256,6 @@
        }
 
        if (ndq > 0) {
-               ifp->if_ipackets += ndq;
                CTRLPAGE_DMASYNC(TX_QLEN * 3 * sizeof(uint32_t),
                        RX_QLEN * 4 * sizeof(uint32_t),
                        BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
diff -r 1a5e00276e7c -r 4e0e0b281179 sys/arch/mac68k/nubus/if_netdock_nubus.c
--- a/sys/arch/mac68k/nubus/if_netdock_nubus.c  Mon Oct 21 08:00:58 2019 +0000
+++ b/sys/arch/mac68k/nubus/if_netdock_nubus.c  Mon Oct 21 08:22:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_netdock_nubus.c,v 1.30 2019/09/13 07:55:06 msaitoh Exp $    */
+/*     $NetBSD: if_netdock_nubus.c,v 1.31 2019/10/21 08:22:06 msaitoh Exp $    */
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato <daishi%axlight.com@localhost>
@@ -43,7 +43,7 @@
 /***********************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.30 2019/09/13 07:55:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.31 2019/10/21 08:22:06 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -725,9 +725,7 @@
                len -= ETHER_CRC_LEN;
 
                if ((regdata1 & 0x00ac) == 0) {
-                       if (netdock_read(sc, len))
-                               ifp->if_ipackets++;
-                       else
+                       if (netdock_read(sc, len) == 0)
                                ifp->if_ierrors++;
                } else {
                        ifp->if_ierrors++;
diff -r 1a5e00276e7c -r 4e0e0b281179 sys/dev/ic/i82586.c
--- a/sys/dev/ic/i82586.c       Mon Oct 21 08:00:58 2019 +0000
+++ b/sys/dev/ic/i82586.c       Mon Oct 21 08:22:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i82586.c,v 1.85 2019/05/29 10:07:29 msaitoh Exp $      */
+/*     $NetBSD: i82586.c,v 1.86 2019/10/21 08:22:06 msaitoh Exp $      */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -137,7 +137,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.85 2019/05/29 10:07:29 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.86 2019/10/21 08:22:06 msaitoh Exp $");
 
 
 #include <sys/param.h>
@@ -1041,7 +1041,6 @@
         * Finally pass this packet up to higher layers.
         */
        if_percpuq_enqueue((&sc->sc_ethercom.ec_if)->if_percpuq, m);
-       sc->sc_ethercom.ec_if.if_ipackets++;
        return (0);
 }
 
diff -r 1a5e00276e7c -r 4e0e0b281179 sys/dev/pcmcia/if_cnw.c
--- a/sys/dev/pcmcia/if_cnw.c   Mon Oct 21 08:00:58 2019 +0000
+++ b/sys/dev/pcmcia/if_cnw.c   Mon Oct 21 08:22:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cnw.c,v 1.65 2019/02/05 06:17:03 msaitoh Exp $      */
+/*     $NetBSD: if_cnw.c,v 1.66 2019/10/21 08:22:06 msaitoh Exp $      */
 
 /*-
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.65 2019/02/05 06:17:03 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.66 2019/10/21 08:22:06 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -848,7 +848,6 @@
                        ++ifp->if_ierrors;
                        return;
                }
-               ++ifp->if_ipackets;
 
                /* Pass the packet up. */
                if_percpuq_enqueue(ifp->if_percpuq, m);
diff -r 1a5e00276e7c -r 4e0e0b281179 sys/dev/pcmcia/if_ray.c
--- a/sys/dev/pcmcia/if_ray.c   Mon Oct 21 08:00:58 2019 +0000
+++ b/sys/dev/pcmcia/if_ray.c   Mon Oct 21 08:22:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ray.c,v 1.94 2019/05/28 07:41:49 msaitoh Exp $      */
+/*     $NetBSD: if_ray.c,v 1.95 2019/10/21 08:22:06 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2000 Christian E. Hopps
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.94 2019/05/28 07:41:49 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.95 2019/10/21 08:22:06 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -1518,7 +1518,6 @@
        m_adj(m, (char *)eh - (char *)frame);
        bpf_mtap(ifp, m, BPF_D_IN);
        /* XXX doesn't appear to be included m->m_flags |= M_HASFCS; */
-       ifp->if_ipackets++;
        if_percpuq_enqueue(ifp->if_percpuq, m);
 }
 
diff -r 1a5e00276e7c -r 4e0e0b281179 sys/dev/qbus/if_il.c
--- a/sys/dev/qbus/if_il.c      Mon Oct 21 08:00:58 2019 +0000
+++ b/sys/dev/qbus/if_il.c      Mon Oct 21 08:22:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_il.c,v 1.35 2019/05/28 07:41:49 msaitoh Exp $       */
+/*     $NetBSD: if_il.c,v 1.36 2019/10/21 08:22:06 msaitoh Exp $       */
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.35 2019/05/28 07:41:49 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.36 2019/10/21 08:22:06 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -509,7 +509,6 @@
        struct mbuf *m;
        int len, s;
 
-       sc->sc_if.if_ipackets++;
 #ifdef notyet
        if (sc->sc_ifuba.ifu_flags & UBA_NEEDBDP)
                UBAPURGE(is->is_ifuba.ifu_uba, is->is_ifuba.ifu_r.ifrw_bdp);
diff -r 1a5e00276e7c -r 4e0e0b281179 sys/dev/qbus/if_qt.c
--- a/sys/dev/qbus/if_qt.c      Mon Oct 21 08:00:58 2019 +0000
+++ b/sys/dev/qbus/if_qt.c      Mon Oct 21 08:22:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_qt.c,v 1.23 2018/06/26 06:48:02 msaitoh Exp $       */
+/*     $NetBSD: if_qt.c,v 1.24 2019/10/21 08:22:06 msaitoh Exp $       */
 /*
  * Copyright (c) 1992 Steven M. Schultz
  * All rights reserved.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_qt.c,v 1.23 2018/06/26 06:48:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_qt.c,v 1.24 2019/10/21 08:22:06 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -562,7 +562,6 @@
                        goto rnext;
                        }
                len = (rp->rmd1 & RMD1_MCNT) - 4;       /* -4 for CRC */
-               sc->is_if.if_ipackets++;
 
                if      ((rp->rmd0 & RMD0_ERR3) || (rp->rmd2 & RMD2_ERR4))
                        {



Home | Main Index | Thread Index | Old Index