diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-08-30 07:39:13 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-08-30 07:39:13 +0000 |
commit | 3a662783b8de39cb5e545a3dff51e4110c0a3735 (patch) | |
tree | 4755e6cc4b593fae9fe38048471c32fdf8d461e9 | |
parent | f69a5935c77501118988218bd5caf7a940fbed0c (diff) |
Fix an issue initially reported by drahn@ with gem(4) where these
drivers can report 2-3x times the number of actual packets being
transmitted by only incrementing the counter for descriptors with
buffers being freed.
ok kettenis@
-rw-r--r-- | sys/dev/ic/gem.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_cas.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index d5d17fb68b0..31a16ba0009 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gem.c,v 1.76 2008/08/26 21:06:29 kettenis Exp $ */ +/* $OpenBSD: gem.c,v 1.77 2008/08/30 07:39:12 brad Exp $ */ /* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */ /* @@ -1619,9 +1619,9 @@ gem_tint(struct gem_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++; } sc->sc_tx_cnt--; - ifp->if_opackets++; if (++cons == GEM_NTXDESC) cons = 0; } diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c index 35b09af3c41..cc37c7c4f54 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.19 2008/05/31 22:49:03 kettenis Exp $ */ +/* $OpenBSD: if_cas.c,v 1.20 2008/08/30 07:39:12 brad Exp $ */ /* * @@ -1937,9 +1937,9 @@ 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++; } sc->sc_tx_cnt--; - ifp->if_opackets++; if (++cons == CAS_NTXDESC) cons = 0; } |