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/dist_iface.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/dist_iface.cc')
-rw-r--r-- | src/dev/net/dist_iface.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dev/net/dist_iface.cc b/src/dev/net/dist_iface.cc index 0e48770ed..26fe45317 100644 --- a/src/dev/net/dist_iface.cc +++ b/src/dev/net/dist_iface.cc @@ -407,7 +407,7 @@ DistIface::RecvScheduler::resumeRecvTicks() Desc d = descQueue.front(); descQueue.pop(); d.sendTick = curTick(); - d.sendDelay = d.packet->size(); // assume 1 tick/byte max link speed + d.sendDelay = d.packet->simLength; // assume 1 tick/byte max link speed v.push_back(d); } @@ -493,7 +493,7 @@ DistIface::RecvScheduler::Desc::unserialize(CheckpointIn &cp) { UNSERIALIZE_SCALAR(sendTick); UNSERIALIZE_SCALAR(sendDelay); - packet = std::make_shared<EthPacketData>(16384); + packet = std::make_shared<EthPacketData>(); packet->unserialize("rxPacket", cp); } @@ -583,14 +583,15 @@ DistIface::packetOut(EthPacketPtr pkt, Tick send_delay) header.sendTick = curTick(); header.sendDelay = send_delay; - header.dataPacketLength = pkt->size(); + header.dataPacketLength = pkt->length; + header.simLength = pkt->simLength; // Send out the packet and the meta info. sendPacket(header, pkt); DPRINTF(DistEthernetPkt, "DistIface::sendDataPacket() done size:%d send_delay:%llu\n", - pkt->size(), send_delay); + pkt->length, send_delay); } void |