summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-09-12 05:44:53 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-09-12 05:44:53 +0000
commitfcc47202f5d3d5d3ef284f8d41d06388bde878bf (patch)
tree2f6610bdc4790b2c31a5aee7acc587113f245a05 /sys
parenta2d95e6557731aaf8e630c313c9d3a8f14a669d9 (diff)
Some fixes for dc_txeof()..
- Don't reload the watchdog timer in case there are still unhandled descriptors. - Don't clear IFF_OACTIVE unless there are at least 6 free TX descriptors. The function dc_encap() will bail if there are only 5 or fewer free TX descriptors, causing dc_start() to abort so it makes no sense to pretend we could process mbufs again when in fact we can't. - Always assign idx to sc->dc_cdata.dc_tx_cons; it doesn't make much sense to exclude the idx == sc->dc_cdata.dc_tx_cons case. From FreeBSD
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/dc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c
index 4ed4935d738..c52f2b0f6f0 100644
--- a/sys/dev/ic/dc.c
+++ b/sys/dev/ic/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.102 2008/09/11 06:49:14 brad Exp $ */
+/* $OpenBSD: dc.c,v 1.103 2008/09/12 05:44:52 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -2317,13 +2317,12 @@ dc_txeof(struct dc_softc *sc)
sc->dc_cdata.dc_tx_cnt--;
DC_INC(idx, DC_TX_LIST_CNT);
}
+ sc->dc_cdata.dc_tx_cons = idx;
- if (idx != sc->dc_cdata.dc_tx_cons) {
- /* some buffers have been freed */
- sc->dc_cdata.dc_tx_cons = idx;
+ if (DC_TX_LIST_CNT - sc->dc_cdata.dc_tx_cnt > 5)
ifp->if_flags &= ~IFF_OACTIVE;
- }
- ifp->if_timer = (sc->dc_cdata.dc_tx_cnt == 0) ? 0 : 5;
+ if (sc->dc_cdata.dc_tx_cnt == 0)
+ ifp->if_timer = 0;
}
void