nvmf/rdma: Remove rdmq_req if there is error or obtaining buf.

For the normal case, we can avoid re-adding it into
pending data buf list if there is no buffer.

Change-Id: I400e3c6c60bb1d1df13782faf2dd32ca2bd897a3
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/382402
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ziye Yang 2017-10-13 13:49:05 +08:00 committed by Jim Harris
parent f1c7998742
commit 847c1c3ad4

View File

@ -977,23 +977,22 @@ spdk_nvmf_rdma_request_process(struct spdk_nvmf_rdma_transport *rtransport,
break;
}
TAILQ_REMOVE(&rqpair->pending_data_buf_queue, rdma_req, link);
/* Try to get a data buffer */
rc = spdk_nvmf_rdma_request_parse_sgl(rtransport, device, rdma_req);
if (rc < 0) {
TAILQ_REMOVE(&rqpair->pending_data_buf_queue, rdma_req, link);
rsp->status.sc = SPDK_NVME_SC_INTERNAL_DEVICE_ERROR;
rdma_req->state = RDMA_REQUEST_STATE_READY_TO_COMPLETE;
break;
}
if (!rdma_req->req.data) {
/* No buffers available. Put this request back at the head of
* the queue. */
TAILQ_INSERT_HEAD(&rqpair->pending_data_buf_queue, rdma_req, link);
/* No buffers available. */
break;
}
TAILQ_REMOVE(&rqpair->pending_data_buf_queue, rdma_req, link);
/* If data is transferring from host to controller and the data didn't
* arrive using in capsule data, we need to do a transfer from the host.
*/