Is there any alternative for ioctl() in linux to interact with nvme drives

纵饮孤独 提交于 2019-12-11 09:30:07

问题


I am working on a testing tool for nvme-cli(written in c and can run on linux).

For SSD validation purpose, we are actually looking for sending I/O commands to a particular Submission queue(IO Queue pair). We needed this because we wanted threading, but for threading to happen we need to send I/O requests to different queues else the I/O requests would be processed serially.

So is there any way in ioctl() where we can specify the Submission queue IDs?

OR

Is there other thing similar to ioctl() where we can specify the Submission queue IDs?

Since i am new to nvme or ioctl, please correct me if i am wrong.


回答1:


You can try SPDK (https://github.com/spdk/spdk) which contains an user-space NVMe driver. It is written in C. Youc an find its NVMe driver APIs in spdk/include/spdk/nvme.h. For example, spdk_nvme_ctrlr_cmd_io_raw() is used to send any kinds of IO commands to the device, with any created qpair.

You can also try Pynvme (https://github.com/cranechu/pynvme), a python extension of SPDK. Its IOWorker just sends requests within separated process and qpair.



来源:https://stackoverflow.com/questions/47899389/is-there-any-alternative-for-ioctl-in-linux-to-interact-with-nvme-drives

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!