diff options
author | wpaul <wpaul@FreeBSD.org> | 2001-08-16 20:15:16 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2001-08-16 20:15:16 +0000 |
commit | 7123562464a71826a1e011075e0fc75d5cae2645 (patch) | |
tree | 26707dbd066dda02fa7d25663ad091d9c6d6609a /sys/dev/sf | |
parent | c042e10a58412362c3f345480233dc36d914c6ad (diff) | |
download | FreeBSD-src-7123562464a71826a1e011075e0fc75d5cae2645.zip FreeBSD-src-7123562464a71826a1e011075e0fc75d5cae2645.tar.gz |
After one more day of testing, make what I hope are the final tweaks to
prevent/workaround TX lockups in this driver. The secret seems to be to
not let the TX DMA queue become too full. If we have too many packets
in the queue, we should wait for them to drain a bit before trying to
queue more. This should prevent the lockup from occurring, and if it
does occur, there is special code in sf_start() to kick the NIC in the
head and get it going again.
Special thanks to Glen Neff for helping me test this fix.
Diffstat (limited to 'sys/dev/sf')
-rw-r--r-- | sys/dev/sf/if_sf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index 8f5fec3..c0c05d5 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -1348,9 +1348,6 @@ static void sf_start(ifp) return; } - if (sc->sf_tx_cnt) - sf_txeof(sc); - txprod = csr_read_4(sc, SF_TXDQ_PRODIDX); i = SF_IDX_HI(txprod) >> 4; @@ -1388,6 +1385,11 @@ static void sf_start(ifp) SF_INC(i, SF_TX_DLIST_CNT); sc->sf_tx_cnt++; + /* + * Don't get the TX DMA queue get too full. + */ + if (sc->sf_tx_cnt > 64) + break; } if (cur_tx == NULL) { |