nvmf/vfio-user: reset the request internal fields in the completion callback

Previously we reset them when getting a new request, but it's more
reasonable in the completion path.

Change-Id: I3dab35ce471d2a5bbd37576540d30a09dcf93410
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7434
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Changpeng Liu 2021-04-15 21:28:56 +08:00 committed by Jim Harris
parent c7c69c7cc1
commit 7abbad3ccf

View File

@ -2065,6 +2065,10 @@ nvmf_vfio_user_poll_group_remove(struct spdk_nvmf_transport_poll_group *group,
static void
_nvmf_vfio_user_req_free(struct nvmf_vfio_user_qpair *vu_qpair, struct nvmf_vfio_user_req *vu_req)
{
memset(&vu_req->cmd, 0, sizeof(vu_req->cmd));
memset(&vu_req->rsp, 0, sizeof(vu_req->rsp));
vu_req->iovcnt = 0;
TAILQ_INSERT_TAIL(&vu_qpair->reqs, vu_req, link);
}
@ -2137,9 +2141,6 @@ get_nvmf_vfio_user_req(struct nvmf_vfio_user_qpair *qpair)
req = TAILQ_FIRST(&qpair->reqs);
TAILQ_REMOVE(&qpair->reqs, req, link);
memset(&req->cmd, 0, sizeof(req->cmd));
memset(&req->rsp, 0, sizeof(req->rsp));
req->iovcnt = 0;
return req;
}