aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-06-19 06:54:19 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2014-09-15 17:02:55 -0400
commit1a92e17e39b9a5d476e0a7aa52280e76321834ee (patch)
tree71283d2eb8964a32803ab5fa932bc367d9c70ef3
parent38a8316b5d80ddee071d493bae567185c07de359 (diff)
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: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 9e21747acce6..da8ff124762a 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -592,10 +592,6 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
592 592
593 cma_id->context = isert_conn; 593 cma_id->context = isert_conn;
594 isert_conn->conn_cm_id = cma_id; 594 isert_conn->conn_cm_id = cma_id;
595 isert_conn->responder_resources = event->param.conn.responder_resources;
596 isert_conn->initiator_depth = event->param.conn.initiator_depth;
597 pr_debug("Using responder_resources: %u initiator_depth: %u\n",
598 isert_conn->responder_resources, isert_conn->initiator_depth);
599 595
600 isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + 596 isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN +
601 ISER_RX_LOGIN_SIZE, GFP_KERNEL); 597 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 goto out_rsp_dma_map; 638 goto out_rsp_dma_map;
643 } 639 }
644 640
641 /* Set max inflight RDMA READ requests */
642 isert_conn->initiator_depth = min_t(u8,
643 event->param.conn.initiator_depth,
644 device->dev_attr.max_qp_init_rd_atom);
645 pr_debug("Using initiator_depth: %u\n", isert_conn->initiator_depth);
646
645 isert_conn->conn_device = device; 647 isert_conn->conn_device = device;
646 isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); 648 isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device);
647 if (IS_ERR(isert_conn->conn_pd)) { 649 if (IS_ERR(isert_conn->conn_pd)) {
@@ -3067,7 +3069,6 @@ isert_rdma_accept(struct isert_conn *isert_conn)
3067 int ret; 3069 int ret;
3068 3070
3069 memset(&cp, 0, sizeof(struct rdma_conn_param)); 3071 memset(&cp, 0, sizeof(struct rdma_conn_param));
3070 cp.responder_resources = isert_conn->responder_resources;
3071 cp.initiator_depth = isert_conn->initiator_depth; 3072 cp.initiator_depth = isert_conn->initiator_depth;
3072 cp.retry_count = 7; 3073 cp.retry_count = 7;
3073 cp.rnr_retry_count = 7; 3074 cp.rnr_retry_count = 7;