From: Peter Xu <peterx@redhat.com>
To: Samuel Zhang <guoqing.zhang@amd.com>,
"Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>
Cc: qemu-devel@nongnu.org, farosas@suse.de, lizhijian@fujitsu.com,
eblake@redhat.com, armbru@redhat.com, Emily.Deng@amd.com,
Victor.Zhao@amd.com, PengJu.Zhou@amd.com, Qing.Ma@amd.com
Subject: Re: [PATCH v4] migration/rdma: add x-rdma-chunk-size parameter
Date: Wed, 29 Jul 2026 15:18:45 -0400 [thread overview]
Message-ID: <ampSFcrRagKtf5y_@x1.local> (raw)
In-Reply-To: <20260330064758.2816891-1-guoqing.zhang@amd.com>
I'm looking at some RDMA security tickets recently, and I stumbled on top
of this chunk size problem. Since this is very recently touched, I figured
maybe I should ask here,
On Mon, Mar 30, 2026 at 02:47:58PM +0800, Samuel Zhang wrote:
> @@ -2176,7 +2178,7 @@ static int qemu_rdma_write(RDMAContext *rdma,
> rdma->current_length += len;
>
> /* flush it if buffer is too large */
> - if (rdma->current_length >= RDMA_MERGE_MAX) {
> + if (rdma->current_length >= rdma_merge_max()) {
[1]
What is this rdma_merge_max()? Why it's twice the chunk size, and even if
I believe when reaching here the current_length should have been throttled
by chunk size too?
> return qemu_rdma_write_flush(rdma, errp);
> }
I mean, in qemu_rdma_buffer_mergeable():
...
chunk_end = ram_chunk_end(block, rdma->current_chunk);
...
if ((host_addr + len) > chunk_end) {
return false;
}
I believe it means when len will go beyond chunk size, it'll force a flush
already.
With that, when reaching [1] above, we either should have just flushed, or
we're under chunk size (which further guarantees smaller than
2*chunk_size).
What did I miss? Or, is this line [1] dead code?
Thanks,
--
Peter Xu
prev parent reply other threads:[~2026-07-29 19:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 6:47 [PATCH v4] migration/rdma: add x-rdma-chunk-size parameter Samuel Zhang
2026-07-29 19:18 ` Peter Xu [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=ampSFcrRagKtf5y_@x1.local \
--to=peterx@redhat.com \
--cc=Emily.Deng@amd.com \
--cc=PengJu.Zhou@amd.com \
--cc=Qing.Ma@amd.com \
--cc=Victor.Zhao@amd.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=farosas@suse.de \
--cc=guoqing.zhang@amd.com \
--cc=lizhijian@fujitsu.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 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.