Lines Matching full:resp
117 struct rdma_ucm_event_resp resp; member
273 uevent->resp.uid = uevent->mc->uid; in ucma_create_uevent()
274 uevent->resp.id = uevent->mc->id; in ucma_create_uevent()
277 uevent->resp.uid = ctx->uid; in ucma_create_uevent()
278 uevent->resp.id = ctx->id; in ucma_create_uevent()
281 uevent->resp.event = event->event; in ucma_create_uevent()
282 uevent->resp.status = event->status; in ucma_create_uevent()
284 ucma_copy_ud_event(ctx->cm_id->device, &uevent->resp.param.ud, in ucma_create_uevent()
287 ucma_copy_conn_event(&uevent->resp.param.conn, in ucma_create_uevent()
290 uevent->resp.ece.vendor_id = event->ece.vendor_id; in ucma_create_uevent()
291 uevent->resp.ece.attr_mod = event->ece.attr_mod; in ucma_create_uevent()
313 uevent->resp.id = ctx->id; in ucma_connect_event_handler()
378 if (out_len < sizeof(uevent->resp) - sizeof(uevent->resp.reserved) - in ucma_get_event()
379 sizeof(uevent->resp.ece)) in ucma_get_event()
402 &uevent->resp, in ucma_get_event()
403 min_t(size_t, out_len, sizeof(uevent->resp)))) { in ucma_get_event()
412 if (uevent->resp.event == RDMA_CM_EVENT_CONNECT_REQUEST) in ucma_get_event()
442 struct rdma_ucm_create_id_resp resp; in ucma_create_id() local
448 if (out_len < sizeof(resp)) in ucma_create_id()
470 resp.id = ctx->id; in ucma_create_id()
472 &resp, sizeof(resp))) { in ucma_create_id()
533 if (uevent->resp.event == RDMA_CM_EVENT_CONNECT_REQUEST && in ucma_cleanup_ctx_events()
594 struct rdma_ucm_destroy_id_resp resp; in ucma_destroy_id() local
598 if (out_len < sizeof(resp)) in ucma_destroy_id()
616 resp.events_reported = ucma_destroy_private_ctx(ctx); in ucma_destroy_id()
618 &resp, sizeof(resp))) in ucma_destroy_id()
751 static void ucma_copy_ib_route(struct rdma_ucm_query_route_resp *resp, in ucma_copy_ib_route() argument
756 resp->num_paths = route->num_pri_alt_paths; in ucma_copy_ib_route()
761 (union ib_gid *) &resp->ib_route[0].dgid); in ucma_copy_ib_route()
763 (union ib_gid *) &resp->ib_route[0].sgid); in ucma_copy_ib_route()
764 resp->ib_route[0].pkey = cpu_to_be16(ib_addr_get_pkey(dev_addr)); in ucma_copy_ib_route()
767 ib_copy_path_rec_to_user(&resp->ib_route[1], in ucma_copy_ib_route()
771 ib_copy_path_rec_to_user(&resp->ib_route[0], in ucma_copy_ib_route()
779 static void ucma_copy_iboe_route(struct rdma_ucm_query_route_resp *resp, in ucma_copy_iboe_route() argument
783 resp->num_paths = route->num_pri_alt_paths; in ucma_copy_iboe_route()
787 (union ib_gid *)&resp->ib_route[0].dgid); in ucma_copy_iboe_route()
789 (union ib_gid *)&resp->ib_route[0].sgid); in ucma_copy_iboe_route()
790 resp->ib_route[0].pkey = cpu_to_be16(0xffff); in ucma_copy_iboe_route()
793 ib_copy_path_rec_to_user(&resp->ib_route[1], in ucma_copy_iboe_route()
797 ib_copy_path_rec_to_user(&resp->ib_route[0], in ucma_copy_iboe_route()
805 static void ucma_copy_iw_route(struct rdma_ucm_query_route_resp *resp, in ucma_copy_iw_route() argument
811 rdma_addr_get_dgid(dev_addr, (union ib_gid *) &resp->ib_route[0].dgid); in ucma_copy_iw_route()
812 rdma_addr_get_sgid(dev_addr, (union ib_gid *) &resp->ib_route[0].sgid); in ucma_copy_iw_route()
820 struct rdma_ucm_query_route_resp resp; in ucma_query_route() local
836 memset(&resp, 0, sizeof resp); in ucma_query_route()
838 memcpy(&resp.src_addr, addr, addr->sa_family == AF_INET ? in ucma_query_route()
842 memcpy(&resp.dst_addr, addr, addr->sa_family == AF_INET ? 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()
853 ucma_copy_ib_route(&resp, &ctx->cm_id->route); in ucma_query_route()
855 ucma_copy_iboe_route(&resp, &ctx->cm_id->route); in ucma_query_route()
857 ucma_copy_iw_route(&resp, &ctx->cm_id->route); in ucma_query_route()
861 if (copy_to_user(u64_to_user_ptr(cmd.response), &resp, in ucma_query_route()
862 min_t(size_t, out_len, sizeof(resp)))) in ucma_query_route()
870 struct rdma_ucm_query_addr_resp *resp) in ucma_query_device_addr() argument
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()
878 resp->pkey = (__force __u16) cpu_to_be16( in ucma_query_device_addr()
885 struct rdma_ucm_query_addr_resp resp; in ucma_query_addr() local
892 memset(&resp, 0, sizeof resp); in ucma_query_addr()
895 resp.src_size = rdma_addr_size(addr); in ucma_query_addr()
896 memcpy(&resp.src_addr, addr, resp.src_size); in ucma_query_addr()
899 resp.dst_size = rdma_addr_size(addr); in ucma_query_addr()
900 memcpy(&resp.dst_addr, addr, resp.dst_size); in ucma_query_addr()
902 ucma_query_device_addr(ctx->cm_id, &resp); in ucma_query_addr()
904 if (copy_to_user(response, &resp, min_t(size_t, out_len, sizeof(resp)))) in ucma_query_addr()
913 struct rdma_ucm_query_path_resp *resp; in ucma_query_path() local
916 if (out_len < sizeof(*resp)) in ucma_query_path()
919 resp = kzalloc(out_len, GFP_KERNEL); in ucma_query_path()
920 if (!resp) in ucma_query_path()
923 resp->num_paths = ctx->cm_id->route.num_pri_alt_paths; in ucma_query_path()
924 for (i = 0, out_len -= sizeof(*resp); in ucma_query_path()
925 i < resp->num_paths && out_len > sizeof(struct ib_path_rec_data); in ucma_query_path()
929 resp->path_data[i].flags = IB_PATH_GMP | IB_PATH_PRIMARY | in ucma_query_path()
935 ib_sa_pack_path(&ib, &resp->path_data[i].path_rec); in ucma_query_path()
938 ib_sa_pack_path(rec, &resp->path_data[i].path_rec); in ucma_query_path()
942 if (copy_to_user(response, resp, struct_size(resp, path_data, i))) in ucma_query_path()
945 kfree(resp); in ucma_query_path()
952 struct rdma_ucm_query_addr_resp resp; in ucma_query_gid() local
959 memset(&resp, 0, sizeof resp); in ucma_query_gid()
961 ucma_query_device_addr(ctx->cm_id, &resp); in ucma_query_gid()
963 addr = (struct sockaddr_ib *) &resp.src_addr; in ucma_query_gid()
964 resp.src_size = sizeof(*addr); in ucma_query_gid()
966 memcpy(addr, &ctx->cm_id->route.addr.src_addr, resp.src_size); in ucma_query_gid()
969 addr->sib_pkey = (__force __be16) resp.pkey; in ucma_query_gid()
976 addr = (struct sockaddr_ib *) &resp.dst_addr; in ucma_query_gid()
977 resp.dst_size = sizeof(*addr); in ucma_query_gid()
979 memcpy(addr, &ctx->cm_id->route.addr.dst_addr, resp.dst_size); in ucma_query_gid()
982 addr->sib_pkey = (__force __be16) resp.pkey; in ucma_query_gid()
989 if (copy_to_user(response, &resp, min_t(size_t, out_len, sizeof(resp)))) in ucma_query_gid()
1216 struct ib_uverbs_qp_attr resp; in ucma_init_qp_attr() local
1221 if (out_len < sizeof(resp)) in ucma_init_qp_attr()
1234 resp.qp_attr_mask = 0; in ucma_init_qp_attr()
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()
1245 &resp, sizeof(resp))) in ucma_init_qp_attr()
1438 struct rdma_ucm_create_id_resp resp; in ucma_process_join() local
1445 if (out_len < sizeof(resp)) in ucma_process_join()
1491 resp.id = mc->id; in ucma_process_join()
1493 &resp, sizeof(resp))) { in ucma_process_join()
1563 struct rdma_ucm_destroy_id_resp resp; in ucma_leave_multicast() local
1567 if (out_len < sizeof(resp)) in ucma_leave_multicast()
1599 resp.events_reported = mc->events_reported; in ucma_leave_multicast()
1603 &resp, sizeof(resp))) in ucma_leave_multicast()
1614 struct rdma_ucm_migrate_resp resp; in ucma_migrate_id() local
1666 resp.events_reported = ctx->events_reported; in ucma_migrate_id()
1675 &resp, sizeof(resp))) in ucma_migrate_id()