dev: Add 'simLength' parameter in EthPacketData
Review Request #3493 - Created May 31, 2016 and submitted
| Information | |
|---|---|
| Michael LeBeane | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 11637:cd6bb67002fa
---------------------------
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.
Thank you for the patch! It looks good, I have a few minor comments only.
-
src/dev/net/etherpkt.cc (Diff revision 1) -
Could you use 'dataLength' instead of 'bufferLength' here to serialize only the useful data?
-
src/dev/net/etherpkt.cc (Diff revision 1) -
If you serialize the useful data only then you could use dataLength here, too. In that case, adding an assertion to make sure dataLength <= bufferLength would be good, too.
-
src/dev/net/etherpkt.cc (Diff revision 1) -
There is an implicit assumption that the EthPacketData object is "empty" (i.e. data==nullptr) at this point. It may be good to add an assertion to check that exlicitly.
Change Summary:
Address review comments and reapply on tip.
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+163 -138) |
It looks good! Thank you for the fixes!
Any more comments on this? We would like to get a few more ship it's since this fairly large and will break checkpoints.
-
src/dev/net/etherpkt.cc (Diff revision 2) -
I really don't like the way this is breaking checkpoints.
The right thing to do here would be to implement this in a way that doesn't break checkpoint. The simplest way would probably be to use length as the name for dataLength. If simLength is present (I'm going to push a helper function to test for that shortly), you just unserialize the value. If not, you use a fallback such as simLength = dataLength.
The other option is to provide a checkpoint updater, which is pretty tricky since you need to find all places where packets are serialized.
Summary: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+53 -28) |
Ship It!
