Modify the transmit packet queuing strategy a bit to be a little less

agressive. With the old code, if a descriptor chain was already on its
way to the chip, xl_start() would try to splice new chains onto the end
of the current chain by stopping the transmitter, modifying the tail
pointer of the current chain to point to the head of the new chain, then
restart the transmitter. The manual says you're allowed to do this and
it works, but I'm not too keen on it anymore.

The new code waits until the eixsting chain has been sent and then
queues the next waiting chain in the 'transmit ok' handler.

Performance still looks good one way or the other.
This commit is contained in:
Bill Paul 1998-10-19 22:08:56 +00:00
parent 6fc32ef8ee
commit 1c403cb2b6
2 changed files with 23 additions and 20 deletions

View File

@ -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.54 1998/09/25 17:43:57 wpaul Exp wpaul $
* $Id: if_xl.c,v 1.13 1998/10/09 03:59:23 wpaul Exp $
*/
/*
@ -147,7 +147,7 @@
#ifndef lint
static char rcsid[] =
"$Id: if_xl.c,v 1.54 1998/09/25 17:43:57 wpaul Exp wpaul $";
"$Id: if_xl.c,v 1.13 1998/10/09 03:59:23 wpaul Exp $";
#endif
/*
@ -1704,6 +1704,7 @@ static int xl_list_tx_init(sc)
cd->xl_tx_free = &cd->xl_tx_chain[0];
cd->xl_tx_tail = cd->xl_tx_head = NULL;
sc->xl_txeoc = 1;
return(0);
}
@ -1939,15 +1940,16 @@ static void xl_txeof(sc)
if (sc->xl_cdata.xl_tx_head == NULL) {
ifp->if_flags &= ~IFF_OACTIVE;
sc->xl_cdata.xl_tx_tail = NULL;
sc->xl_txeoc = 1;
if (sc->xl_want_auto)
xl_autoneg_mii(sc, XL_FLAG_SCHEDDELAY, 1);
} else {
if (CSR_READ_4(sc, XL_DMACTL) & XL_DMACTL_DOWN_STALLED ||
!CSR_READ_4(sc, XL_DOWNLIST_PTR)) {
CSR_WRITE_4(sc, XL_DOWNLIST_PTR,
sc->xl_txeoc = 0;
CSR_WRITE_4(sc, XL_COMMAND, XL_CMD_DOWN_STALL);
xl_wait(sc);
CSR_WRITE_4(sc, XL_DOWNLIST_PTR,
vtophys(sc->xl_cdata.xl_tx_head->xl_ptr));
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_UNSTALL);
}
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_UNSTALL);
}
return;
@ -2269,21 +2271,21 @@ static void xl_start(ifp)
* Queue the packets. If the TX channel is clear, update
* the downlist pointer register.
*/
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_STALL);
xl_wait(sc);
if (CSR_READ_4(sc, XL_DOWNLIST_PTR)) {
sc->xl_cdata.xl_tx_tail->xl_next = start_tx;
sc->xl_cdata.xl_tx_tail->xl_ptr->xl_next =
vtophys(start_tx->xl_ptr);
sc->xl_cdata.xl_tx_tail->xl_ptr->xl_status &=
~XL_TXSTAT_DL_INTR;
} else {
if (sc->xl_cdata.xl_tx_head == NULL) {
sc->xl_cdata.xl_tx_head = start_tx;
sc->xl_cdata.xl_tx_tail = cur_tx;
CSR_WRITE_4(sc, XL_DOWNLIST_PTR, vtophys(start_tx->xl_ptr));
if (sc->xl_txeoc) {
sc->xl_txeoc = 0;
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_STALL);
xl_wait(sc);
CSR_WRITE_4(sc, XL_DOWNLIST_PTR,
vtophys(start_tx->xl_ptr));
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_UNSTALL);
}
} else {
sc->xl_cdata.xl_tx_tail->xl_next = start_tx;
sc->xl_cdata.xl_tx_tail = start_tx;
}
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_UNSTALL);
XL_SEL_WIN(7);

View File

@ -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.16 1998/09/25 17:43:57 wpaul Exp wpaul $
* $Id: if_xlreg.h,v 1.6 1998/10/09 03:59:24 wpaul Exp $
*/
#define XL_EE_READ 0x0080 /* read, 5 bit address */
@ -554,6 +554,7 @@ struct xl_softc {
u_int8_t xl_want_auto;
u_int8_t xl_autoneg;
u_int8_t xl_stats_no_timeout;
u_int8_t xl_txeoc;
caddr_t xl_ldata_ptr;
struct xl_list_data *xl_ldata;
struct xl_chain_data xl_cdata;