Skip to contentSkip to conversation

nvme-pci: only set nr_maps to 2 if poll queues are supported

PATCH New Christoph Hellwig 2 participants 2 messages Dec 14, 2018 NVMe

lore
Share & tools
lore

Christoph Hellwig

author maintainer
#0 lore raw

PATCH 1/1 nvme-pci: only set nr_maps to 2 if poll queues are supported

The block layer now enables polling support on a queue if nr_maps includes the poll map, so we should only set that if we actually support poll queues.

Signed-off-by Christoph Hellwig <hch at lst.de>
---
 drivers/nvme/host/pci.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/nvme/host/pci.c +3 -0
index fb9d8270f32c..8b62d0075e48 100644
@@ -2293,6 +2293,9 @@ static int nvme_dev_add(struct nvme_dev *dev)
 	if (!dev->ctrl.tagset) {
 		dev->tagset.ops = &nvme_mq_ops;
 		dev->tagset.nr_hw_queues = dev->online_queues - 1;
+		dev->tagset.nr_maps = 2; /* default + read */
+		if (dev->io_queues[HCTX_TYPE_POLL])
+			dev->tagset.nr_maps++;
 		dev->tagset.nr_maps = HCTX_MAX_TYPES;
 		dev->tagset.timeout = NVME_IO_TIMEOUT;
 		dev->tagset.numa_node = dev_to_node(dev->dev);
Signature · 1 line
2.19.2
maintainer
#1 lore raw

PATCH 1/1 nvme-pci: only set nr_maps to 2 if poll queues are supported

Quoted 3 lines · Christoph Hellwig

The block layer now enables polling support on a queue if nr_maps includes the poll map, so we should only set that if we actually support poll queues.

Looks good to me, but needs a Fixes line.

Signature · 1 line
Jens Axboe