All of lore.kernel.org
 help / color / mirror / Atom feed
From: james_p_freyensee@linux.intel.com (J Freyensee)
Subject: [PATCH 2/2] nvme-rdma: sqsize/hsqsize/hrqsize is 0-based val
Date: Mon, 08 Aug 2016 11:39:25 -0700	[thread overview]
Message-ID: <1470681565.4368.7.camel@linux.intel.com> (raw)
In-Reply-To: <9A947B1F6D0FF74CB5D6ACFF43B473F3A3A45C75@ORSMSX112.amr.corp.intel.com>

On Mon, 2016-08-08@18:14 +0000, Minturn, Dave B wrote:
> > 
> > > 
> > > -----Original Message-----
> > > From: Linux-nvme [mailto:linux-nvme-bounces at lists.infradead.org]
> > > On
> > > Behalf Of Verkamp, Daniel
> > > Sent: Monday, August 08, 2016 9:30 AM
> > > To: hch at lst.de; sagi at grimberg.me
> > > Cc: james_p_freyensee at linux.intel.com; linux-nvme at lists.infradead
> > > .org
> > > Subject: Re: [PATCH 2/2] nvme-rdma: sqsize/hsqsize/hrqsize is 0-
> > > based val
> > > 
> > > On Mon, 2016-08-08@09:06 +0200, Christoph Hellwig wrote:
> > > > 
> > > > On Sun, Aug 07, 2016@10:29:08AM +0300, Sagi Grimberg wrote:
> > > > > 
> > > > > 
> > > > > Did we really decide that? The spec actually explicitly says
> > > > > that a 0 sqsize will be failed:
> > > > > 
> > > > > "If the size is 0h or larger than the controller supports,
> > > > > then a
> > > > > status value of Connect Invalid Parameters shall be
> > > > > returned."
> > > > > 
> > > > > And then it says: "This is a 0?s based value"
> > > > > 
> > > > > Confusing....
> > > > 
> > > > Yeah, I think we'll need an errate in the TWG.??And I think the
> > > > current Linux behavior is the sensible one.??Jay, do you want
> > > > to drive this in the WG or I should I bring it up?
> > > 
> > > I would be happy if all of the 0's based values in the spec were
> > > removed, but I think it's a little too late for that...
> > > 
> > > In this particular case, I'm pretty sure this is not a mistake;
> > > the
> > > relevant text is copied directly from the NVMe base spec Create
> > > I/O
> > > Submission Queue command's QSIZE parameter.
> > > 
> 
> Daniel is correct, this is not a mistake in the specification.
> 
> > 
> > > 
> > > What does need to be clarified is the RDMA transport definition.
> > > ?The
> > > Connect private data contains two queue size-related fields:
> > > 
> > > - HSQSIZE, which is supposed to be the RDMA QP send depth, but
> > > also says
> > > "shall be set to the Submission Queue Size (SQSIZE)", while not
> > > saying
> > > whether it is 0's based.
> 
> The spec. states that SQSIZE is 0-based and given HSQSIZE must be
> equal to SQSIZE, the value is going to be 0's based.
> We can suggest adding some additional clarification the spec. such as
> a reminder that SQSIZE is 0-based.???
> 
> 
> > 
> > > 
> > > - HRQSIZE, which is the QP receive depth, which has no equivalent
> > > like
> > > SQSIZE in the Connect command, and also does not mention being
> > > 0's
> > > based.

(replying back to the list)

So with the comment Dave made, this code in the rdma.c host:


-???????????????priv.hrqsize = cpu_to_le16(queue->queue_size);
-???????????????priv.hsqsize = cpu_to_le16(queue->queue_size);
+???????????????priv.hrqsize = cpu_to_le16(queue->ctrl->ctrl.sqsize);

priv.hrqsize is wrong according to the NVMe fabrics spec. ?At minimum
it should be implemented as:

priv.hrqsize = cpu_to_le16(queue->ctrl->ctrl.sqsize + 1);


+???????????????priv.hsqsize = cpu_to_le16(queue->ctrl->ctrl.sqsize);


and this line remains the same because sqsize is 0 based and the spec
clearly says hsqsize shall be set to sqsize.


I see the confusion for hrqsize and I think we should try and get it
cleared up in errata, but I think sqsize and hsqsize the way it's
stated in the spec is pretty clear.

  parent reply	other threads:[~2016-08-08 18:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-06  0:54 [PATCH 0/2] nvme-fabrics: sqsize bug fixes Jay Freyensee
2016-08-06  0:54 ` [PATCH 1/2] nvme-rdma: tell fabrics layer admin queue depth Jay Freyensee
2016-08-07  7:20   ` Sagi Grimberg
2016-08-08  7:05     ` Christoph Hellwig
2016-08-08 16:11       ` J Freyensee
2016-08-06  0:54 ` [PATCH 2/2] nvme-rdma: sqsize/hsqsize/hrqsize is 0-based val Jay Freyensee
2016-08-07  7:29   ` Sagi Grimberg
2016-08-08  7:06     ` Christoph Hellwig
2016-08-08 16:30       ` Verkamp, Daniel
     [not found]         ` <9A947B1F6D0FF74CB5D6ACFF43B473F3A3A45C75@ORSMSX112.amr.corp.intel.com>
2016-08-08 18:39           ` J Freyensee [this message]
2016-08-08 16:08     ` Verkamp, Daniel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470681565.4368.7.camel@linux.intel.com \
    --to=james_p_freyensee@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.