From 745a54e42021e6599a019a1ba90068244296d68d Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Fri, 24 Aug 2018 10:20:20 -0700 Subject: [PATCH] nvmf/rdma: Handle successful requests on an errored queue pair Due to polling order, a request may have completed its previous operation successfully, but the queue pair may be in an error state. In this case, move the request directly to the completed state to release resources. Change-Id: Ic0a5ba036af246b1b6155169cf9682e943b73120 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/423412 Chandler-Test-Pool: SPDK Automated Test System Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Reviewed-by: Seth Howell Reviewed-by: Jim Harris --- lib/nvmf/rdma.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 433107ddb..7cdcdd464 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -1243,6 +1243,12 @@ spdk_nvmf_rdma_request_process(struct spdk_nvmf_rdma_transport *rtransport, assert(rdma_req->state != RDMA_REQUEST_STATE_FREE); + /* If the queue pair is in an error state, force the request to the completed state + * to release resources. */ + if (rqpair->ibv_attr.qp_state == IBV_QPS_ERR) { + rdma_req->state = RDMA_REQUEST_STATE_COMPLETED; + } + /* The loop here is to allow for several back-to-back state changes. */ do { prev_state = rdma_req->state;