diff options
author | mlebeane <michael.lebeane@amd.com> | 2016-10-26 22:48:33 -0400 |
---|---|---|
committer | mlebeane <michael.lebeane@amd.com> | 2016-10-26 22:48:33 -0400 |
commit | 96905971f26e5218baebf8f953f05a9b341f9cc6 (patch) | |
tree | 4f2d06b18a4fc4bc92a4303e02e5c7668e2ec043 /src/dev/net/sinic.cc | |
parent | de72e36619350f9b3e3a3dc8de63b490c4cecf2d (diff) | |
download | gem5-96905971f26e5218baebf8f953f05a9b341f9cc6.tar.xz |
dev: Add 'simLength' parameter in EthPacketData
Currently, all the network devices create a 16K buffer for the 'data' field
in EthPacketData, and use 'length' to keep track of the size of the packet
in the buffer. This patch introduces the 'simLength' parameter to
EthPacketData, which is used to hold the effective length of the packet used
for all timing calulations in the simulator. Serialization is performed using
only the useful data in the packet ('length') and not necessarily the entire
original buffer.
Diffstat (limited to 'src/dev/net/sinic.cc')
-rw-r--r-- | src/dev/net/sinic.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dev/net/sinic.cc b/src/dev/net/sinic.cc index fc75c9ebe..de8d4e98a 100644 --- a/src/dev/net/sinic.cc +++ b/src/dev/net/sinic.cc @@ -1085,6 +1085,7 @@ Device::txKick() case txCopyDone: vnic->TxDone = txDmaLen | Regs::TxDone_Complete; + txPacket->simLength += txDmaLen; txPacket->length += txDmaLen; if ((vnic->TxData & Regs::TxData_More)) { txPacketOffset += txDmaLen; @@ -1495,7 +1496,7 @@ Device::unserialize(CheckpointIn &cp) UNSERIALIZE_SCALAR(txPacketExists); txPacket = 0; if (txPacketExists) { - txPacket = make_shared<EthPacketData>(16384); + txPacket = make_shared<EthPacketData>(); txPacket->unserialize("txPacket", cp); UNSERIALIZE_SCALAR(txPacketOffset); UNSERIALIZE_SCALAR(txPacketBytes); |