diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2009-01-06 10:36:57 -0500 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2009-01-06 10:36:57 -0500 |
commit | 2adc60795b0e21d46f983293b3b71b48ee105c14 (patch) | |
tree | c952ecf0b8729d02cd9e702819a3c3b283354aa3 /src/dev/i8254xGBe.hh | |
parent | 11ac0c7acfe2d75d51e56e3a4305bf3209b3d420 (diff) | |
download | gem5-2adc60795b0e21d46f983293b3b71b48ee105c14.tar.xz |
IGbE: Implement header splitting with large MTU
Diffstat (limited to 'src/dev/i8254xGBe.hh')
-rw-r--r-- | src/dev/i8254xGBe.hh | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/dev/i8254xGBe.hh b/src/dev/i8254xGBe.hh index 5e5ab1d21..6dd2141b0 100644 --- a/src/dev/i8254xGBe.hh +++ b/src/dev/i8254xGBe.hh @@ -83,6 +83,9 @@ class IGbE : public EtherDevice bool rxDmaPacket; + // Number of bytes copied from current RX packet + int pktOffset; + // Delays in managaging descriptors Tick fetchDelay, wbDelay; Tick fetchCompDelay, wbCompDelay; @@ -586,6 +589,12 @@ class IGbE : public EtherDevice bool pktDone; + /** Variable to head with header/data completion events */ + int splitCount; + + /** Bytes of packet that have been copied, so we know when to set EOP */ + int bytesCopied; + public: RxDescCache(IGbE *i, std::string n, int s); @@ -593,20 +602,28 @@ class IGbE : public EtherDevice * descriptor and update the book keeping. Should only be called when * there are no dma's pending. * @param packet ethernet packet to write - * @return if the packet could be written (there was a free descriptor) + * @param pkt_offset bytes already copied from the packet to memory + * @return pkt_offset + number of bytes copied during this call */ - void writePacket(EthPacketPtr packet); + int writePacket(EthPacketPtr packet, int pkt_offset); + /** Called by event when dma to write packet is completed */ void pktComplete(); - /** Check if the dma on the packet has completed. + /** Check if the dma on the packet has completed and RX state machine + * can continue */ - bool packetDone(); EventWrapper<RxDescCache, &RxDescCache::pktComplete> pktEvent; + // Event to handle issuing header and data write at the same time + // and only callking pktComplete() when both are completed + void pktSplitDone(); + EventWrapper<RxDescCache, &RxDescCache::pktSplitDone> pktHdrEvent; + EventWrapper<RxDescCache, &RxDescCache::pktSplitDone> pktDataEvent; + virtual bool hasOutstandingEvents(); virtual void serialize(std::ostream &os); |