diff options
author | 2017-02-11 14:40:06 +0000 | |
---|---|---|
committer | 2017-02-11 14:40:06 +0000 | |
commit | a70de22337e5557658ff4878923ef85b3789f29c (patch) | |
tree | dc52f059d72f7e426818b75906912716ef1cd01d | |
parent | Do not prematurely close .Nd containing a broken child. (diff) | |
download | wireguard-openbsd-a70de22337e5557658ff4878923ef85b3789f29c.tar.xz wireguard-openbsd-a70de22337e5557658ff4878923ef85b3789f29c.zip |
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.
-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); } |