diff options
author | dg <dg@FreeBSD.org> | 1998-10-22 02:00:49 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1998-10-22 02:00:49 +0000 |
commit | b173a5087cd17abbd5e834001ccfc7230d62dd51 (patch) | |
tree | b9f414501c2f2b8f21ad1256b5239828129f017d /sys/pci | |
parent | e51a9e30ea4530be2d521ed2eea7d73865e8742f (diff) | |
download | FreeBSD-src-b173a5087cd17abbd5e834001ccfc7230d62dd51.zip FreeBSD-src-b173a5087cd17abbd5e834001ccfc7230d62dd51.tar.gz |
Defer rundown (m_freem) of completed transmit buffers for no longer
than 1 second.
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/if_fxp.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/pci/if_fxp.c b/sys/pci/if_fxp.c index 750e268..1a1c151 100644 --- a/sys/pci/if_fxp.c +++ b/sys/pci/if_fxp.c @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: if_fxp.c,v 1.56 1998/10/10 19:26:40 dg Exp $ + * $Id: if_fxp.c,v 1.57 1998/10/11 06:28:54 dg Exp $ */ /* @@ -1072,6 +1072,7 @@ fxp_stats_update(arg) struct fxp_softc *sc = arg; struct ifnet *ifp = &sc->sc_if; struct fxp_stats *sp = sc->fxp_stats; + struct fxp_cb_tx *txp; int s; ifp->if_opackets += sp->tx_good; @@ -1080,6 +1081,9 @@ fxp_stats_update(arg) ifp->if_ipackets += sp->rx_good; sc->rx_idle_secs = 0; } else { + /* + * Receiver's been idle for another second. + */ sc->rx_idle_secs++; } ifp->if_ierrors += @@ -1098,6 +1102,23 @@ fxp_stats_update(arg) } s = splimp(); /* + * Release any xmit buffers that have completed DMA. This isn't + * strictly necessary to do here, but it's advantagous for mbufs + * with external storage to be released in a timely manner rather + * than being defered for a potentially long time. This limits + * the delay to a maximum of one second. + */ + for (txp = sc->cbl_first; sc->tx_queued && + (txp->cb_status & FXP_CB_STATUS_C) != 0; + txp = txp->next) { + if (txp->mb_head != NULL) { + m_freem(txp->mb_head); + txp->mb_head = NULL; + } + sc->tx_queued--; + } + sc->cbl_first = txp; + /* * If we haven't received any packets in FXP_MAC_RX_IDLE seconds, * then assume the receiver has locked up and attempt to clear * the condition by reprogramming the multicast filter. This is |