qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Klaus Jensen <k.jensen@samsung.com>,
	David Hildenbrand <david@redhat.com>,
	Peter Xu <peterx@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 8/8] hw/dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult
Date: Fri, 31 Dec 2021 12:51:38 +0100	[thread overview]
Message-ID: <32740819-2ab4-d9d5-8bc3-1e24b7f592ba@redhat.com> (raw)
In-Reply-To: <20211231114901.976937-9-philmd@redhat.com>

On 12/31/21 12:49, Philippe Mathieu-Daudé wrote:
> Since the previous commit, dma_buf_rw() returns a MemTxResult
> type. Do not discard it, return it to the caller.
> 
> Since both dma_buf_read/dma_buf_write functions were previously
> returning the QEMUSGList size not consumed, add an extra argument
> where the unconsummed size can be stored.
> 
> Update the few callers.
> 
> Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  include/hw/scsi/scsi.h |  2 +-
>  include/sysemu/dma.h   |  6 +++--
>  hw/ide/ahci.c          |  8 +++---
>  hw/nvme/ctrl.c         |  4 +--
>  hw/scsi/megasas.c      | 59 ++++++++++++++++++++++++++++++------------
>  hw/scsi/scsi-bus.c     |  6 +++--
>  softmmu/dma-helpers.c  | 18 +++++--------
>  7 files changed, 63 insertions(+), 40 deletions(-)
> 
> diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h
> index b27d133b113..1ffb367f94f 100644
> --- a/include/hw/scsi/scsi.h
> +++ b/include/hw/scsi/scsi.h
> @@ -30,7 +30,7 @@ struct SCSIRequest {
>      int16_t           status;
>      int16_t           host_status;
>      void              *hba_private;
> -    size_t            residual;
> +    uint64_t          residual;

Oops I forgot to mention this change since the previous version.

>      SCSICommand       cmd;
>      NotifierList      cancel_notifiers;
>  
> diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h
> index 45a2567848c..77a346d5ed1 100644
> --- a/include/sysemu/dma.h
> +++ b/include/sysemu/dma.h
> @@ -303,8 +303,10 @@ BlockAIOCB *dma_blk_read(BlockBackend *blk,
>  BlockAIOCB *dma_blk_write(BlockBackend *blk,
>                            QEMUSGList *sg, uint64_t offset, uint32_t align,
>                            BlockCompletionFunc *cb, void *opaque);
> -uint64_t dma_buf_read(void *ptr, int32_t len, QEMUSGList *sg, MemTxAttrs attrs);
> -uint64_t dma_buf_write(void *ptr, int32_t len, QEMUSGList *sg, MemTxAttrs attrs);
> +MemTxResult dma_buf_read(void *ptr, dma_size_t len, dma_size_t *residual,
> +                         QEMUSGList *sg, MemTxAttrs attrs);
> +MemTxResult dma_buf_write(void *ptr, dma_size_t len, dma_size_t *residual,
> +                          QEMUSGList *sg, MemTxAttrs attrs);
>  



      reply	other threads:[~2021-12-31 11:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-31 11:48 [PATCH 0/8] hw/dma: Introduce dma_size_t type definition Philippe Mathieu-Daudé
2021-12-31 11:48 ` [PATCH 1/8] hw/nvram: Restrict stub to sysemu and tools Philippe Mathieu-Daudé
2021-12-31 11:48 ` [PATCH 2/8] hw/pci: Restrict pci-bus stub to sysemu Philippe Mathieu-Daudé
2021-12-31 11:48 ` [PATCH 3/8] hw/pci: Document pci_dma_map() Philippe Mathieu-Daudé
2022-01-04  7:25   ` Peter Xu
2022-01-04  8:36     ` Philippe Mathieu-Daudé
2021-12-31 11:48 ` [PATCH 4/8] hw/dma: Remove CONFIG_USER_ONLY check Philippe Mathieu-Daudé
2021-12-31 11:48 ` [PATCH 5/8] hw/rdma/rdma_utils: Rename rdma_pci_dma_map 'len' argument Philippe Mathieu-Daudé
2022-01-18 10:13   ` Yuval Shaia
2021-12-31 11:48 ` [PATCH 6/8] hw/scsi: Rename SCSIRequest::resid as 'residual' Philippe Mathieu-Daudé
2021-12-31 11:49 ` [PATCH 7/8] hw/dma: Introduce dma_size_t type definition Philippe Mathieu-Daudé
2022-01-03 10:20   ` David Hildenbrand
2022-01-04  8:50     ` Philippe Mathieu-Daudé
2021-12-31 11:49 ` [PATCH 8/8] hw/dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult Philippe Mathieu-Daudé
2021-12-31 11:51   ` Philippe Mathieu-Daudé [this message]

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=32740819-2ab4-d9d5-8bc3-1e24b7f592ba@redhat.com \
    --to=philmd@redhat.com \
    --cc=david@redhat.com \
    --cc=k.jensen@samsung.com \
    --cc=kraxel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@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).