diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2017-02-11 14:40:07 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2017-02-11 14:40:07 +0000 |
commit | 6320b3e24ba30a99f386857cd8dcc20f621e000c (patch) | |
tree | 1088ec1e0a0960bec0a94454b06a17df3aacc209 /sys | |
parent | 138fd206539288b4d71381277ab50472093858e1 (diff) |
Always leave one free slot in the Tx ring to avoid ambiguity with ring
head and tail in the interrupt handler. This fixes an old bug that
causes a Tx stall when Tx ring gets full.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sgi/dev/if_iec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/sgi/dev/if_iec.c b/sys/arch/sgi/dev/if_iec.c index 752691eafe5..2b590282e59 100644 --- a/sys/arch/sgi/dev/if_iec.c +++ b/sys/arch/sgi/dev/if_iec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iec.c,v 1.24 2017/02/11 10:34:23 visa Exp $ */ +/* $OpenBSD: if_iec.c,v 1.25 2017/02/11 14:40:06 visa Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. @@ -755,7 +755,7 @@ iec_start(struct ifnet *ifp) DPRINTF(IEC_DEBUG_START, ("iec_start: opending = %d, firstdirty = %d\n", opending, firstdirty)); - while (sc->sc_txpending < IEC_NTXDESC) { + while (sc->sc_txpending < IEC_NTXDESC - 1) { /* Grab a packet off the queue. */ m0 = ifq_dequeue(&ifp->if_snd); if (m0 == NULL) @@ -945,7 +945,7 @@ iec_start(struct ifnet *ifp) sc->sc_txlast = nexttx; } - if (sc->sc_txpending == IEC_NTXDESC) { + if (sc->sc_txpending >= IEC_NTXDESC - 1) { /* No more slots; notify upper layer. */ ifq_set_oactive(&ifp->if_snd); } |