diff options
author | 2017-01-22 10:17:37 +0000 | |
---|---|---|
committer | 2017-01-22 10:17:37 +0000 | |
commit | 88a08f2af426247cf5e32d11f8df17f5717812a1 (patch) | |
tree | 55b694cef98ba8f92034f91f4eed28aafa059f2a /sys/dev/pci | |
parent | sync (diff) | |
download | wireguard-openbsd-88a08f2af426247cf5e32d11f8df17f5717812a1.tar.xz wireguard-openbsd-88a08f2af426247cf5e32d11f8df17f5717812a1.zip |
move counting if_opackets next to counting if_obytes in if_enqueue.
this means packets are consistently counted in one place, unlike the
many and various ways that drivers thought they should do it.
ok mpi@ deraadt@
Diffstat (limited to 'sys/dev/pci')
44 files changed, 49 insertions, 120 deletions
diff --git a/sys/dev/pci/if_age.c b/sys/dev/pci/if_age.c index 84d55a5fa15..3ba504fa5fd 100644 --- a/sys/dev/pci/if_age.c +++ b/sys/dev/pci/if_age.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_age.c,v 1.33 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_age.c,v 1.34 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> @@ -1933,9 +1933,6 @@ age_stats_update(struct age_softc *sc) stat->tx_bcast_bytes += smb->tx_bcast_bytes; stat->tx_mcast_bytes += smb->tx_mcast_bytes; - /* Update counters in ifnet. */ - ifp->if_opackets += smb->tx_frames; - ifp->if_collisions += smb->tx_single_colls + smb->tx_multi_colls + smb->tx_late_colls + smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT; diff --git a/sys/dev/pci/if_alc.c b/sys/dev/pci/if_alc.c index 67a47b9c018..f3651cd5d29 100644 --- a/sys/dev/pci/if_alc.c +++ b/sys/dev/pci/if_alc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_alc.c,v 1.40 2016/11/29 10:22:30 jsg Exp $ */ +/* $OpenBSD: if_alc.c,v 1.41 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2009, Pyun YongHyeon <yongari@FreeBSD.org> * All rights reserved. @@ -1625,9 +1625,6 @@ alc_stats_update(struct alc_softc *sc) stat->tx_bcast_bytes += smb->tx_bcast_bytes; stat->tx_mcast_bytes += smb->tx_mcast_bytes; - /* Update counters in ifnet. */ - ifp->if_opackets += smb->tx_frames; - ifp->if_collisions += smb->tx_single_colls + smb->tx_multi_colls * 2 + smb->tx_late_colls + smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT; diff --git a/sys/dev/pci/if_ale.c b/sys/dev/pci/if_ale.c index 04e1f113434..5f4743cb53b 100644 --- a/sys/dev/pci/if_ale.c +++ b/sys/dev/pci/if_ale.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ale.c,v 1.44 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_ale.c,v 1.45 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> * All rights reserved. @@ -1227,9 +1227,6 @@ ale_stats_update(struct ale_softc *sc) stat->tx_bcast_bytes += smb->tx_bcast_bytes; stat->tx_mcast_bytes += smb->tx_mcast_bytes; - /* Update counters in ifnet. */ - ifp->if_opackets += smb->tx_frames; - ifp->if_collisions += smb->tx_single_colls + smb->tx_multi_colls * 2 + smb->tx_late_colls + smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT; diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c index 5151af89e73..7228bba3904 100644 --- a/sys/dev/pci/if_bce.c +++ b/sys/dev/pci/if_bce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bce.c,v 1.51 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_bce.c,v 1.52 2017/01/22 10:17:38 dlg Exp $ */ /* $NetBSD: if_bce.c,v 1.3 2003/09/29 01:53:02 mrg Exp $ */ /* @@ -771,7 +771,6 @@ bce_txintr(struct bce_softc *sc) /* do any post dma memory ops on transmit data */ bus_dmamap_sync(sc->bce_dmatag, sc->bce_txdata_map, i * MCLBYTES, MCLBYTES, BUS_DMASYNC_POSTWRITE); - ifp->if_opackets++; } sc->bce_txin = curr; diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 78dd0baedc4..5ccd8c1efe6 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.382 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_bge.c,v 1.383 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -3645,8 +3645,6 @@ bge_txeof(struct bge_softc *sc) freed = 0; while (cons != newcons) { cur_tx = &sc->bge_rdata->bge_tx_ring[cons]; - if (cur_tx->bge_flags & BGE_TXBDFLAG_END) - ifp->if_opackets++; m = sc->bge_cdata.bge_tx_chain[cons]; if (m != NULL) { dmamap = sc->bge_cdata.bge_tx_map[cons]; diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index 8b3267adb14..f3e6ea52944 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.122 2016/05/05 23:01:28 jmatthew Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.123 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -4563,8 +4563,6 @@ bnx_tx_intr(struct bnx_softc *sc) /* Free the mbuf. */ m_freem(sc->tx_mbuf_ptr[sw_tx_chain_cons]); sc->tx_mbuf_ptr[sw_tx_chain_cons] = NULL; - - ifp->if_opackets++; } freed++; diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c index 1687d8be9f6..1c66dd39836 100644 --- a/sys/dev/pci/if_cas.c +++ b/sys/dev/pci/if_cas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cas.c,v 1.50 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_cas.c,v 1.51 2017/01/22 10:17:38 dlg Exp $ */ /* * @@ -1846,7 +1846,6 @@ cas_tint(struct cas_softc *sc, u_int32_t status) bus_dmamap_unload(sc->sc_dmatag, sd->sd_map); m_freem(sd->sd_mbuf); sd->sd_mbuf = NULL; - ifp->if_opackets++; } freed++; if (++cons == CAS_NTXDESC) diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index 57b9799e668..a02167197bf 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_de.c,v 1.135 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_de.c,v 1.136 2017/01/22 10:17:38 dlg Exp $ */ /* $NetBSD: if_de.c,v 1.58 1998/01/12 09:39:58 thorpej Exp $ */ /*- @@ -3557,7 +3557,6 @@ tulip_tx_intr(tulip_softc_t * const sc) sc->tulip_txtimer = 0; else if (xmits > 0) sc->tulip_txtimer = TULIP_TXTIMER; - sc->tulip_if.if_opackets += xmits; TULIP_PERFEND(txintr); return (descs); } diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index d870192ec4c..f900706f966 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.332 2016/10/27 03:06:53 dlg Exp $ */ +/* $OpenBSD: if_em.c,v 1.333 2017/01/22 10:17:38 dlg Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -2416,8 +2416,6 @@ em_txeof(struct em_softc *sc) if (free == 0) return; - ifp->if_opackets += free; - sc->sc_tx_desc_tail = tail; if (ifq_is_oactive(&ifp->if_snd)) diff --git a/sys/dev/pci/if_et.c b/sys/dev/pci/if_et.c index fa9e719f045..b56bf1fc9ea 100644 --- a/sys/dev/pci/if_et.c +++ b/sys/dev/pci/if_et.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_et.c,v 1.34 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_et.c,v 1.35 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2007 The DragonFly Project. All rights reserved. * @@ -1912,7 +1912,6 @@ et_txeof(struct et_softc *sc) bus_dmamap_unload(sc->sc_dmat, tb->tb_dmap); m_freem(tb->tb_mbuf); tb->tb_mbuf = NULL; - ifp->if_opackets++; } if (++tbd->tbd_start_index == ET_TX_NDESC) { diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 8dabd37d389..a75f4600219 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.118 2016/09/05 10:17:30 tedu Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.119 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2004-2008 @@ -1020,9 +1020,6 @@ ipw_tx_intr(struct ipw_softc *sc) for (i = (sc->txold + 1) % IPW_NTBD; i != r; i = (i + 1) % IPW_NTBD) { sbd = &sc->stbd_list[i]; - if (sbd->type == IPW_SBD_TYPE_DATA) - ifp->if_opackets++; - ipw_release_sbd(sc, sbd); sc->txfree++; } diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index a2c2d24d76c..f68ec205e60 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwi.c,v 1.133 2016/09/05 08:17:48 tedu Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.134 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2004-2008 @@ -1127,8 +1127,6 @@ iwi_tx_intr(struct iwi_softc *sc, struct iwi_tx_ring *txq) ieee80211_release_node(ic, data->ni); data->ni = NULL; - ifp->if_opackets++; - txq->queued--; txq->next = (txq->next + 1) % IWI_TX_RING_COUNT; } diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index 7f866c49c29..5b4d4c3992e 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.157 2017/01/21 11:21:41 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.158 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -3437,8 +3437,6 @@ iwm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, if (txfail) ifp->if_oerrors++; - else - ifp->if_opackets++; } void diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index b49cc9f458e..70d08e55408 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.181 2017/01/12 18:06:57 stsp Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.182 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -2399,8 +2399,7 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, uint8_t nframes, if (txfail) { DPRINTF(("%s: status=0x%x\n", __func__, status)); ifp->if_oerrors++; - } else - ifp->if_opackets++; + } /* Unmap and free mbuf. */ bus_dmamap_sync(sc->sc_dmat, data->map, 0, data->map->dm_mapsize, diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c index e056b59821d..72d5a3eaaaf 100644 --- a/sys/dev/pci/if_ix.c +++ b/sys/dev/pci/if_ix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ix.c,v 1.148 2016/12/09 17:41:39 mikeb Exp $ */ +/* $OpenBSD: if_ix.c,v 1.149 2017/01/22 10:17:38 dlg Exp $ */ /****************************************************************************** @@ -2386,7 +2386,6 @@ ixgbe_txeof(struct tx_ring *txr) &txr->tx_base[first]; } ++txr->packets; - ++ifp->if_opackets; /* See if there is more work now */ last = tx_buffer->eop_index; if (last != -1) { diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c index 2ee11993d47..99e74146100 100644 --- a/sys/dev/pci/if_ixgb.c +++ b/sys/dev/pci/if_ixgb.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_ixgb.c,v 1.70 2016/11/29 10:22:30 jsg Exp $ */ +/* $OpenBSD: if_ixgb.c,v 1.71 2017/01/22 10:17:38 dlg Exp $ */ #include <dev/pci/if_ixgb.h> @@ -1383,8 +1383,6 @@ ixgb_txeof(struct ixgb_softc *sc) num_avail++; if (tx_buffer->m_head != NULL) { - ifp->if_opackets++; - if (tx_buffer->map->dm_nsegs > 0) { bus_dmamap_sync(sc->txtag, tx_buffer->map, 0, tx_buffer->map->dm_mapsize, diff --git a/sys/dev/pci/if_jme.c b/sys/dev/pci/if_jme.c index 682cd490b03..f4db392702a 100644 --- a/sys/dev/pci/if_jme.c +++ b/sys/dev/pci/if_jme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_jme.c,v 1.48 2016/11/29 10:22:30 jsg Exp $ */ +/* $OpenBSD: if_jme.c,v 1.49 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> * All rights reserved. @@ -1525,7 +1525,6 @@ jme_txeof(struct jme_softc *sc) if (status & (JME_TD_TMOUT | JME_TD_RETRY_EXP)) { ifp->if_oerrors++; } else { - ifp->if_opackets++; if (status & JME_TD_COLLISION) { ifp->if_collisions += letoh32(txd->tx_desc->buflen) & diff --git a/sys/dev/pci/if_lge.c b/sys/dev/pci/if_lge.c index 75f44e4286f..81a54a8a289 100644 --- a/sys/dev/pci/if_lge.c +++ b/sys/dev/pci/if_lge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lge.c,v 1.72 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_lge.c,v 1.73 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -777,7 +777,6 @@ lge_txeof(struct lge_softc *sc) while (idx != sc->lge_cdata.lge_tx_prod && txdone) { cur_tx = &sc->lge_ldata->lge_tx_list[idx]; - ifp->if_opackets++; if (cur_tx->lge_mbuf != NULL) { m_freem(cur_tx->lge_mbuf); cur_tx->lge_mbuf = NULL; diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c index b96aa497626..352ea240f14 100644 --- a/sys/dev/pci/if_lii.c +++ b/sys/dev/pci/if_lii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lii.c,v 1.43 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_lii.c,v 1.44 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2007 The NetBSD Foundation. @@ -976,9 +976,7 @@ lii_txintr(struct lii_softc *sc) sc->sc_txd_ack = (sc->sc_txd_ack + txph->txph_size + 7 ) & ~3; sc->sc_txd_ack %= AT_TXD_BUFFER_SIZE; - if (txs->txps_flags & LII_TXF_SUCCESS) - ++ifp->if_opackets; - else + if (!ISSET(txs->txps_flags, LII_TXF_SUCCESS)) ++ifp->if_oerrors; ifq_clr_oactive(&ifp->if_snd); } diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c index fe339644b71..caca0ceb95c 100644 --- a/sys/dev/pci/if_msk.c +++ b/sys/dev/pci/if_msk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_msk.c,v 1.124 2017/01/08 18:08:14 visa Exp $ */ +/* $OpenBSD: if_msk.c,v 1.125 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1697,8 +1697,6 @@ msk_txeof(struct sk_if_softc *sc_if) if (mskdebug >= 2) msk_dump_txdesc(cur_tx, idx); #endif - if (sk_ctl & SK_Y2_TXCTL_LASTFRAG) - ifp->if_opackets++; if (sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf != NULL) { entry = sc_if->sk_cdata.sk_tx_map[idx]; diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index 7d39f418961..1d501028ffd 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.99 2016/10/31 01:38:57 dlg Exp $ */ +/* $OpenBSD: if_myx.c,v 1.100 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org> @@ -1686,8 +1686,6 @@ myx_txeof(struct myx_softc *sc, u_int32_t done_count) bus_dmamap_unload(sc->sc_dmat, map); m_freem(ms->ms_m); - ifp->if_opackets++; - if (++cons >= sc->sc_tx_ring_count) cons = 0; } while (++sc->sc_tx_count != done_count); diff --git a/sys/dev/pci/if_nep.c b/sys/dev/pci/if_nep.c index e0fa899c393..7518b8858dc 100644 --- a/sys/dev/pci/if_nep.c +++ b/sys/dev/pci/if_nep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nep.c,v 1.26 2016/09/15 02:00:17 dlg Exp $ */ +/* $OpenBSD: if_nep.c,v 1.27 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2014, 2015 Mark Kettenis * @@ -1091,7 +1091,6 @@ nep_tx_proc(struct nep_softc *sc) m_freem(txb->nb_m); txb->nb_m = NULL; - ifp->if_opackets++; count--; } diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index daa894e4957..1a7978f9e88 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nfe.c,v 1.118 2016/11/29 10:22:30 jsg Exp $ */ +/* $OpenBSD: if_nfe.c,v 1.119 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr> @@ -817,8 +817,7 @@ nfe_txeof(struct nfe_softc *sc) printf("%s: tx v1 error %b\n", sc->sc_dev.dv_xname, flags, NFE_V1_TXERR); ifp->if_oerrors++; - } else - ifp->if_opackets++; + } } else { if (!(flags & NFE_TX_LASTFRAG_V2) && data->m == NULL) goto skip; @@ -827,8 +826,7 @@ nfe_txeof(struct nfe_softc *sc) printf("%s: tx v2 error %b\n", sc->sc_dev.dv_xname, flags, NFE_V2_TXERR); ifp->if_oerrors++; - } else - ifp->if_opackets++; + } } if (data->m == NULL) { /* should not get there */ diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c index 058e9535072..ba5f2e9f813 100644 --- a/sys/dev/pci/if_nge.c +++ b/sys/dev/pci/if_nge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nge.c,v 1.91 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_nge.c,v 1.92 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -1143,7 +1143,6 @@ nge_txeof(struct nge_softc *sc) ifp->if_collisions += (cur_tx->nge_txstat & NGE_TXSTAT_COLLCNT) >> 16; - ifp->if_opackets++; if (cur_tx->nge_mbuf != NULL) { m_freem(cur_tx->nge_mbuf); cur_tx->nge_mbuf = NULL; diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c index b2fdbb6f2a3..9b30900daed 100644 --- a/sys/dev/pci/if_nxe.c +++ b/sys/dev/pci/if_nxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nxe.c,v 1.73 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_nxe.c,v 1.74 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -1389,7 +1389,6 @@ nxe_start(struct ifnet *ifp) bus_dmamap_sync(sc->sc_dmat, dmap, 0, dmap->dm_mapsize, BUS_DMASYNC_PREWRITE); - ifp->if_opackets++; } while (nr->nr_ready >= NXE_TXD_DESCS); nxe_ring_sync(sc, nr, BUS_DMASYNC_PREWRITE); diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c index 3e7a908dfd4..2ddbe0576b2 100644 --- a/sys/dev/pci/if_oce.c +++ b/sys/dev/pci/if_oce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_oce.c,v 1.98 2016/09/15 02:00:17 dlg Exp $ */ +/* $OpenBSD: if_oce.c,v 1.99 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2012 Mike Belopuhov @@ -1204,7 +1204,6 @@ oce_start(struct ifnet *ifp) int oce_encap(struct oce_softc *sc, struct mbuf **mpp, int wqidx) { - struct ifnet *ifp = &sc->sc_ac.ac_if; struct mbuf *m = *mpp; struct oce_wq *wq = sc->sc_wq[wqidx]; struct oce_pkt *pkt = NULL; @@ -1308,8 +1307,6 @@ oce_encap(struct oce_softc *sc, struct mbuf **mpp, int wqidx) oce_pkt_put(&wq->pkt_list, pkt); - ifp->if_opackets++; - oce_dma_sync(&wq->ring->dma, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c index b2adb5645bd..6d6c367f077 100644 --- a/sys/dev/pci/if_pcn.c +++ b/sys/dev/pci/if_pcn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pcn.c,v 1.42 2016/11/29 10:22:30 jsg Exp $ */ +/* $OpenBSD: if_pcn.c,v 1.43 2017/01/22 10:17:38 dlg Exp $ */ /* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */ /* @@ -1268,7 +1268,6 @@ pcn_txintr(struct pcn_softc *sc) /* Real number is unknown. */ ifp->if_collisions += 2; } - ifp->if_opackets++; next_packet: sc->sc_txfree += txs->txs_dmamap->dm_nsegs; bus_dmamap_sync(sc->sc_dmat, txs->txs_dmamap, diff --git a/sys/dev/pci/if_rtwn.c b/sys/dev/pci/if_rtwn.c index 93d6abec640..37362808386 100644 --- a/sys/dev/pci/if_rtwn.c +++ b/sys/dev/pci/if_rtwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rtwn.c,v 1.24 2016/07/26 13:00:28 stsp Exp $ */ +/* $OpenBSD: if_rtwn.c,v 1.25 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> @@ -1126,7 +1126,6 @@ rtwn_tx_done(struct rtwn_pci_softc *sc, int qid) ieee80211_release_node(ic, tx_data->ni); tx_data->ni = NULL; - ifp->if_opackets++; sc->sc_sc.sc_tx_timer = 0; tx_ring->queued--; } diff --git a/sys/dev/pci/if_se.c b/sys/dev/pci/if_se.c index e975860e4b0..33fcdb0f27a 100644 --- a/sys/dev/pci/if_se.c +++ b/sys/dev/pci/if_se.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_se.c,v 1.19 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_se.c,v 1.20 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2009, 2010 Christopher Zimmermann <madroach@zakweb.de> @@ -1002,8 +1002,7 @@ se_txeof(struct se_softc *sc) ifp->if_xname, txstat, TX_ERR_BITS); ifp->if_oerrors++; /* TODO: better error differentiation */ - } else - ifp->if_opackets++; + } if (cd->se_tx_mbuf[i] != NULL) { bus_dmamap_sync(sc->sc_dmat, cd->se_tx_map[i], 0, diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index 2c977c57819..d4ec85a7ed5 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.134 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_sis.c,v 1.135 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -1498,7 +1498,6 @@ sis_txeof(struct sis_softc *sc) ifp->if_collisions += (txstat & SIS_TXSTAT_COLLCNT) >> 16; - ifp->if_opackets++; if (cur_tx->map->dm_nsegs != 0) { bus_dmamap_t map = cur_tx->map; diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index f499c8c5b0c..180bfaa8af9 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.185 2017/01/08 18:08:14 visa Exp $ */ +/* $OpenBSD: if_sk.c,v 1.186 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1672,8 +1672,6 @@ sk_txeof(struct sk_if_softc *sc_if) SK_CDTXSYNC(sc_if, idx, 1, BUS_DMASYNC_PREREAD); break; } - if (sk_ctl & SK_TXCTL_LASTFRAG) - ifp->if_opackets++; if (sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf != NULL) { entry = sc_if->sk_cdata.sk_tx_map[idx]; diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c index 471eee093da..870443d1148 100644 --- a/sys/dev/pci/if_ste.c +++ b/sys/dev/pci/if_ste.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ste.c,v 1.64 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_ste.c,v 1.65 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -749,7 +749,6 @@ ste_txeof(struct ste_softc *sc) m_freem(cur_tx->ste_mbuf); cur_tx->ste_mbuf = NULL; ifq_clr_oactive(&ifp->if_snd); - ifp->if_opackets++; STE_INC(idx, STE_TX_LIST_CNT); } diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c index 51ea9e5ef7f..155ed623341 100644 --- a/sys/dev/pci/if_stge.c +++ b/sys/dev/pci/if_stge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_stge.c,v 1.68 2016/11/29 10:22:30 jsg Exp $ */ +/* $OpenBSD: if_stge.c,v 1.69 2017/01/22 10:17:38 dlg Exp $ */ /* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */ /*- @@ -1031,9 +1031,6 @@ stge_stats_update(struct stge_softc *sc) (void) CSR_READ_4(sc, STGE_OctetXmtdOk); - ifp->if_opackets += - CSR_READ_4(sc, STGE_FramesXmtdOk); - ifp->if_collisions += CSR_READ_4(sc, STGE_LateCollisions) + CSR_READ_4(sc, STGE_MultiColFrames) + diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index fcce718263a..001c6353389 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.139 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_tht.c,v 1.140 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -1153,8 +1153,6 @@ tht_start(struct ifnet *ifp) bus_dmamap_sync(sc->sc_thtc->sc_dmat, pkt->tp_dmap, 0, pkt->tp_dmap->dm_mapsize, BUS_DMASYNC_PREWRITE); - ifp->if_opackets++; - } while (sc->sc_txt.tf_ready > THT_FIFO_DESC_LEN); tht_fifo_post(sc, &sc->sc_txt); diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c index 9b8fbd51a6d..c70443c1b8b 100644 --- a/sys/dev/pci/if_tl.c +++ b/sys/dev/pci/if_tl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tl.c,v 1.69 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_tl.c,v 1.70 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1326,7 +1326,6 @@ tl_stats_update(void *xsc) *p++ = CSR_READ_4(sc, TL_DIO_DATA); *p++ = CSR_READ_4(sc, TL_DIO_DATA); - ifp->if_opackets += tl_tx_goodframes(tl_stats); ifp->if_collisions += tl_stats.tl_tx_single_collision + tl_stats.tl_tx_multi_collision; ifp->if_ierrors += tl_stats.tl_crc_errors + tl_stats.tl_code_errors + diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c index b5f124681b2..deede70e9de 100644 --- a/sys/dev/pci/if_txp.c +++ b/sys/dev/pci/if_txp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_txp.c,v 1.124 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_txp.c,v 1.125 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2001 @@ -818,7 +818,6 @@ txp_tx_reclaim(struct txp_softc *sc, struct txp_tx_ring *r, m_freem(m); txd->tx_addrlo = 0; txd->tx_addrhi = 0; - ifp->if_opackets++; } } ifq_clr_oactive(&ifp->if_snd); @@ -1247,7 +1246,6 @@ txp_tick(void *vsc) ext[2].ext_1; 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; out: if (rsp != NULL) diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c index 6355e56ea18..63ab3b1fa0a 100644 --- a/sys/dev/pci/if_vge.c +++ b/sys/dev/pci/if_vge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vge.c,v 1.70 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_vge.c,v 1.71 2017/01/22 10:17:38 dlg Exp $ */ /* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */ /* * Copyright (c) 2004 @@ -1181,8 +1181,6 @@ vge_txeof(struct vge_softc *sc) ifp->if_collisions++; if (txstat & VGE_TDSTS_TXERR) ifp->if_oerrors++; - else - ifp->if_opackets++; sc->vge_ldata.vge_tx_free++; VGE_TX_DESC_INC(idx); diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c index f29db1c04b4..e34a1aa4f27 100644 --- a/sys/dev/pci/if_vic.c +++ b/sys/dev/pci/if_vic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vic.c,v 1.96 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_vic.c,v 1.97 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org> @@ -1109,7 +1109,6 @@ vic_start(struct ifnet *ifp) bus_dmamap_sync(sc->sc_dmat, dmap, 0, dmap->dm_mapsize, BUS_DMASYNC_PREWRITE); - ifp->if_opackets++; sc->sc_txpending++; VIC_INC(sc->sc_data->vd_tx_nextidx, sc->sc_data->vd_tx_length); diff --git a/sys/dev/pci/if_vmx.c b/sys/dev/pci/if_vmx.c index ef9a2089e54..953a6e5e86a 100644 --- a/sys/dev/pci/if_vmx.c +++ b/sys/dev/pci/if_vmx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vmx.c,v 1.44 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_vmx.c,v 1.45 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 2013 Tsubai Masanari @@ -1081,7 +1081,6 @@ vmxnet3_start(struct ifnet *ifp) /* Change the ownership by flipping the "generation" bit */ txd->tx_word2 ^= htole32(VMXNET3_TX_GEN_M << VMXNET3_TX_GEN_S); - ifp->if_opackets++; used += n; } diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index 936568fcc74..b61c0130a83 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vr.c,v 1.152 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_vr.c,v 1.153 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1033,7 +1033,6 @@ vr_txeof(struct vr_softc *sc) ifp->if_collisions +=(txstat & VR_TXSTAT_COLLCNT) >> 3; - ifp->if_opackets++; if (cur_tx->vr_map != NULL && cur_tx->vr_map->dm_nsegs > 0) bus_dmamap_unload(sc->sc_dmat, cur_tx->vr_map); diff --git a/sys/dev/pci/if_vte.c b/sys/dev/pci/if_vte.c index 7503b14f7db..24517648dcf 100644 --- a/sys/dev/pci/if_vte.c +++ b/sys/dev/pci/if_vte.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vte.c,v 1.18 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_vte.c,v 1.19 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2010, Pyun YongHyeon <yongari@FreeBSD.org> * All rights reserved. @@ -838,7 +838,6 @@ vte_stats_update(struct vte_softc *sc) stat->rx_pause_frames += (value & 0xFF); /* Update ifp counters. */ - ifp->if_opackets = stat->tx_frames; ifp->if_collisions = stat->tx_late_colls; ifp->if_oerrors = stat->tx_late_colls + stat->tx_underruns; ifp->if_ierrors = stat->rx_crcerrs + stat->rx_runts + diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c index 467a1666f92..cc644aa596c 100644 --- a/sys/dev/pci/if_wb.c +++ b/sys/dev/pci/if_wb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wb.c,v 1.67 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_wb.c,v 1.68 2017/01/22 10:17:38 dlg Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1035,7 +1035,6 @@ void wb_txeof(sc) ifp->if_collisions += (txstat & WB_TXSTAT_COLLCNT) >> 3; - ifp->if_opackets++; m_freem(cur_tx->wb_mbuf); cur_tx->wb_mbuf = NULL; diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index 1dc0404c17f..aecdc39e104 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.137 2016/12/23 18:44:51 kettenis Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.138 2017/01/22 10:17:38 dlg Exp $ */ /*- * Copyright (c) 2006-2008 @@ -1361,8 +1361,6 @@ wpi_tx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc) if ((letoh32(stat->status) & 0xff) != 1) ifp->if_oerrors++; - else - ifp->if_opackets++; /* Unmap and free mbuf. */ bus_dmamap_sync(sc->sc_dmat, data->map, 0, data->map->dm_mapsize, diff --git a/sys/dev/pci/if_xge.c b/sys/dev/pci/if_xge.c index ddcaca5496b..564e40d3955 100644 --- a/sys/dev/pci/if_xge.c +++ b/sys/dev/pci/if_xge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xge.c,v 1.74 2016/11/29 10:22:30 jsg Exp $ */ +/* $OpenBSD: if_xge.c,v 1.75 2017/01/22 10:17:39 dlg Exp $ */ /* $NetBSD: if_xge.c,v 1.1 2005/09/09 10:30:27 ragge Exp $ */ /* @@ -901,7 +901,6 @@ xge_intr(void *pv) } bus_dmamap_unload(sc->sc_dmat, dmp); m_freem(sc->sc_txb[i]); - ifp->if_opackets++; sc->sc_lasttx = i; } |