From: Peter Xu <peterx@redhat.com>
To: Mattias Nissler <mnissler@rivosinc.com>
Cc: jag.raman@oracle.com, stefanha@redhat.com, qemu-devel@nongnu.org,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
john.levon@nutanix.com, "David Hildenbrand" <david@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
"Richard Henderson" <richard.henderson@linaro.org>
Subject: Re: [PATCH v10 4/7] softmmu: Support concurrent bounce buffers
Date: Tue, 7 May 2024 16:02:21 -0400 [thread overview]
Message-ID: <ZjqIzRLF_oy2Jmvk@x1n> (raw)
In-Reply-To: <20240507143431.464382-5-mnissler@rivosinc.com>
On Tue, May 07, 2024 at 07:34:28AM -0700, Mattias Nissler wrote:
> When DMA memory can't be directly accessed, as is the case when
> running the device model in a separate process without shareable DMA
> file descriptors, bounce buffering is used.
>
> It is not uncommon for device models to request mapping of several DMA
> regions at the same time. Examples include:
> * net devices, e.g. when transmitting a packet that is split across
> several TX descriptors (observed with igb)
> * USB host controllers, when handling a packet with multiple data TRBs
> (observed with xhci)
>
> Previously, qemu only provided a single bounce buffer per AddressSpace
> and would fail DMA map requests while the buffer was already in use. In
> turn, this would cause DMA failures that ultimately manifest as hardware
> errors from the guest perspective.
>
> This change allocates DMA bounce buffers dynamically instead of
> supporting only a single buffer. Thus, multiple DMA mappings work
> correctly also when RAM can't be mmap()-ed.
>
> The total bounce buffer allocation size is limited individually for each
> AddressSpace. The default limit is 4096 bytes, matching the previous
> maximum buffer size. A new x-max-bounce-buffer-size parameter is
> provided to configure the limit for PCI devices.
>
> Signed-off-by: Mattias Nissler <mnissler@rivosinc.com>
Acked-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
next prev parent reply other threads:[~2024-05-07 20:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 14:34 [PATCH v10 0/7] Support message-based DMA in vfio-user server Mattias Nissler
2024-05-07 14:34 ` [PATCH v10 1/7] system/physmem: Replace qemu_mutex_lock() calls with QEMU_LOCK_GUARD Mattias Nissler
2024-05-07 20:02 ` Peter Xu
2024-05-07 14:34 ` [PATCH v10 2/7] system/physmem: Propagate AddressSpace to MapClient helpers Mattias Nissler
2024-05-07 14:34 ` [PATCH v10 3/7] system/physmem: Per-AddressSpace bounce buffering Mattias Nissler
2024-05-07 14:34 ` [PATCH v10 4/7] softmmu: Support concurrent bounce buffers Mattias Nissler
2024-05-07 20:02 ` Peter Xu [this message]
2024-05-07 14:34 ` [PATCH v10 5/7] Update subprojects/libvfio-user Mattias Nissler
2024-05-07 14:34 ` [PATCH v10 6/7] vfio-user: Message-based DMA support Mattias Nissler
2024-05-07 14:34 ` [PATCH v10 7/7] vfio-user: Fix config space access byte order Mattias Nissler
2024-05-07 20:04 ` [PATCH v10 0/7] Support message-based DMA in vfio-user server Peter Xu
2024-05-08 21:16 ` Philippe Mathieu-Daudé
2024-05-08 21:21 ` Mattias Nissler
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=ZjqIzRLF_oy2Jmvk@x1n \
--to=peterx@redhat.com \
--cc=david@redhat.com \
--cc=elena.ufimtseva@oracle.com \
--cc=jag.raman@oracle.com \
--cc=john.levon@nutanix.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mnissler@rivosinc.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanha@redhat.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).