[PATCH v2] nvme-rdma: Use mr pool

Sagi Grimberg sagi at grimberg.me
Mon Nov 20 03:32:49 PST 2017


>> @@ -495,8 +457,26 @@ static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue)
>>   		goto out_destroy_qp;
>>   	}
>>   
>> +	if (idx == 0)
>> +		queue->ctrl->max_fr_pages = min_t(u32, NVME_RDMA_MAX_SEGMENTS,
>> +				ibdev->attrs.max_fast_reg_page_list_len);
>> +
> 
> Hmm.  Why is this code moved here from nvme_rdma_configure_admin_queue?
> I really don't like per-controller initialization in per-queue functions
> but if there is no good way around it it needs a very good explanation,
> and that explanation should be in a comment place next to the code.

I agree, I'd even prefer it calculated here locally for the mr pool and
set it in its original place (perhaps add a simple helper for it).

>> +	req->mr = ib_mr_pool_get(queue->qp, &queue->qp->rdma_mrs);
>> +	if (unlikely(!req->mr))
>> +		return -EAGAIN;
>> +
> 
> Shouldn't the MR pool be sized that this always succeeds?  If so a
> WARN_ON_ONCE() here might be useful.

Agree.



More information about the Linux-nvme mailing list