-
Notifications
You must be signed in to change notification settings - Fork 184
Description
Hello @ikwzm,
I am currently writing an application note showing how to write PL data to and SSD connected via PCIe.
As a buffer manager I am using your driver, thank you very much for this work.
This is the udmabuf config:
dmabuf@0x00 {
compatible = "ikwzm,u-dma-buf";
device-name = "udmabuf0";
minor-number = <0>;
quirk-mmap-on;
size = <0x10000000>;
};
For writing to the ssd I am using io_uring ( https://en.wikipedia.org/wiki/Io_uring).
I thought with quirk-mmap-on a mmaped udma buffer behaves the same as a buffer allocated with malloc. This code snippet:
// 6. Wait for completion
io_uring_cqe* cqe;
if (io_uring_wait_cqe(&ring, &cqe) < 0) {
perror("io_uring_wait_cqe");
io_uring_queue_exit(&ring);
close(fd);
}
auto end = std::chrono::steady_clock::now();
std::chrono::duration<double, std::milli> duration_ms = end - start;
if (cqe->res < 0) {
fprintf(stderr, "Async write failed: %s\n", strerror(-cqe->res));
will fail with an error (-5) Input/Output error.
When I usestd::memcpy(buffer, dmaBufLow, C_HALF_DMA_BUF_SIZE); to copy data from the udma buffer to the malloc buffer the ssd writes do work.
(but the performance drops and memory bandwidth is wasted)
Do you have an idea if it is possible to use udmabuf the same was as a normal user space buffer?
Thanks
Marco