Skip to contentSkip to conversation

nvme-rdma: unconditionally recycle the request mr

PATCH New Sagi Grimberg 2 participants 2 messages Jul 5, 2017 NVMe

lore
Share & tools
lore

Sagi Grimberg

author maintainer
#0 lore raw

PATCH 1/1 nvme-rdma: unconditionally recycle the request mr

When our RDMA queue-pair is torn down with high load of I/O traffic, we have no way of knowing if the memory region was actually registered by the reg_mr work request as it completion flushes with error (hw might have done it or not).

So in order to not deal with all this uncertanty, we simply recycle the MR in reinit_request.

Signed-off-by Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/host/rdma.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/nvme/host/rdma.c +0 -3
index 96f361674b2a..98aecab58782 100644
@@ -276,9 +276,6 @@ static int nvme_rdma_reinit_request(void *data, struct request *rq)
 	struct nvme_rdma_request *req = blk_mq_rq_to_pdu(rq);
 	int ret = 0;
 
-	if (!req->mr->need_inval)
-		goto out;
-
 	ib_dereg_mr(req->mr);
 
 	req->mr = ib_alloc_mr(dev->pd, IB_MR_TYPE_MEM_REG,
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 nvme-rdma: unconditionally recycle the request mr

Looks good,

Reviewed-by Christoph Hellwig <hch at lst.de>

(and btw ib_dereg_mr seems horribly misnamed, it really should be ib_free_mr)