Skip to content

Writing PL Data on a MPSoC to an SSD, quirk-mmap-on question #137

Description

@smartheit

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions