Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152872606
D30995.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
793 B
Referenced Files
None
Subscribers
None
D30995.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D30995: nvme: Fix race condition in nvme_qpair_process_completions
Attached
Detach File
Event Timeline
Log In to Comment