nvmf/vfio-user: Fix abort request bug

One simple fix for nvmf_vfio_user_qpair_abort_request().
Current implementation mixed up request of abort cmd and the request
to abort, which cause problems.

Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: Ia0db9aa738e372789fc502ef877fd1c841c0a2e3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11711
Reviewed-by: John Levon <levon@movementarian.org>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Rui Chang 2022-02-22 14:39:05 +08:00 committed by Tomasz Zawadzki
parent 06fdd44c5d
commit 0270fc322f

View File

@ -4245,17 +4245,18 @@ nvmf_vfio_user_qpair_abort_request(struct spdk_nvmf_qpair *qpair,
struct spdk_nvmf_request *req)
{
struct spdk_nvmf_request *req_to_abort = NULL;
struct spdk_nvmf_request *temp_req = NULL;
uint16_t cid;
cid = req->cmd->nvme_cmd.cdw10_bits.abort.cid;
TAILQ_FOREACH(req, &qpair->outstanding, link) {
TAILQ_FOREACH(temp_req, &qpair->outstanding, link) {
struct nvmf_vfio_user_req *vu_req;
vu_req = SPDK_CONTAINEROF(req, struct nvmf_vfio_user_req, req);
vu_req = SPDK_CONTAINEROF(temp_req, struct nvmf_vfio_user_req, req);
if (vu_req->state == VFIO_USER_REQUEST_STATE_EXECUTING && vu_req->cmd.cid == cid) {
req_to_abort = req;
req_to_abort = temp_req;
break;
}
}