DMA: Refactor the DMA device and align timing and atomic
Review Request #1316 - Created July 21, 2012 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 9146:a02007211735 --------------------------- DMA: Refactor the DMA device and align timing and atomic This patch does a bunch of house-keeping updates on the DMA, including indentation, and formatting, but most importantly breaks out the response handling such that it can be shared between the atomic and timing modes. It also removes a potential bug caused by the atomic handling of responses only deleting the allocated request (pkt->req) once the DMA action completes instead of doing so for every packet. Before this patch, the handling of responses was near identical for atomic and timing, but the code was simply duplicated. With this patch, the handleResp method deals with the responses in both cases. There are further updates to make after removing the NACKs, but that will be part of a separate follow-up patch. This patch does not change the behaviour of any regression.
util/regress all passing (disregarding t1000 and eio)
Posted (July 21, 2012, 3:33 a.m.)
haven't looked in detail, but isn't only a single request created for all packets that isn't ref counted? how can you delete it every time then?
-
src/dev/dma_device.hh (Diff revision 1) -
use uint
Ship It!
Review request changed
Updated (July 22, 2012, 6:31 p.m.)
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+127 -127) |
Review request changed
Updated (July 28, 2012, 3:24 a.m.)
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+102 -107) |
Ship It!
Posted (Aug. 6, 2012, 11:26 a.m.)
Nice! I really like patches that result in a net reduction of non-comment LOC...
-
src/dev/dma_device.hh (Diff revision 3) -
Why the switch from list to deque? Not that I have much preference, just wondering why it matters enough to change.
-
src/dev/dma_device.hh (Diff revision 3) -
I don't see where we use 'uint' anywhere else in the code, and I don't believe it's a standard typedef. If signedness really matters, use 'unsigned' or 'unsigned int' (we seem to use the former predominantly, and the latter just occasionally).
-
src/dev/dma_device.cc (Diff revision 3) -
I see that you're relocating the panic message at the bottom of the function to a more sensible location, but the whole check seems redundant wrt the assert(state) below... if senderState is null, it will pass through dynamic_cast unmodified and we'll catch it there. Thus I'd be in favor of just getting rid of this statement as effectively being an assertion that won't get compiled out with gem5.fast.
-
src/dev/dma_device.cc (Diff revision 3) -
Is the distinction about whether we use the size in the request or the packet significant? Shouldn't they be the same? This comment makes it sound like that distinction is meaningful...
Posted (Aug. 7, 2012, 2:05 a.m.)
-
src/dev/dma_device.hh (Diff revision 3) -
blame me all you like... I meant uint32_t or whatever explicit type ;)... don't care that much though
