Commit 2b867217 authored by Alex Michon's avatar Alex Michon Committed by Jim Harris
Browse files

nvme/rdma: Prevent submitting new recv WR when disconnecting



If we are in a disconnection process, we may never get WC for these
recv WR and we will have to wait the entire disconnection timeout
before deciding to destroy the qpair.

Change-Id: Ifdd5ed7866dec4c3e8b37b45aea2c95293c0d994
Signed-off-by: default avatarAlex Michon <amichon@kalrayinc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25415


Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
parent e2dfdf06
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2647,6 +2647,12 @@ nvme_rdma_request_ready(struct nvme_rdma_qpair *rqpair, struct spdk_nvme_rdma_re
		nvme_rdma_req_complete(rdma_req, &rdma_rsp->cpl, true);
	}

	if (spdk_unlikely(rqpair->state >= NVME_RDMA_QPAIR_STATE_EXITING && !rqpair->srq)) {
		/* Skip posting back recv wr if we are in a disconnection process. We may never get
		 * a WC and we may end up stuck in LINGERING state until the timeout. */
		return;
	}

	assert(rqpair->rsps->current_num_recvs < rqpair->rsps->num_entries);
	rqpair->rsps->current_num_recvs++;