Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change handles from file-descriptors to 'struct dev_handle' #692

Closed
wants to merge 1 commit into from

Conversation

vikash-k5
Copy link

@vikash-k5 vikash-k5 commented Aug 8, 2023

api: refactor for transport agnostic library backend

Extend the api-types with the following device-handle types:

  • struct dev_handle
  • enum nvme_dev_type

The 'dev_handle' provides a, possibly opaque, device handle instead of a "fixed" file-descriptor. This allows for non-OS managed device-types such as user-space NVMe-drivers. Additionally, the types allows for library-side dispatch.

This is done in preparation for xNVMe, and thereby, support for
user-space NVMe driver, io_uring_cmd etc.

Extend the api-types with the following device-handle types:

* struct dev_handle
* enum nvme_dev_type

The 'dev_handle' provides a, possibly opaque, device handle instead of a
"fixed" file-descriptor. This allows for non-OS managed device-types
such as user-space NVMe-drivers. Additionally, the types allows for
library-side dispatch.

This is done in preparation for xNVMe, and thereby, support for
user-space NVMe driver, io_uring_cmd etc.

Signed-off-by: Vikash kumar <[email protected]>
@vikash-k5 vikash-k5 changed the title xnvme backend support Change handles from file-descriptors to 'struct dev_handle' Aug 9, 2023
@calebsander
Copy link
Contributor

This changes the public interface of a huge portion of the libnvme API. I'm not familiar with the "xNVMe" use case you mention, but it seems like it would be good to avoid having to make such widespread changes to users of libnvme. If you need to generalize the notion of a file descriptor, could you add new versions of the functions taking in the new type while leaving the original ones intact? The old functions could call the new functions under the hood, but I think it would be good to keep the existing interface intact as much as possible.

@igaw
Copy link
Collaborator

igaw commented Aug 11, 2023

@calebsander These changes are RFC status only and planed for the next major version update of the library. So this will not land in the 1.x branch. We had some offline discussion on these ideas and decided to have some early PR to discuss the API. So don't fear, we wont break 1.x :)

For example this PR does only a minimal change necessary to introduce the abstract handle. I think we should go bigger, e.g. see #448

This looks like an excellent topic for the next ALPSS conference :)

@igaw
Copy link
Collaborator

igaw commented Jun 27, 2024

Let's close this one. It is libnvme v2 material anyway.

@igaw igaw closed this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants