aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1999-04-29 16:27:51 +0000
committerBill Paul <wpaul@FreeBSD.org>1999-04-29 16:27:51 +0000
commit737267b89113c9ca76cad7d9629b36a1e7565e22 (patch)
treef986208088f5e54ca5eaec4b0e574141a413a5ba
parentf677e15fe88171233fa84c7a7afda74bac34ba15 (diff)
downloadsrc-737267b89113c9ca76cad7d9629b36a1e7565e22.tar.gz
src-737267b89113c9ca76cad7d9629b36a1e7565e22.zip
Add a test to ti_encap() to try and prevent the transmit producer index
from ever catching up to the transmit consumer index. We can't let this happen because ti_txeof() depends on the assumption that producer == consumer means the ring is empty, and producer != consumer means the ring has some number of active descriptors in it.
Notes
Notes: svn path=/head/; revision=46177
-rw-r--r--sys/dev/ti/if_ti.c7
-rw-r--r--sys/pci/if_ti.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c
index 297cbc09e17c..212f34546113 100644
--- a/sys/dev/ti/if_ti.c
+++ b/sys/dev/ti/if_ti.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_ti.c,v 1.2 1999/04/06 22:56:21 wpaul Exp $
+ * $Id: if_ti.c,v 1.109 1999/04/29 16:22:07 wpaul Exp $
*/
/*
@@ -128,7 +128,7 @@
#if !defined(lint)
static const char rcsid[] =
- "$Id: if_ti.c,v 1.2 1999/04/06 22:56:21 wpaul Exp $";
+ "$Id: if_ti.c,v 1.109 1999/04/29 16:22:07 wpaul Exp $";
#endif
/*
@@ -2053,6 +2053,9 @@ static int ti_encap(sc, m_head, txidx)
if (m != NULL)
return(ENOBUFS);
+ if (frag == sc->ti_tx_saved_considx)
+ return(ENOBUFS);
+
if (sc->ti_hwrev == TI_HWREV_TIGON)
sc->ti_rdata->ti_tx_ring_nic[cur % 128].ti_flags |=
TI_BDFLAG_END;
diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c
index 297cbc09e17c..212f34546113 100644
--- a/sys/pci/if_ti.c
+++ b/sys/pci/if_ti.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_ti.c,v 1.2 1999/04/06 22:56:21 wpaul Exp $
+ * $Id: if_ti.c,v 1.109 1999/04/29 16:22:07 wpaul Exp $
*/
/*
@@ -128,7 +128,7 @@
#if !defined(lint)
static const char rcsid[] =
- "$Id: if_ti.c,v 1.2 1999/04/06 22:56:21 wpaul Exp $";
+ "$Id: if_ti.c,v 1.109 1999/04/29 16:22:07 wpaul Exp $";
#endif
/*
@@ -2053,6 +2053,9 @@ static int ti_encap(sc, m_head, txidx)
if (m != NULL)
return(ENOBUFS);
+ if (frag == sc->ti_tx_saved_considx)
+ return(ENOBUFS);
+
if (sc->ti_hwrev == TI_HWREV_TIGON)
sc->ti_rdata->ti_tx_ring_nic[cur % 128].ti_flags |=
TI_BDFLAG_END;