Skip to content

Commit f096ba3

Browse files
mgurtovoykeithbusch
authored andcommitted
nvmet-rdma: set max_queue_size for RDMA transport
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: Christoph Hellwig <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Israel Rukshin <[email protected]> Signed-off-by: Max Gurtovoy <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent ca2b221 commit f096ba3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

drivers/nvme/target/rdma.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,14 @@ static int nvmet_rdma_add_port(struct nvmet_port *nport)
19561956
nport->inline_data_size = NVMET_RDMA_MAX_INLINE_DATA_SIZE;
19571957
}
19581958

1959+
if (nport->max_queue_size < 0) {
1960+
nport->max_queue_size = NVME_RDMA_DEFAULT_QUEUE_SIZE;
1961+
} else if (nport->max_queue_size > NVME_RDMA_MAX_QUEUE_SIZE) {
1962+
pr_warn("max_queue_size %u is too large, reducing to %u\n",
1963+
nport->max_queue_size, NVME_RDMA_MAX_QUEUE_SIZE);
1964+
nport->max_queue_size = NVME_RDMA_MAX_QUEUE_SIZE;
1965+
}
1966+
19591967
ret = inet_pton_with_scope(&init_net, af, nport->disc_addr.traddr,
19601968
nport->disc_addr.trsvcid, &port->addr);
19611969
if (ret) {

include/linux/nvme-rdma.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
#define NVME_RDMA_IP_PORT 4420
1010

11-
#define NVME_RDMA_MAX_QUEUE_SIZE 128
11+
#define NVME_RDMA_MAX_QUEUE_SIZE 256
1212
#define NVME_RDMA_MAX_METADATA_QUEUE_SIZE 128
13+
#define NVME_RDMA_DEFAULT_QUEUE_SIZE 128
1314

1415
enum nvme_rdma_cm_fmt {
1516
NVME_RDMA_CM_FMT_1_0 = 0x0,

0 commit comments

Comments
 (0)