From 41cd5ff4fb0f693c106ed1ce1c58be5921831428 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Mon, 28 Jan 2019 10:10:45 -0700 Subject: [PATCH] rdma: fix max_read_depth_definition. max_read_depth should be based on max_qp_init_read_atomic, or the maximum number of read values that the initiator will accept as outstanding. The device attributes object contains values for both the initiator (remote side) and the target (local side). All attributes with the name init in them are meant to correspond to the initiator. The qp_read_atomic value represents the number of reads and atomic operations that can have this device as the target. qp_init_read_atomic represents how many read operations the initiator has said that we can have outstanding that have the initiator's rdma device as the target. Since this number represents how many outstanding reads we will send to the initiator at once, we should use the qp_init_read_atomic value. Change-Id: Iacc044e8321080de8accd9128ac3777bbb948afc Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/442409 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/nvmf/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 4b8ca0227b..9b4063abcb 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -1075,7 +1075,7 @@ nvmf_rdma_connect(struct spdk_nvmf_transport *transport, struct rdma_cm_event *e "Local NIC Max Send/Recv Queue Depth: %d Max Read/Write Queue Depth: %d\n", port->device->attr.max_qp_wr, port->device->attr.max_qp_rd_atom); max_queue_depth = spdk_min(max_queue_depth, port->device->attr.max_qp_wr); - max_read_depth = spdk_min(max_read_depth, port->device->attr.max_qp_rd_atom); + max_read_depth = spdk_min(max_read_depth, port->device->attr.max_qp_init_rd_atom); /* Next check the remote NIC's hardware limitations */ SPDK_DEBUGLOG(SPDK_LOG_RDMA,