|
From: | Avi Kivity |
Subject: | Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API |
Date: | Mon, 19 Jan 2009 18:39:44 +0200 |
User-agent: | Thunderbird 2.0.0.19 (X11/20090105) |
Anthony Liguori wrote:
Paul Brook wrote:It looks like what you're actually doing is pushing the bounce buffer allocation into the individual packet consumers.Maybe a solution to this is a 'do IO on IOVEC' actor, with an additional flag that says whether it is acceptable to split the allocation. That way both block and packet interfaces use the same API, and avoids proliferation of manual bounce buffers in packet devices.I think there may be utility in having packet devices provide the bounce buffers, in which case, you could probably unique both into a single function with a flag. But why not just have two separate functions?Those two functions can live in exec.c too. The nice thing about using map() is that it's easily overriden and chained. So what I'm proposing.cpu_physical_memory_map() cpu_physical_memory_unmap()
This should be the baseline API with the rest using it.
do_streaming_IO(map, unmap, ioworker, opaque);
Why pass map and unmap?grant based devices needn't go through this at all, since you never mix grants and physical addresses, and since grants never need bouncing.
do_packet_IO(map, unmap, buffer, size, ioworker, opaque);
If you pass the buffer then the device needs to allocate large amounts of bounce memory.
-- error compiling committee.c: too many arguments to function
[Prev in Thread] | Current Thread | [Next in Thread] |