linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* NVMe PCI driver ignores SQHD from completion entries
@ 2019-10-04 18:27 Vaibhav Nagarnaik
  2019-10-05 14:27 ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: Vaibhav Nagarnaik @ 2019-10-04 18:27 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg
  Cc: linux-nvme, Bart Van Assche, Eric Gouriou, Abbas Companywala, Mihai R.


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

Hello

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.

However, the NVMe PCI driver (up to and including v5.3.2) does not
respect this value. Abbas (cc'd here) verified that entries that are
pending on the controller will be overwritten by the driver if there
are enough block requests.

Practically speaking, this is probably not an issue for most
controllers since they would start processing the NVMe command as soon
as possible. And then never look at the entry again.

Is this considered spec violation? And if so, is it worth providing a
fix for it?

Keeping in mind, that a particularly long running NVMe command will
not allow some controllers to move SQ Head value. Even though the
subsequent NVMe commands have received completions earlier. This will
cause new block requests from being submitted until the long running
command is completed.


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

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

end of thread, other threads:[~2019-10-08 17:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2019-10-08 15:59     ` Keith Busch
2019-10-08 17:45       ` James Smart

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).