From: Jesper Wendel Devantier <foss@defmacro.it>
To: Daniel Gomez <da.gomez@kernel.org>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Peter Xu <peterx@redhat.com>,
Philippe Mathieu-Daudé <philmd@mailo.com>,
Keith Busch <kbusch@kernel.org>, Klaus Jensen <its@irrelevant.dk>,
Klaus Jensen <k.jensen@samsung.com>,
qemu-block@nongnu.org, Daniel Gomez <da.gomez@samsung.com>,
GOST <gost.dev@samsung.com>
Subject: Re: [PATCH v2 4/7] dma-helpers: chunk dma_blk_cb at IOV_MAX
Date: Fri, 4 Sep 2026 23:58:16 +0200 [thread overview]
Message-ID: <20260904235802.4-foss@defmacro.it> (raw)
In-Reply-To: <20260819-align-nvme-mdts-with-linux-v2-4-351ac2dfed64@samsung.com>
On 2026-08-19T17:24:06+02:00, Daniel Gomez <da.gomez@kernel.org> wrote:
> From: Daniel Gomez <da.gomez@samsung.com>
>
> dma_blk_cb() submits dbs->iov to io_func() in one shot, so callers
> must keep dbs->iov.niov below IOV_MAX or the host preadv()/pwritev()
> rejects the call.
>
> Break the accumulation loop when niov reaches IOV_MAX. The existing
> re-entry path resumes mapping and submits a follow-up chunk under
> the same AIOCB, so callers no longer carry that constraint.
>
> Suggested-by: Klaus Jensen <k.jensen@samsung.com>
> Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
> ---
> system/dma-helpers.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/system/dma-helpers.c b/system/dma-helpers.c
> index d4fd33a3d4c..613fa548669 100644
> --- a/system/dma-helpers.c
> +++ b/system/dma-helpers.c
> @@ -175,6 +175,9 @@ static void dma_blk_cb(void *opaque, int ret)
> dbs->sg_cur_byte = 0;
> ++dbs->sg_cur_index;
> }
> + if (dbs->iov.niov >= IOV_MAX) {
> + break;
> + }
> }
>
> if (dbs->iov.size == 0) {
>
> --
> 2.55.0
>
>
>
Acked-by: Jesper Wendel Devantier <foss@defmacro.it>
next prev parent reply other threads:[~2026-09-04 22:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 15:24 [PATCH v2 0/7] hw/nvme: lift IOV_MAX limit in DMA path Daniel Gomez
2026-08-19 15:24 ` [PATCH v2 1/7] dma-helpers: fix unaligned discard_back Daniel Gomez
2026-09-04 21:57 ` Jesper Wendel Devantier
2026-09-09 12:17 ` Daniel Gomez
2026-08-19 15:24 ` [PATCH v2 2/7] dma-helpers: ensure IOV_MAX chunks end aligned Daniel Gomez
2026-08-19 15:24 ` [PATCH v2 3/7] dma-helpers: cap iovec allocation at IOV_MAX Daniel Gomez
2026-09-04 21:57 ` Jesper Wendel Devantier
2026-08-19 15:24 ` [PATCH v2 4/7] dma-helpers: chunk dma_blk_cb " Daniel Gomez
2026-09-04 21:58 ` Jesper Wendel Devantier [this message]
2026-08-19 15:24 ` [PATCH v2 5/7] hw/nvme: clamp mdts and zasl shifts Daniel Gomez
2026-09-04 21:58 ` Jesper Wendel Devantier
2026-08-19 15:24 ` [PATCH v2 6/7] hw/nvme: drop DMA-path IOV_MAX guard Daniel Gomez
2026-09-04 21:59 ` Jesper Wendel Devantier
2026-08-19 15:24 ` [PATCH v2 7/7] hw/nvme: cap mdts for CMB/PMR-only Daniel Gomez
2026-09-04 22:02 ` Jesper Wendel Devantier
2026-09-09 12:35 ` Daniel Gomez
2026-09-04 22:00 ` [PATCH v2 0/7] hw/nvme: lift IOV_MAX limit in DMA path Keith Busch
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=20260904235802.4-foss@defmacro.it \
--to=foss@defmacro.it \
--cc=da.gomez@kernel.org \
--cc=da.gomez@samsung.com \
--cc=gost.dev@samsung.com \
--cc=its@irrelevant.dk \
--cc=k.jensen@samsung.com \
--cc=kbusch@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@mailo.com \
--cc=qemu-block@nongnu.org \
--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 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.