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