summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvme/nvme_qpair.c
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2013-03-26 20:32:57 +0000
committerjimharris <jimharris@FreeBSD.org>2013-03-26 20:32:57 +0000
commitb7f7338cc5bd9736b236409a3bda233d5d88d2b3 (patch)
treeddf856a18e441fadb2f1063d94c3d88320d8e9e6 /sys/dev/nvme/nvme_qpair.c
parent8712b8a346f61cb453edaadb0db8bf926c7b8f39 (diff)
downloadFreeBSD-src-b7f7338cc5bd9736b236409a3bda233d5d88d2b3.zip
FreeBSD-src-b7f7338cc5bd9736b236409a3bda233d5d88d2b3.tar.gz
By default, always escalate to controller reset when an I/O times out.
While aborts are typically cleaner than a full controller reset, many times an I/O timeout indicates other controller-level issues where aborts may not work. NVMe drivers for other operating systems are also defaulting to controller reset rather than aborts for timed out I/O. Sponsored by: Intel Reviewed by: carl
Diffstat (limited to 'sys/dev/nvme/nvme_qpair.c')
-rw-r--r--sys/dev/nvme/nvme_qpair.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c
index 9783db9..602171f 100644
--- a/sys/dev/nvme/nvme_qpair.c
+++ b/sys/dev/nvme/nvme_qpair.c
@@ -460,21 +460,20 @@ nvme_timeout(void *arg)
struct nvme_controller *ctrlr = qpair->ctrlr;
union csts_register csts;
+ /* Read csts to get value of cfs - controller fatal status. */
csts.raw = nvme_mmio_read_4(ctrlr, csts);
- if (csts.bits.cfs == 1) {
+ device_printf(ctrlr->dev, "i/o timeout, csts.cfs=%d\n", csts.bits.cfs);
+ nvme_dump_command(&tr->req->cmd);
+
+ if (ctrlr->enable_aborts && csts.bits.cfs == 0) {
/*
- * The controller is reporting fatal status. Don't bother
- * trying to abort the timed out command - proceed
- * immediately to a controller-level reset.
+ * If aborts are enabled, only use them if the controller is
+ * not reporting fatal status.
*/
- device_printf(ctrlr->dev,
- "controller reports fatal status, resetting...\n");
+ nvme_ctrlr_cmd_abort(ctrlr, tr->cid, qpair->id,
+ nvme_abort_complete, tr);
+ } else
nvme_ctrlr_reset(ctrlr);
- return;
- }
-
- nvme_ctrlr_cmd_abort(ctrlr, tr->cid, qpair->id,
- nvme_abort_complete, tr);
}
void
OpenPOWER on IntegriCloud