Commit 1a92e17e authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Nicholas Bellinger

Target/iser: Fix initiator_depth and responder_resources

The iser target is the RDMA requester and the iser initiator is the
RDMA responder. In order to determine the max inflight RDMA READ requests
to set on the QP (initiator_depth), it should take the min between the
initiator published initiator_depth and the max inflight rdma read
requests its local HCA support (max_qp_init_rd_atom).

The target will never handle incoming RDMA READ requests so no need to
set responder_resources.
Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 38a8316b
...@@ -592,10 +592,6 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) ...@@ -592,10 +592,6 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
cma_id->context = isert_conn; cma_id->context = isert_conn;
isert_conn->conn_cm_id = cma_id; isert_conn->conn_cm_id = cma_id;
isert_conn->responder_resources = event->param.conn.responder_resources;
isert_conn->initiator_depth = event->param.conn.initiator_depth;
pr_debug("Using responder_resources: %u initiator_depth: %u\n",
isert_conn->responder_resources, isert_conn->initiator_depth);
isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN +
ISER_RX_LOGIN_SIZE, GFP_KERNEL); ISER_RX_LOGIN_SIZE, GFP_KERNEL);
...@@ -642,6 +638,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) ...@@ -642,6 +638,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
goto out_rsp_dma_map; goto out_rsp_dma_map;
} }
/* Set max inflight RDMA READ requests */
isert_conn->initiator_depth = min_t(u8,
event->param.conn.initiator_depth,
device->dev_attr.max_qp_init_rd_atom);
pr_debug("Using initiator_depth: %u\n", isert_conn->initiator_depth);
isert_conn->conn_device = device; isert_conn->conn_device = device;
isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device);
if (IS_ERR(isert_conn->conn_pd)) { if (IS_ERR(isert_conn->conn_pd)) {
...@@ -3067,7 +3069,6 @@ isert_rdma_accept(struct isert_conn *isert_conn) ...@@ -3067,7 +3069,6 @@ isert_rdma_accept(struct isert_conn *isert_conn)
int ret; int ret;
memset(&cp, 0, sizeof(struct rdma_conn_param)); memset(&cp, 0, sizeof(struct rdma_conn_param));
cp.responder_resources = isert_conn->responder_resources;
cp.initiator_depth = isert_conn->initiator_depth; cp.initiator_depth = isert_conn->initiator_depth;
cp.retry_count = 7; cp.retry_count = 7;
cp.rnr_retry_count = 7; cp.rnr_retry_count = 7;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment