linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Vaibhav Nagarnaik <vnagarnaik@google.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Abbas Companywala <acompany@google.com>,
	Bart Van Assche <bvanassche@google.com>,
	linux-nvme@lists.infradead.org, Jens Axboe <axboe@fb.com>,
	Eric Gouriou <egouriou@google.com>,
	Christoph Hellwig <hch@lst.de>, "Mihai R." <dizzy@google.com>,
	Sagi Grimberg <sagi@grimberg.me>
Subject: Re: NVMe PCI driver ignores SQHD from completion entries
Date: Mon, 7 Oct 2019 17:32:55 -0700	[thread overview]
Message-ID: <CAL26m8+gM6KdrqpDTTQ_Tj7FGSd-qbcU78O0Ok3EaQ_B9rgHkw@mail.gmail.com> (raw)
In-Reply-To: <20191005142722.GA30437@keith-busch>


[-- Attachment #1.1: Type: text/plain, Size: 1509 bytes --]

On Sat, Oct 5, 2019 at 7:27 AM Keith Busch <kbusch@kernel.org> wrote:
>
> On Fri, Oct 04, 2019 at 11:27:30AM -0700, Vaibhav Nagarnaik wrote:
> > According to NVMe spec:
> > A Submission Queue entry has been consumed by the controller when a
> > Completion Queue entry is posted that indicates that the Submission
> > Queue Head Pointer has moved past the slot in which that Submission
> > Queue entry was placed.
> >
> > Which means, the driver needs to verify SQ Head Pointer value reported
> > in the completion entries before considering a particular SQ entry
> > reusable. Otherwise it's undefined behavior.
>
> The spec allows the controller to process and complete commands out of
> order, but the controller must fetch those commands in order. It's in the
> "Theory of Operation" section 1.4.

Thanks for clarifying. That makes sense.

It would be nice to have the spec clarify other sections that makes
the host check the SQ Head Pointer value.

> Checking SQ head is required only if the host might submit more commands
> than there are entries. The Linux nvme driver allocates enough tags
> for the depth of the queue, leaving one entry empty, so having a tag
> available means the next sq entry must be available.

But the driver does overwrite submission queue entries under process
(which are already fetched by the controller). Are there guarantees
from controllers out there that once fetched, the SQ entries will not
be fetched again for any reason? The spec doesn't prohibit that.



Vaibhav

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4851 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

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

  reply	other threads:[~2019-10-08  0:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 18:27 NVMe PCI driver ignores SQHD from completion entries Vaibhav Nagarnaik
2019-10-05 14:27 ` Keith Busch
2019-10-08  0:32   ` Vaibhav Nagarnaik [this message]
2019-10-08 15:59     ` Keith Busch
2019-10-08 17:45       ` James Smart

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=CAL26m8+gM6KdrqpDTTQ_Tj7FGSd-qbcU78O0Ok3EaQ_B9rgHkw@mail.gmail.com \
    --to=vnagarnaik@google.com \
    --cc=acompany@google.com \
    --cc=axboe@fb.com \
    --cc=bvanassche@google.com \
    --cc=dizzy@google.com \
    --cc=egouriou@google.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).