[PATCH 10/10] nvmet-rdma: set max_queue_size for RDMA transport

Sagi Grimberg sagi at grimberg.me
Mon Jan 1 01:39:23 PST 2024


> A new port configuration was added to set max_queue_size. Clamp user
> configuration to RDMA transport limits.
> 
> Increase the maximal queue size of RDMA controllers from 128 to 256
> (the default size stays 128 same as before).
> 
> Reviewed-by: Israel Rukshin <israelr at nvidia.com>
> Signed-off-by: Max Gurtovoy <mgurtovoy at nvidia.com>
> ---
>   drivers/nvme/target/rdma.c | 8 ++++++++
>   include/linux/nvme-rdma.h  | 3 ++-
>   2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
> index f298295c0b0f..3a3686efe008 100644
> --- a/drivers/nvme/target/rdma.c
> +++ b/drivers/nvme/target/rdma.c
> @@ -1943,6 +1943,14 @@ static int nvmet_rdma_add_port(struct nvmet_port *nport)
>   		nport->inline_data_size = NVMET_RDMA_MAX_INLINE_DATA_SIZE;
>   	}
>   
> +	if (nport->max_queue_size < 0) {
> +		nport->max_queue_size = NVME_RDMA_DEFAULT_QUEUE_SIZE;
> +	} else if (nport->max_queue_size > NVME_RDMA_MAX_QUEUE_SIZE) {
> +		pr_warn("max_queue_size %u is too large, reducing to %u\n",
> +			nport->max_queue_size, NVME_RDMA_MAX_QUEUE_SIZE);
> +		nport->max_queue_size = NVME_RDMA_MAX_QUEUE_SIZE;
> +	}
> +

Not sure its a good idea to tie the host and nvmet default values
together.



More information about the Linux-nvme mailing list