Commit ab839831 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

nvme_rdma: Remove workaround for Soft RoCE's bug from cq_process_completions()



We do not support Soft RoCE anymore. Remove a workaround for Soft RoCE's
bug that we amy receive a completion without error status after qpair is
disconnected/destroyed. Then add a assert to check if rdma_req->req is
not NULL. This will simplify the code and the following patches.

Signed-off-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I80c349053adc0f79679eaf8a5d7265d555d3c2b0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14909


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 1439f9c7
Loading
Loading
Loading
Loading
+4 −26
Original line number Diff line number Diff line
@@ -2435,13 +2435,6 @@ nvme_rdma_log_wc_status(struct nvme_rdma_qpair *rqpair, struct ibv_wc *wc)
	}
}

static inline bool
nvme_rdma_is_rxe_device(struct ibv_device_attr *dev_attr)
{
	return dev_attr->vendor_id == SPDK_RDMA_RXE_VENDOR_ID_OLD ||
	       dev_attr->vendor_id == SPDK_RDMA_RXE_VENDOR_ID_NEW;
}

static int
nvme_rdma_cq_process_completions(struct ibv_cq *cq, uint32_t batch_size,
				 struct nvme_rdma_poller *poller,
@@ -2531,25 +2524,10 @@ nvme_rdma_cq_process_completions(struct ibv_cq *cq, uint32_t batch_size,
				continue;
			}

			if (spdk_unlikely(rdma_req->req == NULL)) {
				struct ibv_device_attr dev_attr;
				int query_status;

				/* Bug in Soft Roce - we may receive a completion without error status when qpair is disconnected/destroyed.
				 * As sanity check - log an error if we use a real HW (it should never happen) */
				query_status = ibv_query_device(cq->context, &dev_attr);
				if (query_status == 0) {
					if (!nvme_rdma_is_rxe_device(&dev_attr)) {
						SPDK_ERRLOG("Received malformed completion: request 0x%"PRIx64" type %d\n", wc->wr_id,
							    rdma_wr->type);
						assert(0);
					}
				} else {
					SPDK_ERRLOG("Failed to query ib device\n");
					assert(0);
				}
				continue;
			}
			/* We do not support Soft Roce anymore. Other than Soft Roce's bug, we should not
			 * receive a completion without error status after qpair is disconnected/destroyed.
			 */
			assert(rdma_req->req != NULL);

			rqpair = nvme_rdma_qpair(rdma_req->req->qpair);
			rdma_req->completion_flags |= NVME_RDMA_SEND_COMPLETED;