diff options
author | 2016-01-04 09:10:55 -0700 | |
---|---|---|
committer | 2016-01-12 13:33:33 -0700 | |
commit | e3e9d50cd6ed392bb716e35c134d1e82707c51b4 (patch) | |
tree | f661137d04089a35834a17034d2aebab8fef8196 /drivers/nvme | |
parent | nvme: make SG_IO support optional (diff) | |
download | linux-e3e9d50cd6ed392bb716e35c134d1e82707c51b4.tar.gz linux-e3e9d50cd6ed392bb716e35c134d1e82707c51b4.tar.bz2 linux-e3e9d50cd6ed392bb716e35c134d1e82707c51b4.zip |
NVMe: Fix admin queue ring wrap
The tag set queue depth needs to be one less than the h/w queue depth
so we don't wrap the circular buffer. This conforms to the specification
defined "Full Queue" condition.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/pci.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index a7e549969462..30ed2ab2cadb 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1271,7 +1271,12 @@ static int nvme_alloc_admin_tags(struct nvme_dev *dev) if (!dev->ctrl.admin_q) { dev->admin_tagset.ops = &nvme_mq_admin_ops; dev->admin_tagset.nr_hw_queues = 1; - dev->admin_tagset.queue_depth = NVME_AQ_BLKMQ_DEPTH; + + /* + * Subtract one to leave an empty queue entry for 'Full Queue' + * condition. See NVM-Express 1.2 specification, section 4.1.2. + */ + dev->admin_tagset.queue_depth = NVME_AQ_BLKMQ_DEPTH - 1; dev->admin_tagset.timeout = ADMIN_TIMEOUT; dev->admin_tagset.numa_node = dev_to_node(dev->dev); dev->admin_tagset.cmd_size = nvme_cmd_size(dev); |