From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Mattias Nissler <mnissler@rivosinc.com>
Cc: qemu-devel@nongnu.org, jag.raman@oracle.com, peterx@redhat.com,
stefanha@redhat.com,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
john.levon@nutanix.com, "David Hildenbrand" <david@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Elena Ufimtseva" <elena.ufimtseva@oracle.com>
Subject: Re: [PATCH v7 2/5] softmmu: Support concurrent bounce buffers
Date: Mon, 12 Feb 2024 09:24:09 +0000 [thread overview]
Message-ID: <20240212092409.00007dd4@Huawei.com> (raw)
In-Reply-To: <20240212080617.2559498-3-mnissler@rivosinc.com>
On Mon, 12 Feb 2024 00:06:14 -0800
Mattias Nissler <mnissler@rivosinc.com> 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>
Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
next prev parent reply other threads:[~2024-02-12 9:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 8:06 [PATCH v7 0/5] Support message-based DMA in vfio-user server Mattias Nissler
2024-02-12 8:06 ` [PATCH v7 1/5] softmmu: Per-AddressSpace bounce buffering Mattias Nissler
2024-02-12 9:23 ` Jonathan Cameron via
2024-02-12 8:06 ` [PATCH v7 2/5] softmmu: Support concurrent bounce buffers Mattias Nissler
2024-02-12 9:24 ` Jonathan Cameron via [this message]
2024-02-29 10:34 ` Heinrich Schuchardt
2024-02-12 8:06 ` [PATCH v7 3/5] Update subprojects/libvfio-user Mattias Nissler
2024-02-12 8:06 ` [PATCH v7 4/5] vfio-user: Message-based DMA support Mattias Nissler
2024-02-12 8:06 ` [PATCH v7 5/5] vfio-user: Fix config space access byte order Mattias Nissler
2024-02-20 5:06 ` [PATCH v7 0/5] Support message-based DMA in vfio-user server Peter Xu
2024-02-29 10:49 ` 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=20240212092409.00007dd4@Huawei.com \
--to=qemu-devel@nongnu.org \
--cc=Jonathan.Cameron@Huawei.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=peterx@redhat.com \
--cc=philmd@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.