问题
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