diff options
author | adrian <adrian@FreeBSD.org> | 2011-04-05 06:46:07 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2011-04-05 06:46:07 +0000 |
commit | a6f6f69850126214baebdb5ca794556757941881 (patch) | |
tree | ead3ac76e090b22932ee08a46908bdf417cc4a64 /sys/mips/atheros | |
parent | 326f604f816fadd1fb742de2ad5c76ae1a0e3e98 (diff) | |
download | FreeBSD-src-a6f6f69850126214baebdb5ca794556757941881.zip FreeBSD-src-a6f6f69850126214baebdb5ca794556757941881.tar.gz |
if_arge has had a strange bug that only appears during high traffic
levels. TX would hang, RX wouldn't. A bit of digging showed the interface
send queue was full, but IFF_DRV_OACTIVE was clear and the hardware TX
queue was empty.
It turns out that there wasn't a check to drain the interface send
queue once hardware TX had completed, so if the interface send queue
had filled up in the meantime, subsequent packets would be dropped
by the higher layers and if_start (and thus arge_start()) would never
be called.
The fix is simple - call arge_start_locked() in the software interrupt
handler after the hardware TX queue has been handled or a TX underrun
occured. This way the interface send queue gets drained.
Diffstat (limited to 'sys/mips/atheros')
-rw-r--r-- | sys/mips/atheros/if_arge.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/mips/atheros/if_arge.c b/sys/mips/atheros/if_arge.c index 3ead803..ba7ee07 100644 --- a/sys/mips/atheros/if_arge.c +++ b/sys/mips/atheros/if_arge.c @@ -1855,6 +1855,27 @@ arge_intr(void *arg) } /* + * If we've finished TXing and there's space for more packets + * to be queued for TX, do so. Otherwise we may end up in a + * situation where the interface send queue was filled + * whilst the hardware queue was full, then the hardware + * queue was drained by the interface send queue wasn't, + * and thus if_start() is never called to kick-start + * the send process (and all subsequent packets are simply + * discarded. + * + * XXX TODO: make sure that the hardware deals nicely + * with the possibility of the queue being enabled above + * after a TX underrun, then having the hardware queue added + * to below. + */ + if (status & (DMA_INTR_TX_PKT_SENT | DMA_INTR_TX_UNDERRUN) && + (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { + if (!IFQ_IS_EMPTY(&ifp->if_snd)) + arge_start_locked(ifp); + } + + /* * We handled all bits, clear status */ sc->arge_intr_status = 0; |