summaryrefslogtreecommitdiff
path: root/src/dev/net/dist_etherlink.cc
diff options
context:
space:
mode:
authormlebeane <michael.lebeane@amd.com>2016-10-26 22:48:33 -0400
committermlebeane <michael.lebeane@amd.com>2016-10-26 22:48:33 -0400
commit96905971f26e5218baebf8f953f05a9b341f9cc6 (patch)
tree4f2d06b18a4fc4bc92a4303e02e5c7668e2ec043 /src/dev/net/dist_etherlink.cc
parentde72e36619350f9b3e3a3dc8de63b490c4cecf2d (diff)
downloadgem5-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_etherlink.cc')
-rw-r--r--src/dev/net/dist_etherlink.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dev/net/dist_etherlink.cc b/src/dev/net/dist_etherlink.cc
index a793739f8..a1cdc01b7 100644
--- a/src/dev/net/dist_etherlink.cc
+++ b/src/dev/net/dist_etherlink.cc
@@ -197,7 +197,7 @@ DistEtherLink::TxLink::transmit(EthPacketPtr pkt)
}
packet = pkt;
- Tick delay = (Tick)ceil(((double)pkt->length * ticksPerByte) + 1.0);
+ Tick delay = (Tick)ceil(((double)pkt->simLength * ticksPerByte) + 1.0);
if (delayVar != 0)
delay += random_mt.random<Tick>(0, delayVar);
@@ -233,7 +233,7 @@ DistEtherLink::Link::unserialize(CheckpointIn &cp)
bool packet_exists;
UNSERIALIZE_SCALAR(packet_exists);
if (packet_exists) {
- packet = make_shared<EthPacketData>(16384);
+ packet = make_shared<EthPacketData>();
packet->unserialize("packet", cp);
}