From ab839831f15b7efe546285d2a51dbb73b48101b4 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Tue, 11 Oct 2022 12:05:43 +0900 Subject: [PATCH] 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: Shuhei Matsumoto Change-Id: I80c349053adc0f79679eaf8a5d7265d555d3c2b0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14909 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk Reviewed-by: Ben Walker --- lib/nvme/nvme_rdma.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/lib/nvme/nvme_rdma.c b/lib/nvme/nvme_rdma.c index cbadd4170..968401d39 100644 --- a/lib/nvme/nvme_rdma.c +++ b/lib/nvme/nvme_rdma.c @@ -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;