[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API
From: |
Paul Brook |
Subject: |
Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API |
Date: |
Mon, 19 Jan 2009 16:18:08 +0000 |
User-agent: |
KMail/1.9.9 |
>[block iterator]
> I agree that this model could be formalized into something that took a
> 'do IO on (data, len)' actor. In fact, since map() and unmap() are
> pretty generic, they too could be actors. This would then work for CPU
> memory IO, PCI memory IO, etc.
>
> The packet IO API is a bit different. It looks like:
>...
> if (offset < len) {
> sg[0].iov_base = alloc_buffer(size);
> cpu_physical_memory_rw(sg[0].iov_base, size);
>
> In this case, it isn't useful to get a callback with some of the packet
> data. You need to know up front whether you can map all of the packet
> data. In fact, a callback API doesn't really work because it implies
> that at the end of the callback, you either release the data or that the
> next callback could not be invoked until you unmap a previous data.
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.
Paul
- [Qemu-devel] [PATCH 0/5] Direct memory access for devices, Avi Kivity, 2009/01/18
- [Qemu-devel] [PATCH 4/5] I/O vector helpers, Avi Kivity, 2009/01/18
- [Qemu-devel] [PATCH 5/5] Convert IDE to directly access guest memory, Avi Kivity, 2009/01/18
- [Qemu-devel] [PATCH 3/5] Vectored block device API, Avi Kivity, 2009/01/18
- [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/18
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Ian Jackson, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Anthony Liguori, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API,
Paul Brook <=
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Anthony Liguori, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Anthony Liguori, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/20
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Ian Jackson, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Anthony Liguori, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/20
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Ian Jackson, 2009/01/20
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Ian Jackson, 2009/01/19
- Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/19