Re: [PATCH rdma-rc] RDMA/rxe: Bound MR copy and flush chunks to MR pages
From: Zhu Yanjun
Date: Mon Nov 30 2026 - 23:54:11 EST
在 2026/11/30 14:12, Andrew Stellman 写道:
On Sun, Nov 29, 2026 at 08:57:43PM -0800, Zhu Yanjun wrote:
In rxe, mr_page_size() always returns PAGE_SIZE and never changes.I ran it to check, this time with no page-size hook. In one arm64 QEMU
guest on mainline 7.4-rc5 with 64 KiB pages and KASAN, I connected the
NVMe/RDMA host to an nvmet-rdma target over rxe. The only test change
was a pr_info in rxe_map_mr_sg(), and during direct I/O it logged
mr_page_size=4096 and PAGE_SIZE=65536.
With a 512-byte-sector namespace and eight scattered iovecs, reading
the data back failed at the first byte of the second iovec in each of
three ten-round runs. With this patch applied, all ten rounds passed
in each of three runs, and going back to the unpatched module brought
the same failure back. Aligned 4 KiB I/O passed with both.
So on this path the MR page size isn't PAGE_SIZE, and without this
patch the data read back is wrong.
Interesting. Would you like to add logs to check if the returned value of the function mr_page_size is changed?
Based on your commit, we just need to compare PAGE_SIZE with mr_page_size.
+ unsigned int chunk = min_t(unsigned int, PAGE_SIZE,
+ mr_page_size(mr)) - page_offset;
Thanks a lot.
Yanjun Zhu
If you intend to support different page_size values in rxe, patchesThe patch isn't trying to add support for another page size.
implementing that feature would be very welcome.
From my perspective, however, the current patch does not yet actually
deliver that capability.
rxe_map_mr_sg() already accepts the 4 KiB MR pages nvme-rdma asks for
on this kernel, as the log above shows, and the patch fixes the copy
for that case.
I can send you the test program, setup scripts and logs off-list if
you'd like to run it.
Andrew
--
Best Regards,
Yanjun.Zhu