summaryrefslogtreecommitdiff
path: root/dev/ns_gige.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-11-16 23:59:51 -0500
committerNathan Binkert <binkertn@umich.edu>2004-11-16 23:59:51 -0500
commita109296bdeaf43c76c2384c67b05d4b5bd484ff4 (patch)
tree492f85f04edf439f33c9fd16c70784b7a4dde50a /dev/ns_gige.cc
parent8de12dc09ac1cf471f201964db68308656fdb6f6 (diff)
downloadgem5-a109296bdeaf43c76c2384c67b05d4b5bd484ff4.tar.xz
Fix a bug where we would improperly calculate if the FIFO was
full by adding a reserve feature to the packet fifo which allows us to reserve space in the fifo if only part of a packet was copied into the fifo. dev/ns_gige.cc: use the new reserve feature in the fifo to properly determine when we're full. assert that adding a packet to the fifo suceeds. dev/pktfifo.hh: add the ability to reserve space in the fifo. This is useful for partial writing of packets into the fifo. --HG-- extra : convert_revision : 83f871f34fac237bb464c9513cf6490b5c62420e
Diffstat (limited to 'dev/ns_gige.cc')
-rw-r--r--dev/ns_gige.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/dev/ns_gige.cc b/dev/ns_gige.cc
index 401599126..e51e14f1d 100644
--- a/dev/ns_gige.cc
+++ b/dev/ns_gige.cc
@@ -1341,9 +1341,6 @@ NSGigE::rxKick()
// sanity check - i think the driver behaves like this
assert(rxDescCnt >= rxPktBytes);
-
- // Must clear the value before popping to decrement the
- // reference count
rxFifo.pop();
}
@@ -1564,9 +1561,6 @@ NSGigE::transmit()
* besides, it's functionally the same.
*/
devIntrPost(ISR_TXOK);
- } else {
- DPRINTF(Ethernet,
- "May need to rethink always sending the descriptors back?\n");
}
if (!txFifo.empty() && !txEvent.scheduled()) {
@@ -1822,7 +1816,11 @@ NSGigE::txKick()
// this is just because the receive can't handle a
// packet bigger want to make sure
assert(txPacket->length <= 1514);
- txFifo.push(txPacket);
+#ifndef NDEBUG
+ bool success =
+#endif
+ txFifo.push(txPacket);
+ assert(success);
/*
* this following section is not tqo spec, but
@@ -1903,6 +1901,7 @@ NSGigE::txKick()
txPacketBufPtr += txXferLen;
txFragPtr += txXferLen;
txDescCnt -= txXferLen;
+ txFifo.reserve(txXferLen);
txState = txFifoBlock;
break;