[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 2/5] softmmu: Support concurrent bounce buffers
From: |
Peter Xu |
Subject: |
Re: [PATCH v5 2/5] softmmu: Support concurrent bounce buffers |
Date: |
Fri, 22 Sep 2023 11:28:24 -0400 |
On Wed, Sep 20, 2023 at 01:06:19AM -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
- [PATCH v5 0/5] Support message-based DMA in vfio-user server, Mattias Nissler, 2023/09/20
- [PATCH v5 1/5] softmmu: Per-AddressSpace bounce buffering, Mattias Nissler, 2023/09/20
- [PATCH v5 2/5] softmmu: Support concurrent bounce buffers, Mattias Nissler, 2023/09/20
- Re: [PATCH v5 2/5] softmmu: Support concurrent bounce buffers,
Peter Xu <=
- [PATCH v5 3/5] Update subprojects/libvfio-user, Mattias Nissler, 2023/09/20
- [PATCH v5 5/5] vfio-user: Fix config space access byte order, Mattias Nissler, 2023/09/20
- [PATCH v5 4/5] vfio-user: Message-based DMA support, Mattias Nissler, 2023/09/20