Dynamically increase TX start threshold if TX underruns are detected.
This commit is contained in:
parent
1e58fe3903
commit
b346e4e2e4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46514
@ -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.
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user