summaryrefslogtreecommitdiff
path: root/dev/pktfifo.hh
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-11-28 18:40:58 -0500
committerNathan Binkert <binkertn@umich.edu>2005-11-28 18:40:58 -0500
commit36373fa465b813ac7d19e85f4cf68238cef4a035 (patch)
treed37808ac64be27808dab6c1f3d3fa118cc64e5ee /dev/pktfifo.hh
parent108cfe53d6ac09c18dc531230a38bdc1c25bd2cb (diff)
downloadgem5-36373fa465b813ac7d19e85f4cf68238cef4a035.tar.xz
Virtualized SINIC fixes
dev/pktfifo.hh: we can't modify i because it's used further down to remove the packet from the fifo. Instead, copy the iterator and modify that to get the previous packet. dev/sinic.cc: - don't change the transmit state and kick the machine unless we're at the head of the txList. - add a couple of debugging statements to figure out how far along we've gotten in processing a packet. - assert that the current tx vnic has something to do when we start processing the state machine. --HG-- extra : convert_revision : 588fe2c7d810be0e3d8d39c5cc0ec8a72119517e
Diffstat (limited to 'dev/pktfifo.hh')
-rw-r--r--dev/pktfifo.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/dev/pktfifo.hh b/dev/pktfifo.hh
index 61e4ead1b..e63fd291f 100644
--- a/dev/pktfifo.hh
+++ b/dev/pktfifo.hh
@@ -113,8 +113,10 @@ class PacketFifo
{
PacketPtr &packet = *i;
if (i != fifo.begin()) {
- --i;
- (*i)->slack += packet->length;
+ iterator prev = i;
+ --prev;
+ assert(prev != fifo.end());
+ (*prev)->slack += packet->length;
} else {
_size -= packet->length;
_size -= packet->slack;