int index;\r
volatile LONG refcnt;\r
struct rdma_cm_id **req_list;\r
+ uint8_t initiator_depth;\r
+ uint8_t responder_resources;\r
};\r
\r
struct cma_device\r
}\r
\r
static int ucma_valid_param(struct cma_id_private *id_priv,\r
- struct rdma_conn_param *conn_param)\r
+ struct rdma_conn_param *param)\r
{\r
if (id_priv->id.ps != RDMA_PS_TCP) {\r
return 0;\r
}\r
\r
- if ((conn_param->responder_resources > id_priv->cma_dev->max_responder_resources) ||\r
- (conn_param->initiator_depth > id_priv->cma_dev->max_initiator_depth)) {\r
- return -1;\r
+ if ((param->responder_resources != RDMA_MAX_RESP_RES) &&\r
+ (param->responder_resources > id_priv->cma_dev->max_responder_resources)) {\r
+ return rdma_seterrno(EINVAL);\r
+ \r
+ if ((param->initiator_depth != RDMA_MAX_INIT_DEPTH) &&\r
+ (param->initiator_depth > id_priv->cma_dev->max_initiator_depth)) {\r
+ return rdma_seterrno(EINVAL);\r
}\r
\r
return 0;\r
return ret;\r
}\r
\r
+ id_priv->responder_resources = min(conn_param->responder_resources,\r
+ id_priv->cma_dev->responder_resources);\r
+ id_priv->initiator_depth = min(conn_param->initiator_depth,\r
+ id_priv->cma_dev->initiator_depth);\r
+\r
RtlZeroMemory(&attr, sizeof attr);\r
- attr.ResponderResources = conn_param->responder_resources;\r
- attr.InitiatorDepth = conn_param->initiator_depth;\r
+ attr.ResponderResources = id_priv->responder_resources;\r
+ attr.InitiatorDepth = id_priv->initiator_depth;\r
attr.RetryCount = conn_param->retry_count;\r
attr.RnrRetryCount = conn_param->rnr_retry_count;\r
if ((attr.DataLength = conn_param->private_data_len)) {\r
return ret;\r
}\r
\r
+ if (conn_param->initiator_depth == RDMA_MAX_INIT_DEPTH) {\r
+ id_priv->initiator_depth = min(id_priv->initiator_depth,\r
+ id_priv->cma_dev->max_initiator_depth);\r
+ } else {\r
+ id_priv->initiator_depth = conn_param->initiator_depth;\r
+ }\r
+ if (conn_param->responder_resources == RDMA_MAX_RESP_RES) {\r
+ id_priv->responder_resources = min(id_priv->responder_resources,\r
+ id_priv->cma_dev->max_responder_resources);\r
+ } else {\r
+ id_priv->responder_resources = conn_param->responder_resources;\r
+ }\r
+\r
RtlZeroMemory(&attr, sizeof attr);\r
- attr.ResponderResources = conn_param->responder_resources;\r
- attr.InitiatorDepth = conn_param->initiator_depth;\r
+ attr.ResponderResources = id_priv->responder_resources;\r
+ attr.InitiatorDepth = id_priv->initiator_depth;\r
attr.RetryCount = conn_param->retry_count;\r
attr.RnrRetryCount = conn_param->rnr_retry_count;\r
if ((attr.DataLength = conn_param->private_data_len)) {\r
event->event.event = RDMA_CM_EVENT_CONNECT_REQUEST;\r
id_priv->state = cma_passive_connect;\r
event->event.listen_id = &listen->id;\r
+ id_priv->initiator_depth = event->event.param.conn.initiator_depth;\r
+ id_priv->responder_resources = event->event.param.conn.responder_resources;\r
\r
return 0;\r
\r