Is There Any Way for Ioctl() in Linux to Specify Submission Queue Id for a Nvme Io Request

Is there any way for ioctl() in linux to specify submission queue ID for a nvme IO request

Look a little bit into nvme_submit_io(), it calls nvme_submit_user_cmd()Refer here. You will see nvme_alloc_request(q, cmd, 0, NVME_QID_ANY). The request allocates to NVME_QID_ANY means it not specify QID and let the hardware queue mapping to decide which queue is going to send.

Back to your question. AFAIK, there has NO native way to specify QID when sending ioctl cmd. If you really want to. You need to modify native nvme source code and build your own nvme driver.

HINT: Try to let nvme_alloc_request can receive specified QID, instead of NVME_QID_ANY.

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

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.

Do we have a way to read NVMe driver's completion queue entry via nvmecli?

https://github.com/linux-nvme/nvme-cli/issues/858

Got answers from another forum. Hence arking this as closed.



Related Topics



Leave a reply



Submit