Lines Matching refs:resp

58 static int uverbs_response(struct uverbs_attr_bundle *attrs, const void *resp,  in uverbs_response()  argument
65 attrs, UVERBS_ATTR_CORE_OUT, resp, resp_len); in uverbs_response()
67 if (copy_to_user(attrs->ucore.outbuf, resp, in uverbs_response()
210 struct ib_uverbs_get_context_resp resp; in ib_uverbs_get_context() local
258 resp.async_fd = ret; in ib_uverbs_get_context()
266 resp.num_comp_vectors = file->device->num_comp_vectors; in ib_uverbs_get_context()
268 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_get_context()
278 fd_install(resp.async_fd, filp); in ib_uverbs_get_context()
295 put_unused_fd(resp.async_fd); in ib_uverbs_get_context()
309 struct ib_uverbs_query_device_resp *resp, in copy_query_dev_fields() argument
314 resp->fw_ver = attr->fw_ver; in copy_query_dev_fields()
315 resp->node_guid = ib_dev->node_guid; in copy_query_dev_fields()
316 resp->sys_image_guid = attr->sys_image_guid; in copy_query_dev_fields()
317 resp->max_mr_size = attr->max_mr_size; in copy_query_dev_fields()
318 resp->page_size_cap = attr->page_size_cap; in copy_query_dev_fields()
319 resp->vendor_id = attr->vendor_id; in copy_query_dev_fields()
320 resp->vendor_part_id = attr->vendor_part_id; in copy_query_dev_fields()
321 resp->hw_ver = attr->hw_ver; in copy_query_dev_fields()
322 resp->max_qp = attr->max_qp; in copy_query_dev_fields()
323 resp->max_qp_wr = attr->max_qp_wr; in copy_query_dev_fields()
324 resp->device_cap_flags = lower_32_bits(attr->device_cap_flags); in copy_query_dev_fields()
325 resp->max_sge = min(attr->max_send_sge, attr->max_recv_sge); in copy_query_dev_fields()
326 resp->max_sge_rd = attr->max_sge_rd; in copy_query_dev_fields()
327 resp->max_cq = attr->max_cq; in copy_query_dev_fields()
328 resp->max_cqe = attr->max_cqe; in copy_query_dev_fields()
329 resp->max_mr = attr->max_mr; in copy_query_dev_fields()
330 resp->max_pd = attr->max_pd; in copy_query_dev_fields()
331 resp->max_qp_rd_atom = attr->max_qp_rd_atom; in copy_query_dev_fields()
332 resp->max_ee_rd_atom = attr->max_ee_rd_atom; in copy_query_dev_fields()
333 resp->max_res_rd_atom = attr->max_res_rd_atom; in copy_query_dev_fields()
334 resp->max_qp_init_rd_atom = attr->max_qp_init_rd_atom; in copy_query_dev_fields()
335 resp->max_ee_init_rd_atom = attr->max_ee_init_rd_atom; in copy_query_dev_fields()
336 resp->atomic_cap = attr->atomic_cap; in copy_query_dev_fields()
337 resp->max_ee = attr->max_ee; in copy_query_dev_fields()
338 resp->max_rdd = attr->max_rdd; in copy_query_dev_fields()
339 resp->max_mw = attr->max_mw; in copy_query_dev_fields()
340 resp->max_raw_ipv6_qp = attr->max_raw_ipv6_qp; in copy_query_dev_fields()
341 resp->max_raw_ethy_qp = attr->max_raw_ethy_qp; in copy_query_dev_fields()
342 resp->max_mcast_grp = attr->max_mcast_grp; in copy_query_dev_fields()
343 resp->max_mcast_qp_attach = attr->max_mcast_qp_attach; in copy_query_dev_fields()
344 resp->max_total_mcast_qp_attach = attr->max_total_mcast_qp_attach; in copy_query_dev_fields()
345 resp->max_ah = attr->max_ah; in copy_query_dev_fields()
346 resp->max_fmr = attr->max_fmr; in copy_query_dev_fields()
347 resp->max_map_per_fmr = attr->max_map_per_fmr; in copy_query_dev_fields()
348 resp->max_srq = attr->max_srq; in copy_query_dev_fields()
349 resp->max_srq_wr = attr->max_srq_wr; in copy_query_dev_fields()
350 resp->max_srq_sge = attr->max_srq_sge; in copy_query_dev_fields()
351 resp->max_pkeys = attr->max_pkeys; in copy_query_dev_fields()
352 resp->local_ca_ack_delay = attr->local_ca_ack_delay; in copy_query_dev_fields()
353 resp->phys_port_cnt = ib_dev->phys_port_cnt; in copy_query_dev_fields()
359 struct ib_uverbs_query_device_resp resp; in ib_uverbs_query_device() local
371 memset(&resp, 0, sizeof resp); in ib_uverbs_query_device()
372 copy_query_dev_fields(ucontext, &resp, &ucontext->device->attrs); in ib_uverbs_query_device()
374 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_query_device()
380 struct ib_uverbs_query_port_resp resp; in ib_uverbs_query_port() local
399 memset(&resp, 0, sizeof resp); in ib_uverbs_query_port()
400 copy_port_attr_to_resp(&attr, &resp, ib_dev, cmd.port_num); in ib_uverbs_query_port()
402 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_query_port()
408 struct ib_uverbs_alloc_pd_resp resp; in ib_uverbs_alloc_pd() local
439 memset(&resp, 0, sizeof resp); in ib_uverbs_alloc_pd()
440 resp.pd_handle = uobj->id; in ib_uverbs_alloc_pd()
443 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_alloc_pd()
560 struct ib_uverbs_open_xrcd_resp resp; in ib_uverbs_open_xrcd() local
621 memset(&resp, 0, sizeof resp); in ib_uverbs_open_xrcd()
622 resp.xrcd_handle = obj->uobject.id; in ib_uverbs_open_xrcd()
634 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_open_xrcd()
707 struct ib_uverbs_reg_mr_resp resp; in ib_uverbs_reg_mr() local
764 memset(&resp, 0, sizeof resp); in ib_uverbs_reg_mr()
765 resp.lkey = mr->lkey; in ib_uverbs_reg_mr()
766 resp.rkey = mr->rkey; in ib_uverbs_reg_mr()
767 resp.mr_handle = uobj->id; in ib_uverbs_reg_mr()
769 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_reg_mr()
791 struct ib_uverbs_rereg_mr_resp resp; in ib_uverbs_rereg_mr() local
850 memset(&resp, 0, sizeof(resp)); in ib_uverbs_rereg_mr()
851 resp.lkey = mr->lkey; in ib_uverbs_rereg_mr()
852 resp.rkey = mr->rkey; in ib_uverbs_rereg_mr()
854 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_rereg_mr()
881 struct ib_uverbs_alloc_mw_resp resp; in ib_uverbs_alloc_mw() local
920 memset(&resp, 0, sizeof(resp)); in ib_uverbs_alloc_mw()
921 resp.rkey = mw->rkey; in ib_uverbs_alloc_mw()
922 resp.mw_handle = uobj->id; in ib_uverbs_alloc_mw()
924 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_alloc_mw()
955 struct ib_uverbs_create_comp_channel_resp resp; in ib_uverbs_create_comp_channel() local
969 resp.fd = uobj->id; in ib_uverbs_create_comp_channel()
975 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_create_comp_channel()
991 struct ib_uverbs_ex_create_cq_resp resp; in create_cq() local
1038 memset(&resp, 0, sizeof resp); in create_cq()
1039 resp.base.cq_handle = obj->uobject.id; in create_cq()
1040 resp.base.cqe = cq->cqe; in create_cq()
1041 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in create_cq()
1046 ret = uverbs_response(attrs, &resp, sizeof(resp)); in create_cq()
1114 struct ib_uverbs_resize_cq_resp resp = {}; in ib_uverbs_resize_cq() local
1130 resp.cqe = cq->cqe; in ib_uverbs_resize_cq()
1132 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_resize_cq()
1172 struct ib_uverbs_poll_cq_resp resp; in ib_uverbs_poll_cq() local
1189 data_ptr = header_ptr + sizeof resp; in ib_uverbs_poll_cq()
1191 memset(&resp, 0, sizeof resp); in ib_uverbs_poll_cq()
1192 while (resp.count < cmd.ne) { in ib_uverbs_poll_cq()
1204 ++resp.count; in ib_uverbs_poll_cq()
1207 if (copy_to_user(header_ptr, &resp, sizeof resp)) { in ib_uverbs_poll_cq()
1246 struct ib_uverbs_destroy_cq_resp resp; in ib_uverbs_destroy_cq() local
1260 memset(&resp, 0, sizeof(resp)); in ib_uverbs_destroy_cq()
1261 resp.comp_events_reported = obj->comp_events_reported; in ib_uverbs_destroy_cq()
1262 resp.async_events_reported = obj->async_events_reported; in ib_uverbs_destroy_cq()
1266 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_destroy_cq()
1281 struct ib_uverbs_ex_create_qp_resp resp; in create_qp() local
1460 memset(&resp, 0, sizeof resp); in create_qp()
1461 resp.base.qpn = qp->qp_num; in create_qp()
1462 resp.base.qp_handle = obj->uevent.uobject.id; in create_qp()
1463 resp.base.max_recv_sge = attr.cap.max_recv_sge; in create_qp()
1464 resp.base.max_send_sge = attr.cap.max_send_sge; in create_qp()
1465 resp.base.max_recv_wr = attr.cap.max_recv_wr; in create_qp()
1466 resp.base.max_send_wr = attr.cap.max_send_wr; in create_qp()
1467 resp.base.max_inline_data = attr.cap.max_inline_data; in create_qp()
1468 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in create_qp()
1470 ret = uverbs_response(attrs, &resp, sizeof(resp)); in create_qp()
1563 struct ib_uverbs_create_qp_resp resp; in ib_uverbs_open_qp() local
1611 memset(&resp, 0, sizeof resp); in ib_uverbs_open_qp()
1612 resp.qpn = qp->qp_num; in ib_uverbs_open_qp()
1613 resp.qp_handle = obj->uevent.uobject.id; in ib_uverbs_open_qp()
1615 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_open_qp()
1660 struct ib_uverbs_query_qp_resp resp; in ib_uverbs_query_qp() local
1690 memset(&resp, 0, sizeof resp); in ib_uverbs_query_qp()
1692 resp.qp_state = attr->qp_state; in ib_uverbs_query_qp()
1693 resp.cur_qp_state = attr->cur_qp_state; in ib_uverbs_query_qp()
1694 resp.path_mtu = attr->path_mtu; in ib_uverbs_query_qp()
1695 resp.path_mig_state = attr->path_mig_state; in ib_uverbs_query_qp()
1696 resp.qkey = attr->qkey; in ib_uverbs_query_qp()
1697 resp.rq_psn = attr->rq_psn; in ib_uverbs_query_qp()
1698 resp.sq_psn = attr->sq_psn; in ib_uverbs_query_qp()
1699 resp.dest_qp_num = attr->dest_qp_num; in ib_uverbs_query_qp()
1700 resp.qp_access_flags = attr->qp_access_flags; in ib_uverbs_query_qp()
1701 resp.pkey_index = attr->pkey_index; in ib_uverbs_query_qp()
1702 resp.alt_pkey_index = attr->alt_pkey_index; in ib_uverbs_query_qp()
1703 resp.sq_draining = attr->sq_draining; in ib_uverbs_query_qp()
1704 resp.max_rd_atomic = attr->max_rd_atomic; in ib_uverbs_query_qp()
1705 resp.max_dest_rd_atomic = attr->max_dest_rd_atomic; in ib_uverbs_query_qp()
1706 resp.min_rnr_timer = attr->min_rnr_timer; in ib_uverbs_query_qp()
1707 resp.port_num = attr->port_num; in ib_uverbs_query_qp()
1708 resp.timeout = attr->timeout; in ib_uverbs_query_qp()
1709 resp.retry_cnt = attr->retry_cnt; in ib_uverbs_query_qp()
1710 resp.rnr_retry = attr->rnr_retry; in ib_uverbs_query_qp()
1711 resp.alt_port_num = attr->alt_port_num; in ib_uverbs_query_qp()
1712 resp.alt_timeout = attr->alt_timeout; in ib_uverbs_query_qp()
1714 copy_ah_attr_to_uverbs(&resp.dest, &attr->ah_attr); in ib_uverbs_query_qp()
1715 copy_ah_attr_to_uverbs(&resp.alt_dest, &attr->alt_ah_attr); in ib_uverbs_query_qp()
1717 resp.max_send_wr = init_attr->cap.max_send_wr; in ib_uverbs_query_qp()
1718 resp.max_recv_wr = init_attr->cap.max_recv_wr; in ib_uverbs_query_qp()
1719 resp.max_send_sge = init_attr->cap.max_send_sge; in ib_uverbs_query_qp()
1720 resp.max_recv_sge = init_attr->cap.max_recv_sge; in ib_uverbs_query_qp()
1721 resp.max_inline_data = init_attr->cap.max_inline_data; in ib_uverbs_query_qp()
1722 resp.sq_sig_all = init_attr->sq_sig_type == IB_SIGNAL_ALL_WR; in ib_uverbs_query_qp()
1724 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_query_qp()
1948 struct ib_uverbs_ex_modify_qp_resp resp = { in ib_uverbs_ex_modify_qp() local
1949 .response_length = uverbs_response_length(attrs, sizeof(resp)) in ib_uverbs_ex_modify_qp()
1971 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_modify_qp()
1977 struct ib_uverbs_destroy_qp_resp resp; in ib_uverbs_destroy_qp() local
1991 memset(&resp, 0, sizeof(resp)); in ib_uverbs_destroy_qp()
1992 resp.events_reported = obj->uevent.events_reported; in ib_uverbs_destroy_qp()
1996 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_destroy_qp()
2012 struct ib_uverbs_post_send_resp resp; in ib_uverbs_post_send() local
2172 resp.bad_wr = 0; in ib_uverbs_post_send()
2176 ++resp.bad_wr; in ib_uverbs_post_send()
2181 ret2 = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_post_send()
2303 struct ib_uverbs_post_recv_resp resp; in ib_uverbs_post_recv() local
2325 resp.bad_wr = 0; in ib_uverbs_post_recv()
2331 ++resp.bad_wr; in ib_uverbs_post_recv()
2337 ret2 = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_post_recv()
2353 struct ib_uverbs_post_srq_recv_resp resp; in ib_uverbs_post_srq_recv() local
2375 resp.bad_wr = 0; in ib_uverbs_post_srq_recv()
2382 ++resp.bad_wr; in ib_uverbs_post_srq_recv()
2387 ret2 = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_post_srq_recv()
2404 struct ib_uverbs_create_ah_resp resp; in ib_uverbs_create_ah() local
2459 resp.ah_handle = uobj->id; in ib_uverbs_create_ah()
2461 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_create_ah()
2904 struct ib_uverbs_ex_create_wq_resp resp = {}; in ib_uverbs_ex_create_wq() local
2966 memset(&resp, 0, sizeof(resp)); in ib_uverbs_ex_create_wq()
2967 resp.wq_handle = obj->uevent.uobject.id; in ib_uverbs_ex_create_wq()
2968 resp.max_sge = wq_init_attr.max_sge; in ib_uverbs_ex_create_wq()
2969 resp.max_wr = wq_init_attr.max_wr; in ib_uverbs_ex_create_wq()
2970 resp.wqn = wq->wq_num; in ib_uverbs_ex_create_wq()
2971 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_create_wq()
2972 err = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_create_wq()
2995 struct ib_uverbs_ex_destroy_wq_resp resp = {}; in ib_uverbs_ex_destroy_wq() local
3007 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_destroy_wq()
3013 resp.events_reported = obj->uevent.events_reported; in ib_uverbs_ex_destroy_wq()
3017 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_destroy_wq()
3056 struct ib_uverbs_ex_create_rwq_ind_table_resp resp = {}; in ib_uverbs_ex_create_rwq_ind_table() local
3139 resp.ind_tbl_handle = uobj->id; in ib_uverbs_ex_create_rwq_ind_table()
3140 resp.ind_tbl_num = rwq_ind_tbl->ind_tbl_num; in ib_uverbs_ex_create_rwq_ind_table()
3141 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_create_rwq_ind_table()
3143 err = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_create_rwq_ind_table()
3186 struct ib_uverbs_create_flow_resp resp; in ib_uverbs_ex_create_flow() local
3319 memset(&resp, 0, sizeof(resp)); in ib_uverbs_ex_create_flow()
3320 resp.flow_handle = uobj->id; in ib_uverbs_ex_create_flow()
3322 err = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_create_flow()
3367 struct ib_uverbs_create_srq_resp resp; in __uverbs_create_xsrq() local
3460 memset(&resp, 0, sizeof resp); in __uverbs_create_xsrq()
3461 resp.srq_handle = obj->uevent.uobject.id; in __uverbs_create_xsrq()
3462 resp.max_wr = attr.attr.max_wr; in __uverbs_create_xsrq()
3463 resp.max_sge = attr.attr.max_sge; in __uverbs_create_xsrq()
3465 resp.srqn = srq->ext.xrc.srq_num; in __uverbs_create_xsrq()
3467 ret = uverbs_response(attrs, &resp, sizeof(resp)); in __uverbs_create_xsrq()
3567 struct ib_uverbs_query_srq_resp resp; in ib_uverbs_query_srq() local
3587 memset(&resp, 0, sizeof resp); in ib_uverbs_query_srq()
3589 resp.max_wr = attr.max_wr; in ib_uverbs_query_srq()
3590 resp.max_sge = attr.max_sge; in ib_uverbs_query_srq()
3591 resp.srq_limit = attr.srq_limit; in ib_uverbs_query_srq()
3593 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_query_srq()
3599 struct ib_uverbs_destroy_srq_resp resp; in ib_uverbs_destroy_srq() local
3613 memset(&resp, 0, sizeof(resp)); in ib_uverbs_destroy_srq()
3614 resp.events_reported = obj->events_reported; in ib_uverbs_destroy_srq()
3618 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_destroy_srq()
3623 struct ib_uverbs_ex_query_device_resp resp = {}; in ib_uverbs_ex_query_device() local
3649 copy_query_dev_fields(ucontext, &resp.base, &attr); in ib_uverbs_ex_query_device()
3651 resp.odp_caps.general_caps = attr.odp_caps.general_caps; in ib_uverbs_ex_query_device()
3652 resp.odp_caps.per_transport_caps.rc_odp_caps = in ib_uverbs_ex_query_device()
3654 resp.odp_caps.per_transport_caps.uc_odp_caps = in ib_uverbs_ex_query_device()
3656 resp.odp_caps.per_transport_caps.ud_odp_caps = in ib_uverbs_ex_query_device()
3658 resp.xrc_odp_caps = attr.odp_caps.per_transport_caps.xrc_odp_caps; in ib_uverbs_ex_query_device()
3660 resp.timestamp_mask = attr.timestamp_mask; in ib_uverbs_ex_query_device()
3661 resp.hca_core_clock = attr.hca_core_clock; in ib_uverbs_ex_query_device()
3662 resp.device_cap_flags_ex = attr.device_cap_flags; in ib_uverbs_ex_query_device()
3663 resp.rss_caps.supported_qpts = attr.rss_caps.supported_qpts; in ib_uverbs_ex_query_device()
3664 resp.rss_caps.max_rwq_indirection_tables = in ib_uverbs_ex_query_device()
3666 resp.rss_caps.max_rwq_indirection_table_size = in ib_uverbs_ex_query_device()
3668 resp.max_wq_type_rq = attr.max_wq_type_rq; in ib_uverbs_ex_query_device()
3669 resp.raw_packet_caps = attr.raw_packet_caps; in ib_uverbs_ex_query_device()
3670 resp.tm_caps.max_rndv_hdr_size = attr.tm_caps.max_rndv_hdr_size; in ib_uverbs_ex_query_device()
3671 resp.tm_caps.max_num_tags = attr.tm_caps.max_num_tags; in ib_uverbs_ex_query_device()
3672 resp.tm_caps.max_ops = attr.tm_caps.max_ops; in ib_uverbs_ex_query_device()
3673 resp.tm_caps.max_sge = attr.tm_caps.max_sge; in ib_uverbs_ex_query_device()
3674 resp.tm_caps.flags = attr.tm_caps.flags; in ib_uverbs_ex_query_device()
3675 resp.cq_moderation_caps.max_cq_moderation_count = in ib_uverbs_ex_query_device()
3677 resp.cq_moderation_caps.max_cq_moderation_period = in ib_uverbs_ex_query_device()
3679 resp.max_dm_size = attr.max_dm_size; in ib_uverbs_ex_query_device()
3680 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_query_device()
3682 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_query_device()
3721 #define UAPI_DEF_WRITE_IO(req, resp) \ argument
3726 .write.req_size = sizeof(req), .write.resp_size = sizeof(resp)
3730 #define UAPI_DEF_WRITE_UDATA_IO(req, resp) \ argument
3731 UAPI_DEF_WRITE_IO(req, resp), \
3736 BUILD_BUG_ON_ZERO(offsetof(resp, driver_data) != \
3737 sizeof(resp))
3749 #define UAPI_DEF_WRITE_IO_EX(req, req_last_member, resp, resp_last_member) \ argument
3752 .write.resp_size = offsetofend(resp, resp_last_member)