Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177368951
D59151.1794215083.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D59151.1794215083.diff
View Options
diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c
--- a/sys/dev/nvme/nvme_qpair.c
+++ b/sys/dev/nvme/nvme_qpair.c
@@ -1053,7 +1053,6 @@
mtx_assert(&qpair->lock, MA_OWNED);
req = tr->req;
- req->cmd.cid = qpair->cid_base + tr->cid;
qpair->act_tr[tr->cid] = tr;
ctrlr = qpair->ctrlr;
@@ -1089,16 +1088,16 @@
nvme_payload_map(void *arg, bus_dma_segment_t *seg, int nseg, int error)
{
struct nvme_tracker *tr = arg;
+ struct nvme_qpair *qpair = tr->qpair;
uint32_t cur_nseg;
- /*
- * If the mapping operation failed, return immediately. The caller
- * is responsible for detecting the error status and failing the
- * tracker manually.
- */
if (error != 0) {
- nvme_printf(tr->qpair->ctrlr,
- "nvme_payload_map err %d\n", error);
+ nvme_printf(qpair->ctrlr,
+ "payload DMA mapping failed with error %d\n", error);
+ mtx_unlock(&qpair->lock);
+ nvme_qpair_manual_complete_tracker(tr, NVME_SCT_GENERIC,
+ NVME_SC_DATA_TRANSFER_ERROR, DO_NOT_RETRY, ERROR_PRINT_ALL);
+ mtx_lock(&qpair->lock);
return;
}
@@ -1137,7 +1136,6 @@
_nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req)
{
struct nvme_tracker *tr;
- int err = 0;
bool is_admin = qpair == &qpair->ctrlr->adminq;
mtx_assert(&qpair->lock, MA_OWNED);
@@ -1180,6 +1178,7 @@
TAILQ_INSERT_TAIL(&qpair->outstanding_tr, tr, tailq);
tr->deadline = SBT_MAX;
tr->req = req;
+ req->cmd.cid = qpair->cid_base + tr->cid;
if (!req->payload_valid) {
nvme_qpair_submit_tracker(tr->qpair, tr);
@@ -1191,23 +1190,9 @@
* nvme_qpair_submit_tracker (we call it above directly
* when there's no map to load).
*/
- err = bus_dmamap_load_mem(tr->qpair->dma_tag_payload,
- tr->payload_dma_map, &req->payload, nvme_payload_map, tr, 0);
- if (err != 0) {
- /*
- * The dmamap operation failed, so we manually fail the
- * tracker here with DATA_TRANSFER_ERROR status.
- *
- * nvme_qpair_manual_complete_tracker must not be called
- * with the qpair lock held.
- */
- nvme_printf(qpair->ctrlr,
- "bus_dmamap_load_mem returned 0x%x!\n", err);
- mtx_unlock(&qpair->lock);
- nvme_qpair_manual_complete_tracker(tr, NVME_SCT_GENERIC,
- NVME_SC_DATA_TRANSFER_ERROR, DO_NOT_RETRY, ERROR_PRINT_ALL);
- mtx_lock(&qpair->lock);
- }
+ (void)bus_dmamap_load_mem(tr->qpair->dma_tag_payload,
+ tr->payload_dma_map, &req->payload, nvme_payload_map, tr,
+ BUS_DMA_NOWAIT);
}
void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 9, 9:04 AM (10 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37999602
Default Alt Text
D59151.1794215083.diff (2 KB)
Attached To
Mode
D59151: nvme: complete requests when payload DMA mapping fails
Attached
Detach File
Event Timeline