Module Name: src
Committed By: skrll
Date: Tue Feb 4 07:37:00 UTC 2020
Modified Files:
src/sys/dev/pci: if_kse.c if_rge.c
Log Message:
Adopt <net/if_stats.h>
To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/if_kse.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/if_rge.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_kse.c
diff -u src/sys/dev/pci/if_kse.c:1.47 src/sys/dev/pci/if_kse.c:1.48
--- src/sys/dev/pci/if_kse.c:1.47 Mon Jan 6 07:57:06 2020
+++ src/sys/dev/pci/if_kse.c Tue Feb 4 07:37:00 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_kse.c,v 1.47 2020/01/06 07:57:06 nisimura Exp $ */
+/* $NetBSD: if_kse.c,v 1.48 2020/02/04 07:37:00 skrll Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.47 2020/01/06 07:57:06 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.48 2020/02/04 07:37:00 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -934,7 +934,7 @@ kse_watchdog(struct ifnet *ifp)
aprint_error_dev(sc->sc_dev,
"device timeout (txfree %d txsfree %d txnext %d)\n",
sc->sc_txfree, sc->sc_txsfree, sc->sc_txnext);
- ifp->if_oerrors++;
+ if_statinc(ifp, if_oerrors);
/* Reset the interface. */
kse_init(ifp);
@@ -1269,7 +1269,7 @@ rxintr(struct kse_softc *sc)
/* R0_FS | R0_LS must have been marked for this desc */
if (rxstat & R0_ES) {
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
#define PRINTERR(bit, str) \
if (rxstat & (bit)) \
aprint_error_dev(sc->sc_dev, \
@@ -1292,7 +1292,7 @@ rxintr(struct kse_softc *sc)
m = rxs->rxs_mbuf;
if (add_rxbuf(sc, i) != 0) {
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
KSE_INIT_RXDESC(sc, i);
bus_dmamap_sync(sc->sc_dmat,
rxs->rxs_dmamap, 0,
@@ -1347,7 +1347,7 @@ txreap(struct kse_softc *sc)
/* There is no way to tell transmission status per frame */
- ifp->if_opackets++;
+ if_statinc(ifp, if_opackets);
sc->sc_txfree += txs->txs_ndesc;
bus_dmamap_sync(sc->sc_dmat, txs->txs_dmamap,
Index: src/sys/dev/pci/if_rge.c
diff -u src/sys/dev/pci/if_rge.c:1.3 src/sys/dev/pci/if_rge.c:1.4
--- src/sys/dev/pci/if_rge.c:1.3 Sun Jan 12 23:22:12 2020
+++ src/sys/dev/pci/if_rge.c Tue Feb 4 07:37:00 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rge.c,v 1.3 2020/01/12 23:22:12 sevan Exp $ */
+/* $NetBSD: if_rge.c,v 1.4 2020/02/04 07:37:00 skrll Exp $ */
/* $OpenBSD: if_rge.c,v 1.2 2020/01/02 09:00:45 kevlo Exp $ */
/*
@@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.3 2020/01/12 23:22:12 sevan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.4 2020/02/04 07:37:00 skrll Exp $");
/* #include "bpfilter.h" Sevan */
/* #include "vlan.h" Sevan */
@@ -599,7 +599,7 @@ rge_watchdog(struct ifnet *ifp)
struct rge_softc *sc = ifp->if_softc;
printf("%s: watchdog timeout\n", sc->sc_dev.dv_xname);
- ifp->if_oerrors++;
+ if_statinc(ifp, if_oerrors);
rge_init(ifp);
}
@@ -1189,7 +1189,7 @@ rge_rxeof(struct rge_softc *sc)
}
if (rxstat & RGE_RDCMDSTS_RXERRSUM) {
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
/*
* If this is part of a multi-fragment packet,
* discard all the pieces.
@@ -1307,9 +1307,9 @@ rge_txeof(struct rge_softc *sc)
txq->txq_mbuf = NULL;
if (txstat & (RGE_TDCMDSTS_EXCESSCOLL | RGE_TDCMDSTS_COLL))
- ifp->if_collisions++;
+ if_statinc(ifp, if_collisions);
if (txstat & RGE_TDCMDSTS_TXERR)
- ifp->if_oerrors++;
+ if_statinc(ifp, if_oerrors);
bus_dmamap_sync(sc->sc_dmat, sc->rge_ldata.rge_tx_list_map,
idx * sizeof(struct rge_tx_desc),