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
This commit is contained in:
parent
108cfe53d6
commit
36373fa465
2 changed files with 11 additions and 3 deletions
|
@ -113,8 +113,10 @@ class PacketFifo
|
||||||
{
|
{
|
||||||
PacketPtr &packet = *i;
|
PacketPtr &packet = *i;
|
||||||
if (i != fifo.begin()) {
|
if (i != fifo.begin()) {
|
||||||
--i;
|
iterator prev = i;
|
||||||
(*i)->slack += packet->length;
|
--prev;
|
||||||
|
assert(prev != fifo.end());
|
||||||
|
(*prev)->slack += packet->length;
|
||||||
} else {
|
} else {
|
||||||
_size -= packet->length;
|
_size -= packet->length;
|
||||||
_size -= packet->slack;
|
_size -= packet->slack;
|
||||||
|
|
|
@ -561,7 +561,7 @@ Device::regWrite(Addr daddr, int cpu, const uint8_t *data)
|
||||||
vnic.TxData = reg64;
|
vnic.TxData = reg64;
|
||||||
if (txList.empty() || txList.front() != index)
|
if (txList.empty() || txList.front() != index)
|
||||||
txList.push_back(index);
|
txList.push_back(index);
|
||||||
if (txEnable && txState == txIdle) {
|
if (txEnable && txState == txIdle && txList.front() == index) {
|
||||||
txState = txFifoBlock;
|
txState = txFifoBlock;
|
||||||
txKick();
|
txKick();
|
||||||
}
|
}
|
||||||
|
@ -943,12 +943,17 @@ Device::rxKick()
|
||||||
vnic->RxDone |= Regs::RxDone_Complete;
|
vnic->RxDone |= Regs::RxDone_Complete;
|
||||||
|
|
||||||
if (vnic->rxPacketBytes == rxDmaLen) {
|
if (vnic->rxPacketBytes == rxDmaLen) {
|
||||||
|
DPRINTF(EthernetSM, "rxKick: packet complete on vnic %d\n",
|
||||||
|
rxList.front());
|
||||||
rxFifo.remove(vnic->rxPacket);
|
rxFifo.remove(vnic->rxPacket);
|
||||||
vnic->rxPacket = rxFifo.end();
|
vnic->rxPacket = rxFifo.end();
|
||||||
} else {
|
} else {
|
||||||
vnic->RxDone |= Regs::RxDone_More;
|
vnic->RxDone |= Regs::RxDone_More;
|
||||||
vnic->rxPacketBytes -= rxDmaLen;
|
vnic->rxPacketBytes -= rxDmaLen;
|
||||||
vnic->rxPacketOffset += rxDmaLen;
|
vnic->rxPacketOffset += rxDmaLen;
|
||||||
|
DPRINTF(EthernetSM,
|
||||||
|
"rxKick: packet not complete on vnic %d: %d bytes left\n",
|
||||||
|
rxList.front(), vnic->rxPacketBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
rxList.pop_front();
|
rxList.pop_front();
|
||||||
|
@ -1074,6 +1079,7 @@ Device::txKick()
|
||||||
|
|
||||||
switch (txState) {
|
switch (txState) {
|
||||||
case txFifoBlock:
|
case txFifoBlock:
|
||||||
|
assert(Regs::get_TxDone_Busy(vnic->TxData));
|
||||||
if (!txPacket) {
|
if (!txPacket) {
|
||||||
// Grab a new packet from the fifo.
|
// Grab a new packet from the fifo.
|
||||||
txPacket = new PacketData(16384);
|
txPacket = new PacketData(16384);
|
||||||
|
|
Loading…
Reference in a new issue