diff options
author | mlaier <mlaier@FreeBSD.org> | 2005-02-11 01:05:52 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2005-02-11 01:05:52 +0000 |
commit | e8769beaa31e600cc8023e8b902921d31cdb89c6 (patch) | |
tree | c36f5386583a9a5dffea7c1ab74a7d7ab2a1d94d /sys/pci/if_rl.c | |
parent | 6df119b425a233f2f82716d960c919061f54f187 (diff) | |
download | FreeBSD-src-e8769beaa31e600cc8023e8b902921d31cdb89c6.zip FreeBSD-src-e8769beaa31e600cc8023e8b902921d31cdb89c6.tar.gz |
Adjust TX threshold on every TX underrun. Some supported cards (8139-based)
can retransmit on TX underrun and set TOK in addition to TUND. Also add a
check to prevent overflow of the addressable threshold.
This fixes some reports of rl(4) slowness, believed to be related to ALTQ
before.
PR: kern/61448
Submitted by: Tim Draegen-Gilman <timNOeudaemonSPAMnet> (with changes)
MFC after: 1 week
Diffstat (limited to 'sys/pci/if_rl.c')
-rw-r--r-- | sys/pci/if_rl.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index 6c044e7..c12fc4f 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -1232,6 +1232,14 @@ rl_txeof(struct rl_softc *sc) bus_dmamap_destroy(sc->rl_tag, RL_LAST_DMAMAP(sc)); m_freem(RL_LAST_TXMBUF(sc)); RL_LAST_TXMBUF(sc) = NULL; + /* + * If there was a transmit underrun, bump the TX threshold. + * Make sure not to overflow the 63 * 32byte we can address + * with the 6 available bit. + */ + if ((txstat & RL_TXSTAT_TX_UNDERRUN) && + (sc->rl_txthresh < 2016)) + sc->rl_txthresh += 32; if (txstat & RL_TXSTAT_TX_OK) ifp->if_opackets++; else { @@ -1244,12 +1252,8 @@ rl_txeof(struct rl_softc *sc) /* error recovery */ rl_reset(sc); rl_init_locked(sc); - /* - * If there was a transmit underrun, - * bump the TX threshold. - */ - if (txstat & RL_TXSTAT_TX_UNDERRUN) - sc->rl_txthresh = oldthresh + 32; + /* restore original threshold */ + sc->rl_txthresh = oldthresh; return; } RL_INC(sc->rl_cdata.last_tx); |