From e0f0bd7be5bb2f7473c5554b4013cb1d140e0d92 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 30 Jan 2006 00:32:46 +0000 Subject: only flush the TX descriptors in re_start() if there are packets to be transmitted. tested by jsg@ --- sys/dev/ic/re.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index 21b48cda9b6..e610bcf6a27 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.16 2006/01/28 02:15:19 brad Exp $ */ +/* $OpenBSD: re.c,v 1.17 2006/01/30 00:32:45 brad Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -1491,7 +1491,7 @@ re_start(ifp) { struct rl_softc *sc; struct mbuf *m_head = NULL; - int idx; + int idx, queued = 0; sc = ifp->if_softc; @@ -1514,8 +1514,12 @@ re_start(ifp) if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m_head); #endif + queued++; } + if (queued == 0) + return; + /* Flush the TX descriptors */ bus_dmamap_sync(sc->sc_dmat, -- cgit v1.2.3