[RFC PATCH V2 2/2] nvme: rdma: use ib_device's max_qp_wr to limit sqsize
Max Gurtovoy
mgurtovoy at nvidia.com
Wed Dec 20 02:52:17 PST 2023
Hi Guixin Liu,
On 20/12/2023 11:17, Sagi Grimberg wrote:
>
>
> On 12/19/23 09:32, Guixin Liu wrote:
>> Currently, the host is limited to creating queues with a depth of
>> 128. To enable larger queue sizes, constrain the sqsize based on
>> the ib_device's max_qp_wr capability.
>> In addition, the queue size is restricted between 16 and 1024 in
>> nvmf_parse_options(), so the final value of queue depth will not
>> biger than 1024.
can you please explain why this patch series is needed ?
what is the added value you see with it ?
>>
>> And also remove unused NVME_RDMA_MAX_QUEUE_SIZE macro.
>>
>> Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>
>> ---
>> drivers/nvme/host/rdma.c | 14 ++++++++------
>> include/linux/nvme-rdma.h | 2 --
>> 2 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
>> index 81e2621..982f3e4 100644
>> --- a/drivers/nvme/host/rdma.c
>> +++ b/drivers/nvme/host/rdma.c
>> @@ -489,8 +489,7 @@ static int nvme_rdma_create_cq(struct ib_device
>> *ibdev,
>> static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue)
>> {
>> struct ib_device *ibdev;
>> - const int send_wr_factor = 3; /* MR, SEND, INV */
>> - const int cq_factor = send_wr_factor + 1; /* + RECV */
>> + const int cq_factor = NVME_RDMA_SEND_WR_FACTOR + 1; /* + RECV */
>> int ret, pages_per_mr;
>> queue->device = nvme_rdma_find_get_device(queue->cm_id);
>> @@ -508,7 +507,7 @@ static int nvme_rdma_create_queue_ib(struct
>> nvme_rdma_queue *queue)
>> if (ret)
>> goto out_put_dev;
>> - ret = nvme_rdma_create_qp(queue, send_wr_factor);
>> + ret = nvme_rdma_create_qp(queue, NVME_RDMA_SEND_WR_FACTOR);
>> if (ret)
>> goto out_destroy_ib_cq;
>> @@ -1006,6 +1005,7 @@ static int nvme_rdma_setup_ctrl(struct
>> nvme_rdma_ctrl *ctrl, bool new)
>> {
>> int ret;
>> bool changed;
>> + int ib_max_qsize;
>> ret = nvme_rdma_configure_admin_queue(ctrl, new);
>> if (ret)
>> @@ -1030,11 +1030,13 @@ static int nvme_rdma_setup_ctrl(struct
>> nvme_rdma_ctrl *ctrl, bool new)
>> ctrl->ctrl.opts->queue_size, ctrl->ctrl.sqsize + 1);
>> }
>> - if (ctrl->ctrl.sqsize + 1 > NVME_RDMA_MAX_QUEUE_SIZE) {
>> + ib_max_qsize = ctrl->device->dev->attrs.max_qp_wr /
>> + (NVME_RDMA_SEND_WR_FACTOR + 1);
>
> rdma_dev_max_qsize is a better name.
>
> Also, you can drop the RFC for the next submission.
>
Sagi,
I don't feel comfortable with these patches.
First I would like to understand the need for it.
Second, the QP WR can be constructed from one or more WQEs and the WQEs
can be constructed from one or more WQEBBs. The max_qp_wr doesn't take
it into account.
More information about the Linux-nvme
mailing list