some questions about create I/O queues

dingxiang dingxiang at huawei.com
Wed Apr 29 18:26:13 PDT 2015


On 2015/4/29 21:22, Keith Busch wrote:

> On Tue, 28 Apr 2015, dingxiang wrote:
>>   When I create I/O queues and not create from qid 1,for example, I create
>>   from qid 3,then I insmod nvme driver, there will be some error information as below
> 
> How did you manage to create IO queues starting from QID 3 when the
> driver wasn't loaded?
> 
> 

HI,Keith
   I have modified two places to create queues from QID 3 before the driver loaded,
details are as follows:
   kernel version:3.10

diff --git a/nvme-core.c b/nvme-core.c
index ce79a59..8325b58 100644
--- a/nvme-core.c
+++ b/nvme-core.c
@@ -226,7 +226,7 @@ static void *cancel_cmdid(struct nvme_queue *nvmeq, int cmdid,

 struct nvme_queue *get_nvmeq(struct nvme_dev *dev)
 {
-       return dev->queues[get_cpu() + 1];
+       return dev->queues[3];
 }

 void put_nvmeq(struct nvme_queue *nvmeq)
@@ -1703,7 +1703,7 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)

        q_depth = min_t(int, NVME_CAP_MQES(readq(&dev->bar->cap)) + 1,
                                                                NVME_Q_DEPTH);
-       for (i = 0; i < nr_io_queues; i++) {
+       for (i = 2; i < nr_io_queues; i++) {
                dev->queues[i + 1] = nvme_create_queue(dev, i + 1, q_depth, i);
                if (IS_ERR(dev->queues[i + 1]))
                        return PTR_ERR(dev->queues[i + 1]);

   Thanks !




More information about the Linux-nvme mailing list