diff options
author | Bill Paul <wpaul@FreeBSD.org> | 1999-05-05 17:05:07 +0000 |
---|---|---|
committer | Bill Paul <wpaul@FreeBSD.org> | 1999-05-05 17:05:07 +0000 |
commit | b346e4e2e44013b3729d274560486b0fffb229ff (patch) | |
tree | 0f0ff42f5a9433ec82b1b2083a9808d3043e59b3 | |
parent | 1e58fe390387e06eb8d7d83f3f927e3491114484 (diff) | |
download | src-b346e4e2e44013b3729d274560486b0fffb229ff.tar.gz src-b346e4e2e44013b3729d274560486b0fffb229ff.zip |
Dynamically increase TX start threshold if TX underruns are detected.
Notes
Notes:
svn path=/head/; revision=46514
-rw-r--r-- | sys/pci/if_xl.c | 16 | ||||
-rw-r--r-- | sys/pci/if_xlreg.h | 3 |
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c index cca979c95022..931e84aa3872 100644 --- a/sys/pci/if_xl.c +++ b/sys/pci/if_xl.c @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_xl.c,v 1.99 1999/05/04 20:29:58 wpaul Exp $ + * $Id: if_xl.c,v 1.101 1999/05/05 16:54:54 wpaul Exp $ */ /* @@ -159,7 +159,7 @@ #if !defined(lint) static const char rcsid[] = - "$Id: if_xl.c,v 1.99 1999/05/04 20:29:58 wpaul Exp $"; + "$Id: if_xl.c,v 1.101 1999/05/05 16:54:54 wpaul Exp $"; #endif /* @@ -2113,8 +2113,15 @@ static void xl_txeoc(sc) * first generation 3c90X chips. */ CSR_WRITE_1(sc, XL_TX_FREETHRESH, XL_PACKET_SIZE >> 8); + if (txstat & XL_TXSTATUS_UNDERRUN && + sc->xl_tx_thresh < XL_PACKET_SIZE) { + sc->xl_tx_thresh += XL_MIN_FRAMELEN; + printf("xl%d: tx underrun, increasing tx start" + " threshold to %d bytes\n", sc->xl_unit, + sc->xl_tx_thresh); + } CSR_WRITE_2(sc, XL_COMMAND, - XL_CMD_TX_SET_START|XL_MIN_FRAMELEN); + XL_CMD_TX_SET_START|sc->xl_tx_thresh); if (sc->xl_type == XL_TYPE_905B) { CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_SET_TX_RECLAIM|(XL_PACKET_SIZE >> 4)); @@ -2512,7 +2519,8 @@ static void xl_init(xsc) CSR_WRITE_1(sc, XL_TX_FREETHRESH, XL_PACKET_SIZE >> 8); /* Set the TX start threshold for best performance. */ - CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_SET_START|XL_MIN_FRAMELEN); + sc->xl_tx_thresh = XL_MIN_FRAMELEN; + CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_SET_START|sc->xl_tx_thresh); /* * If this is a 3c905B, also set the tx reclaim threshold. diff --git a/sys/pci/if_xlreg.h b/sys/pci/if_xlreg.h index 312839942467..46b0c666a1de 100644 --- a/sys/pci/if_xlreg.h +++ b/sys/pci/if_xlreg.h @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_xlreg.h,v 1.27 1999/04/29 17:56:55 wpaul Exp $ + * $Id: if_xlreg.h,v 1.28 1999/05/05 15:01:27 wpaul Exp $ */ #define XL_EE_READ 0x0080 /* read, 5 bit address */ @@ -553,6 +553,7 @@ struct xl_softc { u_int8_t xl_want_auto; u_int8_t xl_autoneg; u_int8_t xl_stats_no_timeout; + u_int16_t xl_tx_thresh; caddr_t xl_ldata_ptr; struct xl_list_data *xl_ldata; struct xl_chain_data xl_cdata; |