qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write
Date: Thu, 11 Aug 2011 14:29:19 +0100	[thread overview]
Message-ID: <CAJSP0QXbufGV0uyW7e8GE1dmduGT5OaYwcMk3WM_=r5RBFZ+0Q@mail.gmail.com> (raw)
In-Reply-To: <4E43C6CE.9070008@redhat.com>

On Thu, Aug 11, 2011 at 1:10 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 08/11/2011 09:58 AM, Stefan Hajnoczi wrote:
>>
>> On Thu, Aug 04, 2011 at 07:14:43PM +0200, Paolo Bonzini wrote:
>>>
>>> These helpers do a full transfer from an in-memory buffer to
>>> target memory, with full support for MMIO areas.  It will be used to
>>> store
>>> the reply of an emulated command into a QEMUSGList provided by the
>>> adapter.
>>>
>>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>>> ---
>>>  cutils.c      |    8 +++---
>>>  dma-helpers.c |   63
>>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>  dma.h         |    5 ++++
>>>  3 files changed, 72 insertions(+), 4 deletions(-)
>>
>> I don't understand this patch.  If we have a memory buffer that needs to
>> be transferred to target memory, then there is no need for bounce
>> buffers or cpu_physical_memory_map().
>>
>> Can we use cpu_physical_memory_rw() on each sglist element instead?  No
>> -EAGAIN necessary because the memory buffer already acts as the local
>> bounce buffer.
>
> Doh, you're obviously right.  I don't know what I was thinking. :)
>
> What do you think about passing the residual bytes for short transfers?
>  Should I look into updating BlockDriverCompletionFunc, or is the approach
> of patch 2 okay?  If I have an excuse to learn more about Coccinelle, that
> can be fun. :)

The bdrv_aio_readv() and bdrv_aio_writev() functions don't have the
concept of residual bytes.  They only work on fully completed I/O
operations.  If there is an error they pass -errno.  Therefore I don't
think BlockDriverCompletionFunc is the right type to add residual
bytes to.

It seems that residual bytes are a SCSI layer concept that the block
layer does not deal with.

Stefan

  reply	other threads:[~2011-08-11 13:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04 17:14 [Qemu-devel] [PATCH 00/10] SCSI scatter/gather support Paolo Bonzini
2011-08-04 17:14 ` [Qemu-devel] [PATCH 01/10] dma-helpers: allow including from target-independent code Paolo Bonzini
2011-08-04 17:14 ` [Qemu-devel] [PATCH 02/10] dma-helpers: track position in the QEMUSGList Paolo Bonzini
2011-08-04 17:14 ` [Qemu-devel] [PATCH 03/10] dma-helpers: rewrite completion/cancellation Paolo Bonzini
2011-08-04 17:14 ` [Qemu-devel] [PATCH 04/10] dma-helpers: prepare for adding dma_buf_* functions Paolo Bonzini
2011-08-04 17:14 ` [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write Paolo Bonzini
2011-08-11  7:58   ` Stefan Hajnoczi
2011-08-11 12:10     ` Paolo Bonzini
2011-08-11 13:29       ` Stefan Hajnoczi [this message]
2011-08-11 14:24         ` Paolo Bonzini
2011-08-11 14:37           ` Kevin Wolf
2011-08-11 15:05             ` Paolo Bonzini
2011-08-11 15:12               ` Kevin Wolf
2011-08-11 15:27                 ` Paolo Bonzini
2011-08-11 20:06                   ` Stefan Hajnoczi
2011-08-04 17:14 ` [Qemu-devel] [PATCH 06/10] scsi: pass residual amount to command_complete Paolo Bonzini
2011-08-04 17:14 ` [Qemu-devel] [PATCH 07/10] scsi: add scatter/gather functionality Paolo Bonzini
2011-08-04 17:14 ` [Qemu-devel] [PATCH 08/10] scsi-disk: commonize iovec creation between reads and writes Paolo Bonzini
2011-08-04 17:14 ` [Qemu-devel] [PATCH 09/10] scsi-disk: lazily allocate bounce buffer Paolo Bonzini
2011-08-04 17:14 ` [Qemu-devel] [PATCH 10/10] scsi-disk: enable scatter/gather functionality Paolo Bonzini
2011-08-04 17:14 ` [Qemu-devel] [PATCH 11/11] sample pvscsi driver with s/g support Paolo Bonzini
2011-08-11  7:57 ` [Qemu-devel] [PATCH 00/10] SCSI scatter/gather support Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJSP0QXbufGV0uyW7e8GE1dmduGT5OaYwcMk3WM_=r5RBFZ+0Q@mail.gmail.com' \
    --to=stefanha@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).