Lines Matching refs:cm_dev

159 	struct cm_device *cm_dev;  member
253 struct cm_device *cm_dev = container_of(kref, struct cm_device, kref); in cm_dev_release() local
256 rdma_for_each_port(cm_dev->ib_device, i) in cm_dev_release()
257 kfree(cm_dev->port[i - 1]); in cm_dev_release()
259 kfree(cm_dev); in cm_dev_release()
262 static void cm_device_put(struct cm_device *cm_dev) in cm_device_put() argument
264 kref_put(&cm_dev->kref, cm_dev_release); in cm_device_put()
286 spin_lock(&cm_id_priv->av.port->cm_dev->mad_agent_lock); in cm_alloc_msg()
317 spin_unlock(&cm_id_priv->av.port->cm_dev->mad_agent_lock); in cm_alloc_msg()
445 cm_device_put(old_port->cm_dev); in cm_set_av_port()
447 kref_get(&port->cm_dev->kref); in cm_set_av_port()
463 return ib_init_ah_attr_from_wc(port->cm_dev->ib_device, in cm_init_av_for_response()
471 struct cm_device *cm_dev; in get_cm_port_from_path() local
477 list_for_each_entry(cm_dev, &cm.device_list, list) { in get_cm_port_from_path()
478 if (cm_dev->ib_device == attr->device) { in get_cm_port_from_path()
479 port = cm_dev->port[attr->port_num - 1]; in get_cm_port_from_path()
492 list_for_each_entry(cm_dev, &cm.device_list, list) { in get_cm_port_from_path()
493 attr = rdma_find_gid(cm_dev->ib_device, in get_cm_port_from_path()
498 port = cm_dev->port[attr->port_num - 1]; in get_cm_port_from_path()
514 struct cm_device *cm_dev; in cm_init_av_by_path() local
521 cm_dev = port->cm_dev; in cm_init_av_by_path()
523 ret = ib_find_cached_pkey(cm_dev->ib_device, port->port_num, in cm_init_av_by_path()
539 ret = ib_init_ah_attr_from_path(cm_dev->ib_device, port->port_num, path, in cm_init_av_by_path()
976 struct cm_device *cm_dev; in cm_enter_timewait() local
980 cm_dev = ib_get_client_data(cm_id_priv->id.device, &cm_client); in cm_enter_timewait()
981 if (!cm_dev) in cm_enter_timewait()
999 if (!cm_dev->going_down) in cm_enter_timewait()
1276 spin_lock(&cm_id_priv->av.port->cm_dev->mad_agent_lock); in cm_form_tid()
1279 spin_unlock(&cm_id_priv->av.port->cm_dev->mad_agent_lock); in cm_form_tid()
1390 cm_ack_timeout(cm_id_priv->av.port->cm_dev->ack_delay, in cm_format_req()
1442 cm_ack_timeout(cm_id_priv->av.port->cm_dev->ack_delay, in cm_format_req()
1737 struct ib_device *ib_dev = work->port->cm_dev->ib_device; in cm_get_bth_pkey()
1765 struct ib_device *dev = work->port->cm_dev->ib_device; in cm_opa_to_ib_sgid()
2069 cm_alloc_id_priv(work->port->cm_dev->ib_device, NULL, NULL); in cm_req_handler()
2137 work->port->cm_dev->ib_device, work->port->port_num, in cm_req_handler()
2157 err = rdma_query_gid(work->port->cm_dev->ib_device, in cm_req_handler()
2227 cm_id_priv->av.port->cm_dev->ack_delay); in cm_format_rep()
3290 if (rdma_protocol_roce(work->port->cm_dev->ib_device, in cm_lap_handler()
3304 cm_path_set_rec_type(work->port->cm_dev->ib_device, in cm_lap_handler()
3313 ret = ib_init_ah_attr_from_wc(work->port->cm_dev->ib_device, in cm_lap_handler()
3383 if (rdma_protocol_roce(work->port->cm_dev->ib_device, in cm_apr_handler()
3549 cm_alloc_id_priv(work->port->cm_dev->ib_device, NULL, NULL); in cm_sidr_req_handler()
3897 struct cm_device *cm_dev; in cm_establish() local
3899 cm_dev = ib_get_client_data(cm_id->device, &cm_client); in cm_establish()
3900 if (!cm_dev) in cm_establish()
3943 if (!cm_dev->going_down) { in cm_establish()
4064 if (!port->cm_dev->going_down) in cm_recv_handler()
4260 struct cm_device *cm_dev = ib_get_client_data(ibdev, &cm_client); in cm_show_counter() local
4262 if (WARN_ON(!cm_dev)) in cm_show_counter()
4268 &cm_dev->port[port_num - 1] in cm_show_counter()
4326 struct cm_device *cm_dev; in cm_add_one() local
4340 cm_dev = kzalloc(struct_size(cm_dev, port, ib_device->phys_port_cnt), in cm_add_one()
4342 if (!cm_dev) in cm_add_one()
4345 kref_init(&cm_dev->kref); in cm_add_one()
4346 spin_lock_init(&cm_dev->mad_agent_lock); in cm_add_one()
4347 cm_dev->ib_device = ib_device; in cm_add_one()
4348 cm_dev->ack_delay = ib_device->attrs.local_ca_ack_delay; in cm_add_one()
4349 cm_dev->going_down = 0; in cm_add_one()
4351 ib_set_client_data(ib_device, &cm_client, cm_dev); in cm_add_one()
4364 cm_dev->port[i-1] = port; in cm_add_one()
4365 port->cm_dev = cm_dev; in cm_add_one()
4399 list_add_tail(&cm_dev->list, &cm.device_list); in cm_add_one()
4414 port = cm_dev->port[i-1]; in cm_add_one()
4421 cm_device_put(cm_dev); in cm_add_one()
4427 struct cm_device *cm_dev = client_data; in cm_remove_one() local
4436 list_del(&cm_dev->list); in cm_remove_one()
4440 cm_dev->going_down = 1; in cm_remove_one()
4449 port = cm_dev->port[i-1]; in cm_remove_one()
4462 spin_lock(&cm_dev->mad_agent_lock); in cm_remove_one()
4464 spin_unlock(&cm_dev->mad_agent_lock); in cm_remove_one()
4470 cm_device_put(cm_dev); in cm_remove_one()