Page MenuHomeFreeBSD

D30995.diff
No OneTemporary

D30995.diff

Index: sys/dev/nvme/nvme_qpair.c
===================================================================
--- sys/dev/nvme/nvme_qpair.c
+++ sys/dev/nvme/nvme_qpair.c
@@ -591,6 +591,20 @@
if (NVME_STATUS_GET_P(cpl.status) != qpair->phase)
break;
+ /*
+ * Re-sync and re-read now we know the completion has the right
+ * phase, as we need to ensure our reads of cid and sqhd happen
+ * after the read of status in order to not see stale values
+ * from before the completion queue entry was filled.
+ */
+ bus_dmamap_sync(qpair->dma_tag, qpair->queuemem_map,
+ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+
+ cpl = qpair->cpl[qpair->cq_head];
+
+ /* Convert to host endian */
+ nvme_completion_swapbytes(&cpl);
+
tr = qpair->act_tr[cpl.cid];
if (tr != NULL) {

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 18, 4:07 PM (10 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31726263
Default Alt Text
D30995.diff (793 B)

Event Timeline