diff options
author | jimharris <jimharris@FreeBSD.org> | 2013-03-26 18:23:35 +0000 |
---|---|---|
committer | jimharris <jimharris@FreeBSD.org> | 2013-03-26 18:23:35 +0000 |
commit | 34e3d4c73e2de964686848587d24876fa9299321 (patch) | |
tree | 43a4a97ce3faa5f715c203c7c8c2f92b8874631e /sys/dev/nvme/nvme_qpair.c | |
parent | 1ba7ad0dee259570e2b2e97e68b3408f481a82b1 (diff) | |
download | FreeBSD-src-34e3d4c73e2de964686848587d24876fa9299321.zip FreeBSD-src-34e3d4c73e2de964686848587d24876fa9299321.tar.gz |
Add support for ABORT commands, including issuing these commands when
an I/O times out.
Also ensure that we retry commands that are aborted due to a timeout.
Sponsored by: Intel
Diffstat (limited to 'sys/dev/nvme/nvme_qpair.c')
-rw-r--r-- | sys/dev/nvme/nvme_qpair.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 7fafb7c..6954830 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -49,6 +49,8 @@ nvme_completion_check_retry(const struct nvme_completion *cpl) switch (cpl->sf_sct) { case NVME_SCT_GENERIC: switch (cpl->sf_sc) { + case NVME_SC_ABORTED_BY_REQUEST: + return (1); case NVME_SC_NAMESPACE_NOT_READY: if (cpl->sf_dnr) return (0); @@ -60,7 +62,6 @@ nvme_completion_check_retry(const struct nvme_completion *cpl) case NVME_SC_DATA_TRANSFER_ERROR: case NVME_SC_ABORTED_POWER_LOSS: case NVME_SC_INTERNAL_DEVICE_ERROR: - case NVME_SC_ABORTED_BY_REQUEST: case NVME_SC_ABORTED_SQ_DELETION: case NVME_SC_ABORTED_FAILED_FUSED: case NVME_SC_ABORTED_MISSING_FUSED: @@ -378,10 +379,10 @@ nvme_io_qpair_destroy(struct nvme_qpair *qpair) static void nvme_timeout(void *arg) { - /* - * TODO: Add explicit abort operation here, once nvme(4) supports - * abort commands. - */ + struct nvme_tracker *tr = arg; + + nvme_ctrlr_cmd_abort(tr->qpair->ctrlr, tr->cid, tr->qpair->id, + NULL, NULL); } void |