Source-Changes-HG archive

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

src: Pull up following revision(s) (requested by nonaka in ticke...



details:   https://anonhg.NetBSD.org/src/rev/8fc2031621b6
branches:  netbsd-8
changeset: 318244:8fc2031621b6
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Apr 16 14:18:53 2018 +0000
description:
Pull up following revision(s) (requested by nonaka in ticket #762):

        sys/arch/x86/pci/if_vmx.c: revision 1.22

vmx(4): Fix calculation of interface statistics counter.

diffstat:

 sys/arch/x86/pci/if_vmx.c |  22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diffs (51 lines):

diff -r 73e718213e0e -r 8fc2031621b6 sys/arch/x86/pci/if_vmx.c
--- a/sys/arch/x86/pci/if_vmx.c Mon Apr 16 14:16:53 2018 +0000
+++ b/sys/arch/x86/pci/if_vmx.c Mon Apr 16 14:18:53 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vmx.c,v 1.19.6.2 2018/02/26 01:01:41 snj Exp $      */
+/*     $NetBSD: if_vmx.c,v 1.19.6.3 2018/04/16 14:18:53 martin Exp $   */
 /*     $OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $        */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.19.6.2 2018/02/26 01:01:41 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.19.6.3 2018/04/16 14:18:53 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -2892,20 +2892,26 @@
                splx(s);
                break;
        case SIOCGIFDATA:
+               ifp->if_ipackets = 0;
+               ifp->if_iqdrops = 0;
+               ifp->if_ierrors = 0;
                for (int i = 0; i < sc->vmx_nrxqueues; i++) {
-                       ifp->if_ipackets =
+                       ifp->if_ipackets +=
                            sc->vmx_rxq[i].vxrxq_stats.vmrxs_ipackets;
-                       ifp->if_iqdrops =
+                       ifp->if_iqdrops +=
                            sc->vmx_rxq[i].vxrxq_stats.vmrxs_iqdrops;
-                       ifp->if_ierrors =
+                       ifp->if_ierrors +=
                            sc->vmx_rxq[i].vxrxq_stats.vmrxs_ierrors;
                }
+               ifp->if_opackets = 0;
+               ifp->if_obytes = 0;
+               ifp->if_omcasts = 0;
                for (int i = 0; i < sc->vmx_ntxqueues; i++) {
-                       ifp->if_opackets =
+                       ifp->if_opackets +=
                            sc->vmx_txq[i].vxtxq_stats.vmtxs_opackets;
-                       ifp->if_obytes =
+                       ifp->if_obytes +=
                            sc->vmx_txq[i].vxtxq_stats.vmtxs_obytes;
-                       ifp->if_omcasts =
+                       ifp->if_omcasts +=
                            sc->vmx_txq[i].vxtxq_stats.vmtxs_omcasts;
                }
                /* FALLTHROUGH */



Home | Main Index | Thread Index | Old Index