Skip to contentSkip to conversation

nvme-pci: Fix incorrect use of CMB size to calculate q_depth

PATCH In review [email protected] 4 participants 5 messages Feb 5, 2018 – Feb 6, 2018 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-pci: Fix incorrect use of CMB size to calculate q_depth

From: Stephen Bates <[email protected]>

We should not be using the CMB to determine the permissable q_depth when we don't plan to place any queues in the CMB. In the case of a small CMB or large numbers of queues this could lead to shallow queues when they don't need to be.

Signed-off-by Stephen Bates <sbates at raithlin.com>
---
 drivers/nvme/host/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/pci.c +1 -1
index 0bc6a9e..0d099e9 100644
@@ -1913,7 +1913,7 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
 	if (nr_io_queues == 0)
 		return 0;
 
-	if (dev->cmb && (dev->cmbsz & NVME_CMBSZ_SQS)) {
+	if (dev->cmb && use_cmb_sqes && (dev->cmbsz & NVME_CMBSZ_SQS)) {
 		result = nvme_cmb_qdepth(dev, nr_io_queues,
 				sizeof(struct nvme_command));
 		if (result > 0)
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/1
#1 lore raw

Looks good,

Reviewed-by Sagi Grimberg <sagi at grimberg.me>

I'll pick this one up unless someone thinks I shouldn't..

Reviewed-by
#2 lore raw
Quoted 5 lines · Sagi Grimberg

Looks good,

Reviewed-by Sagi Grimberg <sagi at grimberg.me>

I'll pick this one up unless someone thinks I shouldn't..

Looks good to me (I can imagine what scenario failed this :) ),

Reviewed-by Max Gurtovoy <maxg at mellanox.com>
Quoted 5 lines

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

#3 lore raw
In reply to [email protected]

drivers/nvme/host/pci.c static int nvme_setup_io_queues(struct nvme_dev *dev) · line 1916

Quoted 3 lines · On Mon, Feb 05, 2018 at 03:32:23PM -0700, [email protected] wrote:
drivers/nvme/host/pci.c +1 -1
-	if (dev->cmb && (dev->cmbsz & NVME_CMBSZ_SQS)) {
+	if (dev->cmb && use_cmb_sqes && (dev->cmbsz & NVME_CMBSZ_SQS)) {

Is this a prep patch for something coming later? dev->cmb is already NULL if use_cmb_sqes is false.

#4 lore raw
Quoted 10 lines · Keith Busch

drivers/nvme/host/pci.c static int nvme_setup_io_queues(struct nvme_dev *dev) · line 1916

Quoted 5 lines · On Mon, Feb 05, 2018@03:32:23PM -0700, [email protected] wrote:
drivers/nvme/host/pci.c +1 -1
-    if (dev->cmb && (dev->cmbsz & NVME_CMBSZ_SQS)) {
+    if (dev->cmb && use_cmb_sqes && (dev->cmbsz & NVME_CMBSZ_SQS)) {

Is this a prep patch for something coming later? dev->cmb is already NULL if use_cmb_sqes is false.

Thanks Keith.

Not sure how I missed this. I was working on OOT patches to enable WDS and RDS in the CMB. I *thought* I?d confirmed this patch was applicable to upstream. Looks like I did not do that correctly.

Sorry for the churn. We can leave this patch out for now. Thanks for the prompt feedback everyone!

Stephen