[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/9] hw/nvme: only set command abort requested when cancelled due
From: |
Klaus Jensen |
Subject: |
[PATCH 7/9] hw/nvme: only set command abort requested when cancelled due to Abort |
Date: |
Mon, 16 Dec 2024 13:53:08 +0100 |
From: Klaus Jensen <k.jensen@samsung.com>
The Command Abort Requested status code should only be set if the
command was explicitly cancelled due to an Abort command. Or, in the
case the cancel was due to Submission Queue deletion, set the status
code to Command Aborted due to SQ Deletion.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/nvme/ctrl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index
8d3f62c40ac14fdc4bdc650e272023558cbbae0f..5b1bac020f049cc2a2f869b12e1d2a7e13cef316
100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -1777,10 +1777,6 @@ static void nvme_aio_err(NvmeRequest *req, int ret)
break;
}
- if (ret == -ECANCELED) {
- status = NVME_CMD_ABORT_REQ;
- }
-
trace_pci_nvme_err_aio(nvme_cid(req), strerror(-ret), status);
error_setg_errno(&local_err, -ret, "aio failed");
@@ -4821,6 +4817,7 @@ static uint16_t nvme_del_sq(NvmeCtrl *n, NvmeRequest *req)
while (!QTAILQ_EMPTY(&sq->out_req_list)) {
r = QTAILQ_FIRST(&sq->out_req_list);
assert(r->aiocb);
+ r->status = NVME_CMD_ABORT_SQ_DEL;
blk_aio_cancel(r->aiocb);
}
@@ -6073,6 +6070,7 @@ static uint16_t nvme_abort(NvmeCtrl *n, NvmeRequest *req)
QTAILQ_FOREACH_SAFE(r, &sq->out_req_list, entry, next) {
if (r->cqe.cid == cid) {
if (r->aiocb) {
+ r->status = NVME_CMD_ABORT_REQ;
blk_aio_cancel_async(r->aiocb);
}
break;
--
2.45.2
- [PATCH 0/9] hw/nvme: refactor/cleanup, Klaus Jensen, 2024/12/16
- [PATCH 2/9] hw/nvme: make oacs dynamic, Klaus Jensen, 2024/12/16
- [PATCH 1/9] hw/nvme: always initialize a subsystem, Klaus Jensen, 2024/12/16
- [PATCH 5/9] hw/nvme: be compliant wrt. dsm processing limits, Klaus Jensen, 2024/12/16
- [PATCH 4/9] nvme: fix iocs status code values, Klaus Jensen, 2024/12/16
- [PATCH 3/9] hw/nvme: add knob for doorbell buffer config support, Klaus Jensen, 2024/12/16
- [PATCH 9/9] hw/nvme: remove nvme_aio_err(), Klaus Jensen, 2024/12/16
- [PATCH 6/9] hw/nvme: rework csi handling, Klaus Jensen, 2024/12/16
- [PATCH 7/9] hw/nvme: only set command abort requested when cancelled due to Abort,
Klaus Jensen <=
- [PATCH 8/9] hw/nvme: set error status code explicitly for misc commands, Klaus Jensen, 2024/12/16