Skip to contentSkip to conversation

Fix wrong sqsize settings in fabrics

PATCH New Sagi Grimberg 3 participants 7 messages Apr 6, 2017 – Apr 9, 2017

Subsystems (3)
lore
Share & tools
lore

Sagi Grimberg

author maintainer
#0 lore raw

cover Fix wrong sqsize settings in fabrics

This should have been fixed by now, but apparently it wasn't.

Sagi Grimberg (3):
nvme-loop: Fix sqsize wrong assignment based on ctrl MQES capability
nvme-rdma: Fix sqsize wrong assignment based on ctrl MQES capability
nvme-fc: Fix sqsize wrong assignment based on ctrl MQES capability

 drivers/nvme/host/fc.c     | 2 +-
 drivers/nvme/host/rdma.c   | 2 +-
 drivers/nvme/target/loop.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
author maintainer
#1 lore raw

PATCH 1/3 nvme-loop: Fix sqsize wrong assignment based on ctrl MQES capability

both our sqsize and the controller MQES cap are a 0 based value, so making it 1 based is wrong.

Reported-by Trapp, Darren <Darren.Trapp at cavium.com>
Reported-by Daniel Verkamp <daniel.verkamp at intel.com>
Signed-off-by Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/target/loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/loop.c +1 -1
index 33b431e4eec3..0487fdf82cfc 100644
@@ -408,7 +408,7 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl)
 	}
 
 	ctrl->ctrl.sqsize =
-		min_t(int, NVME_CAP_MQES(ctrl->cap) + 1, ctrl->ctrl.sqsize);
+		min_t(int, NVME_CAP_MQES(ctrl->cap), ctrl->ctrl.sqsize);
 
 	error = nvme_enable_ctrl(&ctrl->ctrl, ctrl->cap);
 	if (error)
Signature · 1 line
2.7.4
author maintainer
#2 lore raw

PATCH 2/3 nvme-rdma: Fix sqsize wrong assignment based on ctrl MQES capability

In reply to Sagi Grimberg

both our sqsize and the controller MQES cap are a 0 based value, so making it 1 based is wrong.

Reported-by Trapp, Darren <Darren.Trapp at cavium.com>
Reported-by Daniel Verkamp <daniel.verkamp at intel.com>
Signed-off-by Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/host/rdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/rdma.c +1 -1
index 4aae363943e3..d674ca32ef02 100644
@@ -1600,7 +1600,7 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl)
 	}
 
 	ctrl->ctrl.sqsize =
-		min_t(int, NVME_CAP_MQES(ctrl->cap) + 1, ctrl->ctrl.sqsize);
+		min_t(int, NVME_CAP_MQES(ctrl->cap), ctrl->ctrl.sqsize);
 
 	error = nvme_enable_ctrl(&ctrl->ctrl, ctrl->cap);
 	if (error)
Signature · 1 line
2.7.4
author maintainer
#3 lore raw

PATCH 3/3 nvme-fc: Fix sqsize wrong assignment based on ctrl MQES capability

In reply to Sagi Grimberg

both our sqsize and the controller MQES cap are a 0 based value, so making it 1 based is wrong.

Reported-by Trapp, Darren <Darren.Trapp at cavium.com>
Reported-by Daniel Verkamp <daniel.verkamp at intel.com>
Signed-off-by Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/host/fc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/fc.c +1 -1
index fc42172c796a..6953a5762153 100644
@@ -2011,7 +2011,7 @@ nvme_fc_configure_admin_queue(struct nvme_fc_ctrl *ctrl)
 	}
 
 	ctrl->ctrl.sqsize =
-		min_t(int, NVME_CAP_MQES(ctrl->cap) + 1, ctrl->ctrl.sqsize);
+		min_t(int, NVME_CAP_MQES(ctrl->cap), ctrl->ctrl.sqsize);
 
 	error = nvme_enable_ctrl(&ctrl->ctrl, ctrl->cap);
 	if (error)
Signature · 1 line
2.7.4
#4 lore raw

cover Fix wrong sqsize settings in fabrics

In reply to Sagi Grimberg

All the fixes looks good:

Reviewed-by Christoph Hellwig <hch at lst.de>

But this duplicate code really screams for factoring it into helper..

author maintainer
#5 lore raw

cover Fix wrong sqsize settings in fabrics

In reply to Sagi Grimberg
Quoted 2 lines

This should have been fixed by now, but apparently it wasn't.

Jens, care to pick it up for your next rc pull-request?

maintainer
#6 lore raw

cover Fix wrong sqsize settings in fabrics

Quoted 4 lines · Sagi Grimberg
Quoted 2 lines

This should have been fixed by now, but apparently it wasn't.

Jens, care to pick it up for your next rc pull-request?

Yep, added, thanks.

Signature · 1 line
Jens Axboe