diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/cma.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 0751697ef984..5a80e74731c8 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -1262,6 +1262,7 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id, | |||
1262 | struct net_device *dev = NULL; | 1262 | struct net_device *dev = NULL; |
1263 | struct rdma_cm_event event; | 1263 | struct rdma_cm_event event; |
1264 | int ret; | 1264 | int ret; |
1265 | struct ib_device_attr attr; | ||
1265 | 1266 | ||
1266 | listen_id = cm_id->context; | 1267 | listen_id = cm_id->context; |
1267 | if (cma_disable_remove(listen_id, CMA_LISTEN)) | 1268 | if (cma_disable_remove(listen_id, CMA_LISTEN)) |
@@ -1311,10 +1312,19 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id, | |||
1311 | sin = (struct sockaddr_in *) &new_cm_id->route.addr.dst_addr; | 1312 | sin = (struct sockaddr_in *) &new_cm_id->route.addr.dst_addr; |
1312 | *sin = iw_event->remote_addr; | 1313 | *sin = iw_event->remote_addr; |
1313 | 1314 | ||
1315 | ret = ib_query_device(conn_id->id.device, &attr); | ||
1316 | if (ret) { | ||
1317 | cma_enable_remove(conn_id); | ||
1318 | rdma_destroy_id(new_cm_id); | ||
1319 | goto out; | ||
1320 | } | ||
1321 | |||
1314 | memset(&event, 0, sizeof event); | 1322 | memset(&event, 0, sizeof event); |
1315 | event.event = RDMA_CM_EVENT_CONNECT_REQUEST; | 1323 | event.event = RDMA_CM_EVENT_CONNECT_REQUEST; |
1316 | event.param.conn.private_data = iw_event->private_data; | 1324 | event.param.conn.private_data = iw_event->private_data; |
1317 | event.param.conn.private_data_len = iw_event->private_data_len; | 1325 | event.param.conn.private_data_len = iw_event->private_data_len; |
1326 | event.param.conn.initiator_depth = attr.max_qp_init_rd_atom; | ||
1327 | event.param.conn.responder_resources = attr.max_qp_rd_atom; | ||
1318 | ret = conn_id->id.event_handler(&conn_id->id, &event); | 1328 | ret = conn_id->id.event_handler(&conn_id->id, &event); |
1319 | if (ret) { | 1329 | if (ret) { |
1320 | /* User wants to destroy the CM ID */ | 1330 | /* User wants to destroy the CM ID */ |