Skip to contentSkip to conversation

nvmet: discovery controller to set ioccsz and iorcsz

PATCH Superseded James Smart 2 participants 3 messages Feb 17, 2017 – Feb 21, 2017

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmet: discovery controller to set ioccsz and iorcsz

The discovery controller's Identify command handler never set these fields leaving them zero. The host-side fc transport validates that these values are appropriate and was killing the connection with the controller as they were zero.

Change them to the minimal SQE and CQE size values.

-- james

Signed-off-by James Smart <james.smart at broadcom.com>
---
 drivers/nvme/target/discovery.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/nvme/target/discovery.c +5 -0
index 12f39ee..6adb9e9 100644
@@ -152,6 +152,11 @@ static void nvmet_execute_identify_disc_ctrl(struct nvmet_req *req)
 
 	strcpy(id->subnqn, ctrl->subsys->subsysnqn);
 
+	/* Max command capsule size is sqe */
+	id->ioccsz = cpu_to_le32(sizeof(struct nvme_command) / 16);
+	/* Max response capsule size is cqe */
+	id->iorcsz = cpu_to_le32(sizeof(struct nvme_completion) / 16);
+
 	status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id));
 
 	kfree(id);
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/1 nvmet: discovery controller to set ioccsz and iorcsz

Quoted 6 lines · James Smart

The discovery controller's Identify command handler never set these fields leaving them zero. The host-side fc transport validates that these values are appropriate and was killing the connection with the controller as they were zero.

Change them to the minimal SQE and CQE size values.

Looks good to me.

Reviewed-by Jay Freyensee <james_p_freyensee at linux.intel.com>
Quoted 26 lines

-- james

Signed-off-by James Smart <james.smart at broadcom.com>

---
?drivers/nvme/target/discovery.c | 5 +++++
?1 file changed, 5 insertions(+)

drivers/nvme/target/discovery.c +0 -0
index 12f39ee..6adb9e9 100644
@@ -152,6 +152,11 @@ static void nvmet_execute_identify_disc_ctrl(struct
 nvmet_req *req)

?
? strcpy(id->subnqn, ctrl->subsys->subsysnqn);
?

drivers/nvme/target/discovery.c +5 -0
+	/* Max command capsule size is sqe */
+	id->ioccsz = cpu_to_le32(sizeof(struct nvme_command) / 16);
+	/* Max response capsule size is cqe */
+	id->iorcsz = cpu_to_le32(sizeof(struct nvme_completion) / 16);
+

? status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id));
?
? kfree(id);

#2 lore raw

PATCH 1/1 nvmet: discovery controller to set ioccsz and iorcsz

Quoted 1 line · J Freyensee

On Thu, 2017-02-16@17:43 -0800, James Smart wrote:

Nack this, I missed the next version thread :-/.