Lines Matching refs:cm_id
92 struct rdma_cm_id *cm_id; member
168 if (!ctx->cm_id->device) { in ucma_get_ctx_dev()
186 rdma_destroy_id(ctx->cm_id); in ucma_close_id()
189 ctx->cm_id = NULL; in ucma_close_id()
216 struct rdma_cm_id *cm_id) in ucma_set_ctx_cm_id() argument
219 ctx->cm_id = cm_id; in ucma_set_ctx_cm_id()
283 if (ctx->cm_id->qp_type == IB_QPT_UD) in ucma_create_uevent()
284 ucma_copy_ud_event(ctx->cm_id->device, &uevent->resp.param.ud, in ucma_create_uevent()
295 static int ucma_connect_event_handler(struct rdma_cm_id *cm_id, in ucma_connect_event_handler() argument
298 struct ucma_context *listen_ctx = cm_id->context; in ucma_connect_event_handler()
307 ucma_set_ctx_cm_id(ctx, cm_id); in ucma_connect_event_handler()
315 ctx->cm_id->context = ctx; in ucma_connect_event_handler()
332 static int ucma_event_handler(struct rdma_cm_id *cm_id, in ucma_event_handler() argument
336 struct ucma_context *ctx = cm_id->context; in ucma_event_handler()
339 return ucma_connect_event_handler(cm_id, event); in ucma_event_handler()
444 struct rdma_cm_id *cm_id; in ucma_create_id() local
463 cm_id = rdma_create_user_id(ucma_event_handler, ctx, cmd.ps, qp_type); in ucma_create_id()
464 if (IS_ERR(cm_id)) { in ucma_create_id()
465 ret = PTR_ERR(cm_id); in ucma_create_id()
468 ucma_set_ctx_cm_id(ctx, cm_id); in ucma_create_id()
508 rdma_lock_handler(mc->ctx->cm_id); in ucma_cleanup_mc_events()
518 rdma_unlock_handler(mc->ctx->cm_id); in ucma_cleanup_mc_events()
642 ret = rdma_bind_addr(ctx->cm_id, (struct sockaddr *) &cmd.addr); in ucma_bind_ip()
668 ret = rdma_bind_addr(ctx->cm_id, (struct sockaddr *) &cmd.addr); in ucma_bind()
694 ret = rdma_resolve_addr(ctx->cm_id, (struct sockaddr *) &cmd.src_addr, in ucma_resolve_ip()
722 ret = rdma_resolve_addr(ctx->cm_id, (struct sockaddr *) &cmd.src_addr, in ucma_resolve_addr()
745 ret = rdma_resolve_route(ctx->cm_id, cmd.timeout_ms); in ucma_resolve_route()
837 addr = (struct sockaddr *) &ctx->cm_id->route.addr.src_addr; in ucma_query_route()
841 addr = (struct sockaddr *) &ctx->cm_id->route.addr.dst_addr; in ucma_query_route()
845 if (!ctx->cm_id->device) in ucma_query_route()
848 resp.node_guid = (__force __u64) ctx->cm_id->device->node_guid; in ucma_query_route()
849 resp.ibdev_index = ctx->cm_id->device->index; in ucma_query_route()
850 resp.port_num = ctx->cm_id->port_num; in ucma_query_route()
852 if (rdma_cap_ib_sa(ctx->cm_id->device, ctx->cm_id->port_num)) in ucma_query_route()
853 ucma_copy_ib_route(&resp, &ctx->cm_id->route); in ucma_query_route()
854 else if (rdma_protocol_roce(ctx->cm_id->device, ctx->cm_id->port_num)) in ucma_query_route()
855 ucma_copy_iboe_route(&resp, &ctx->cm_id->route); in ucma_query_route()
856 else if (rdma_protocol_iwarp(ctx->cm_id->device, ctx->cm_id->port_num)) in ucma_query_route()
857 ucma_copy_iw_route(&resp, &ctx->cm_id->route); in ucma_query_route()
869 static void ucma_query_device_addr(struct rdma_cm_id *cm_id, in ucma_query_device_addr() argument
872 if (!cm_id->device) in ucma_query_device_addr()
875 resp->node_guid = (__force __u64) cm_id->device->node_guid; in ucma_query_device_addr()
876 resp->ibdev_index = cm_id->device->index; in ucma_query_device_addr()
877 resp->port_num = cm_id->port_num; in ucma_query_device_addr()
879 ib_addr_get_pkey(&cm_id->route.addr.dev_addr)); in ucma_query_device_addr()
894 addr = (struct sockaddr *) &ctx->cm_id->route.addr.src_addr; in ucma_query_addr()
898 addr = (struct sockaddr *) &ctx->cm_id->route.addr.dst_addr; in ucma_query_addr()
902 ucma_query_device_addr(ctx->cm_id, &resp); in ucma_query_addr()
923 resp->num_paths = ctx->cm_id->route.num_pri_alt_paths; in ucma_query_path()
927 struct sa_path_rec *rec = &ctx->cm_id->route.path_rec[i]; in ucma_query_path()
961 ucma_query_device_addr(ctx->cm_id, &resp); in ucma_query_gid()
965 if (ctx->cm_id->route.addr.src_addr.ss_family == AF_IB) { in ucma_query_gid()
966 memcpy(addr, &ctx->cm_id->route.addr.src_addr, resp.src_size); in ucma_query_gid()
970 rdma_read_gids(ctx->cm_id, (union ib_gid *)&addr->sib_addr, in ucma_query_gid()
972 addr->sib_sid = rdma_get_service_id(ctx->cm_id, (struct sockaddr *) in ucma_query_gid()
973 &ctx->cm_id->route.addr.src_addr); in ucma_query_gid()
978 if (ctx->cm_id->route.addr.dst_addr.ss_family == AF_IB) { in ucma_query_gid()
979 memcpy(addr, &ctx->cm_id->route.addr.dst_addr, resp.dst_size); in ucma_query_gid()
983 rdma_read_gids(ctx->cm_id, NULL, in ucma_query_gid()
985 addr->sib_sid = rdma_get_service_id(ctx->cm_id, (struct sockaddr *) in ucma_query_gid()
986 &ctx->cm_id->route.addr.dst_addr); in ucma_query_gid()
1072 ucma_copy_conn_param(ctx->cm_id, &conn_param, &cmd.conn_param); in ucma_connect()
1079 ret = rdma_connect_ece(ctx->cm_id, &conn_param, &ece); in ucma_connect()
1104 ret = rdma_listen(ctx->cm_id, cmd.backlog); in ucma_listen()
1136 ucma_copy_conn_param(ctx->cm_id, &conn_param, &cmd.conn_param); in ucma_accept()
1138 rdma_lock_handler(ctx->cm_id); in ucma_accept()
1139 ret = rdma_accept_ece(ctx->cm_id, &conn_param, &ece); in ucma_accept()
1144 rdma_unlock_handler(ctx->cm_id); in ucma_accept()
1148 rdma_lock_handler(ctx->cm_id); in ucma_accept()
1149 ret = rdma_accept_ece(ctx->cm_id, NULL, &ece); in ucma_accept()
1150 rdma_unlock_handler(ctx->cm_id); in ucma_accept()
1183 ret = rdma_reject(ctx->cm_id, cmd.private_data, cmd.private_data_len, in ucma_reject()
1205 ret = rdma_disconnect(ctx->cm_id); in ucma_disconnect()
1238 ret = rdma_init_qp_attr(ctx->cm_id, &qp_attr, &resp.qp_attr_mask); in ucma_init_qp_attr()
1243 ib_copy_qp_attr_to_user(ctx->cm_id->device, &resp, &qp_attr); in ucma_init_qp_attr()
1264 rdma_set_service_type(ctx->cm_id, *((u8 *) optval)); in ucma_set_option_id()
1271 ret = rdma_set_reuseaddr(ctx->cm_id, *((int *) optval) ? 1 : 0); in ucma_set_option_id()
1278 ret = rdma_set_afonly(ctx->cm_id, *((int *) optval) ? 1 : 0); in ucma_set_option_id()
1285 ret = rdma_set_ack_timeout(ctx->cm_id, *((u8 *)optval)); in ucma_set_option_id()
1313 if (!ctx->cm_id->device) in ucma_set_ib_path()
1321 if (rdma_cap_opa_ah(ctx->cm_id->device, ctx->cm_id->port_num)) { in ucma_set_ib_path()
1326 ret = rdma_set_ib_path(ctx->cm_id, &opa); in ucma_set_ib_path()
1330 ret = rdma_set_ib_path(ctx->cm_id, &sa_path); in ucma_set_ib_path()
1338 return ucma_event_handler(ctx->cm_id, &event); in ucma_set_ib_path()
1427 if (ctx->cm_id->device) in ucma_notify()
1428 ret = rdma_notify(ctx->cm_id, (enum ib_event_type)cmd.event); in ucma_notify()
1485 ret = rdma_join_multicast(ctx->cm_id, (struct sockaddr *)&mc->addr, in ucma_process_join()
1505 rdma_leave_multicast(ctx->cm_id, (struct sockaddr *) &mc->addr); in ucma_process_join()
1593 rdma_leave_multicast(mc->ctx->cm_id, (struct sockaddr *) &mc->addr); in ucma_leave_multicast()
1637 rdma_lock_handler(ctx->cm_id); in ucma_migrate_id()
1674 rdma_unlock_handler(ctx->cm_id); in ucma_migrate_id()