Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] nvmet: discovery controller to set ioccsz and iorcsz
@ 2017-02-17  2:42 James Smart
  2017-02-17  9:15 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: James Smart @ 2017-02-17  2:42 UTC (permalink / raw)



Revised the patch: add transport capsule inline size into ioccsz value

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.

Set the controller ioccsz and iorcsz values

-- james

Signed-off-by: James Smart <james.smart at broadcom.com>
---
 drivers/nvme/target/discovery.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c
index 12f39ee..9872402 100644
--- a/drivers/nvme/target/discovery.c
+++ b/drivers/nvme/target/discovery.c
@@ -152,6 +152,12 @@ static void nvmet_execute_identify_disc_ctrl(struct nvmet_req *req)
 
 	strcpy(id->subnqn, ctrl->subsys->subsysnqn);
 
+	/* Max command capsule size is sqe + single page of in-capsule data */
+	id->ioccsz = cpu_to_le32((sizeof(struct nvme_command) +
+				  ctrl->ops->sqe_inline_size) / 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.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] nvmet: discovery controller to set ioccsz and iorcsz
  2017-02-17  2:42 [PATCH v2] nvmet: discovery controller to set ioccsz and iorcsz James Smart
@ 2017-02-17  9:15 ` Christoph Hellwig
  2017-02-21 20:41   ` J Freyensee
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2017-02-17  9:15 UTC (permalink / raw)


On Thu, Feb 16, 2017@06:42:20PM -0800, James Smart wrote:
> 
> Revised the patch: add transport capsule inline size into ioccsz value
> 
> 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.
> 
> Set the controller ioccsz and iorcsz values

Discovery controllers do not support I/O commands, so these settings
don't make any sense there.  They are also not included in the
fields that Idenitfy Controller should report for Discovery controllers
(Figure 33 in Fabrics 1.0)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] nvmet: discovery controller to set ioccsz and iorcsz
  2017-02-17  9:15 ` Christoph Hellwig
@ 2017-02-21 20:41   ` J Freyensee
  0 siblings, 0 replies; 3+ messages in thread
From: J Freyensee @ 2017-02-21 20:41 UTC (permalink / raw)


On Fri, 2017-02-17@01:15 -0800, Christoph Hellwig wrote:
> On Thu, Feb 16, 2017@06:42:20PM -0800, James Smart wrote:
> > 
> > 
> > Revised the patch: add transport capsule inline size into ioccsz value
> > 
> > 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.
> > 
> > Set the controller ioccsz and iorcsz values
> 
> Discovery controllers do not support I/O commands, so these settings
> don't make any sense there.??They are also not included in the
> fields that Idenitfy Controller should report for Discovery controllers
> (Figure 33 in Fabrics 1.0)

I didn't think it hurt making sure these two fields contain the minimum
required values, per Fabrics spec, as values of 0 are invalid (Figure 28). ?But
I also see your point.

Jay

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-21 20:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-17  2:42 [PATCH v2] nvmet: discovery controller to set ioccsz and iorcsz James Smart
2017-02-17  9:15 ` Christoph Hellwig
2017-02-21 20:41   ` J Freyensee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox