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()
278 struct ib_uverbs_get_context_resp resp; in ib_uverbs_get_context() local
298 resp = (struct ib_uverbs_get_context_resp){ in ib_uverbs_get_context()
302 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_get_context()
325 struct ib_uverbs_query_device_resp *resp, in copy_query_dev_fields() argument
330 resp->fw_ver = attr->fw_ver; in copy_query_dev_fields()
331 resp->node_guid = ib_dev->node_guid; in copy_query_dev_fields()
332 resp->sys_image_guid = attr->sys_image_guid; in copy_query_dev_fields()
333 resp->max_mr_size = attr->max_mr_size; in copy_query_dev_fields()
334 resp->page_size_cap = attr->page_size_cap; in copy_query_dev_fields()
335 resp->vendor_id = attr->vendor_id; in copy_query_dev_fields()
336 resp->vendor_part_id = attr->vendor_part_id; in copy_query_dev_fields()
337 resp->hw_ver = attr->hw_ver; in copy_query_dev_fields()
338 resp->max_qp = attr->max_qp; in copy_query_dev_fields()
339 resp->max_qp_wr = attr->max_qp_wr; in copy_query_dev_fields()
340 resp->device_cap_flags = lower_32_bits(attr->device_cap_flags); in copy_query_dev_fields()
341 resp->max_sge = min(attr->max_send_sge, attr->max_recv_sge); in copy_query_dev_fields()
342 resp->max_sge_rd = attr->max_sge_rd; in copy_query_dev_fields()
343 resp->max_cq = attr->max_cq; in copy_query_dev_fields()
344 resp->max_cqe = attr->max_cqe; in copy_query_dev_fields()
345 resp->max_mr = attr->max_mr; in copy_query_dev_fields()
346 resp->max_pd = attr->max_pd; in copy_query_dev_fields()
347 resp->max_qp_rd_atom = attr->max_qp_rd_atom; in copy_query_dev_fields()
348 resp->max_ee_rd_atom = attr->max_ee_rd_atom; in copy_query_dev_fields()
349 resp->max_res_rd_atom = attr->max_res_rd_atom; in copy_query_dev_fields()
350 resp->max_qp_init_rd_atom = attr->max_qp_init_rd_atom; in copy_query_dev_fields()
351 resp->max_ee_init_rd_atom = attr->max_ee_init_rd_atom; in copy_query_dev_fields()
352 resp->atomic_cap = attr->atomic_cap; in copy_query_dev_fields()
353 resp->max_ee = attr->max_ee; in copy_query_dev_fields()
354 resp->max_rdd = attr->max_rdd; in copy_query_dev_fields()
355 resp->max_mw = attr->max_mw; in copy_query_dev_fields()
356 resp->max_raw_ipv6_qp = attr->max_raw_ipv6_qp; in copy_query_dev_fields()
357 resp->max_raw_ethy_qp = attr->max_raw_ethy_qp; in copy_query_dev_fields()
358 resp->max_mcast_grp = attr->max_mcast_grp; in copy_query_dev_fields()
359 resp->max_mcast_qp_attach = attr->max_mcast_qp_attach; in copy_query_dev_fields()
360 resp->max_total_mcast_qp_attach = attr->max_total_mcast_qp_attach; in copy_query_dev_fields()
361 resp->max_ah = attr->max_ah; in copy_query_dev_fields()
362 resp->max_srq = attr->max_srq; in copy_query_dev_fields()
363 resp->max_srq_wr = attr->max_srq_wr; in copy_query_dev_fields()
364 resp->max_srq_sge = attr->max_srq_sge; in copy_query_dev_fields()
365 resp->max_pkeys = attr->max_pkeys; in copy_query_dev_fields()
366 resp->local_ca_ack_delay = attr->local_ca_ack_delay; in copy_query_dev_fields()
367 resp->phys_port_cnt = min_t(u32, ib_dev->phys_port_cnt, U8_MAX); in copy_query_dev_fields()
373 struct ib_uverbs_query_device_resp resp; in ib_uverbs_query_device() local
385 memset(&resp, 0, sizeof resp); in ib_uverbs_query_device()
386 copy_query_dev_fields(ucontext, &resp, &ucontext->device->attrs); in ib_uverbs_query_device()
388 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_query_device()
394 struct ib_uverbs_query_port_resp resp; in ib_uverbs_query_port() local
413 memset(&resp, 0, sizeof resp); in ib_uverbs_query_port()
414 copy_port_attr_to_resp(&attr, &resp, ib_dev, cmd.port_num); in ib_uverbs_query_port()
416 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_query_port()
421 struct ib_uverbs_alloc_pd_resp resp = {}; in ib_uverbs_alloc_pd() local
457 resp.pd_handle = uobj->id; in ib_uverbs_alloc_pd()
458 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_alloc_pd()
568 struct ib_uverbs_open_xrcd_resp resp = {}; in ib_uverbs_open_xrcd() local
641 resp.xrcd_handle = obj->uobject.id; in ib_uverbs_open_xrcd()
642 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_open_xrcd()
697 struct ib_uverbs_reg_mr_resp resp = {}; in ib_uverbs_reg_mr() local
752 resp.lkey = mr->lkey; in ib_uverbs_reg_mr()
753 resp.rkey = mr->rkey; in ib_uverbs_reg_mr()
754 resp.mr_handle = uobj->id; in ib_uverbs_reg_mr()
755 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_reg_mr()
767 struct ib_uverbs_rereg_mr_resp resp; in ib_uverbs_rereg_mr() local
871 memset(&resp, 0, sizeof(resp)); in ib_uverbs_rereg_mr()
872 resp.lkey = mr->lkey; in ib_uverbs_rereg_mr()
873 resp.rkey = mr->rkey; in ib_uverbs_rereg_mr()
875 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_rereg_mr()
906 struct ib_uverbs_alloc_mw_resp resp = {}; in ib_uverbs_alloc_mw() local
953 resp.rkey = mw->rkey; in ib_uverbs_alloc_mw()
954 resp.mw_handle = uobj->id; in ib_uverbs_alloc_mw()
955 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_alloc_mw()
981 struct ib_uverbs_create_comp_channel_resp resp; in ib_uverbs_create_comp_channel() local
1000 resp.fd = uobj->id; in ib_uverbs_create_comp_channel()
1001 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_create_comp_channel()
1011 struct ib_uverbs_ex_create_cq_resp resp = {}; in create_cq() local
1065 resp.base.cq_handle = obj->uevent.uobject.id; in create_cq()
1066 resp.base.cqe = cq->cqe; in create_cq()
1067 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in create_cq()
1068 return uverbs_response(attrs, &resp, sizeof(resp)); in create_cq()
1121 struct ib_uverbs_resize_cq_resp resp = {}; in ib_uverbs_resize_cq() local
1137 resp.cqe = cq->cqe; in ib_uverbs_resize_cq()
1139 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_resize_cq()
1180 struct ib_uverbs_poll_cq_resp resp; in ib_uverbs_poll_cq() local
1197 data_ptr = header_ptr + sizeof resp; in ib_uverbs_poll_cq()
1199 memset(&resp, 0, sizeof resp); in ib_uverbs_poll_cq()
1200 while (resp.count < cmd.ne) { in ib_uverbs_poll_cq()
1212 ++resp.count; in ib_uverbs_poll_cq()
1215 if (copy_to_user(header_ptr, &resp, sizeof resp)) { in ib_uverbs_poll_cq()
1255 struct ib_uverbs_destroy_cq_resp resp; in ib_uverbs_destroy_cq() local
1269 memset(&resp, 0, sizeof(resp)); in ib_uverbs_destroy_cq()
1270 resp.comp_events_reported = obj->comp_events_reported; in ib_uverbs_destroy_cq()
1271 resp.async_events_reported = obj->uevent.events_reported; in ib_uverbs_destroy_cq()
1275 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_destroy_cq()
1290 struct ib_uverbs_ex_create_qp_resp resp = {}; in create_qp() local
1472 resp.base.qpn = qp->qp_num; in create_qp()
1473 resp.base.qp_handle = obj->uevent.uobject.id; in create_qp()
1474 resp.base.max_recv_sge = attr.cap.max_recv_sge; in create_qp()
1475 resp.base.max_send_sge = attr.cap.max_send_sge; in create_qp()
1476 resp.base.max_recv_wr = attr.cap.max_recv_wr; in create_qp()
1477 resp.base.max_send_wr = attr.cap.max_send_wr; in create_qp()
1478 resp.base.max_inline_data = attr.cap.max_inline_data; in create_qp()
1479 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in create_qp()
1480 return uverbs_response(attrs, &resp, sizeof(resp)); in create_qp()
1551 struct ib_uverbs_create_qp_resp resp = {}; in ib_uverbs_open_qp() local
1604 resp.qpn = qp->qp_num; in ib_uverbs_open_qp()
1605 resp.qp_handle = obj->uevent.uobject.id; in ib_uverbs_open_qp()
1606 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_open_qp()
1640 struct ib_uverbs_query_qp_resp resp; in ib_uverbs_query_qp() local
1671 memset(&resp, 0, sizeof resp); in ib_uverbs_query_qp()
1673 resp.qp_state = attr->qp_state; in ib_uverbs_query_qp()
1674 resp.cur_qp_state = attr->cur_qp_state; in ib_uverbs_query_qp()
1675 resp.path_mtu = attr->path_mtu; in ib_uverbs_query_qp()
1676 resp.path_mig_state = attr->path_mig_state; in ib_uverbs_query_qp()
1677 resp.qkey = attr->qkey; in ib_uverbs_query_qp()
1678 resp.rq_psn = attr->rq_psn; in ib_uverbs_query_qp()
1679 resp.sq_psn = attr->sq_psn; in ib_uverbs_query_qp()
1680 resp.dest_qp_num = attr->dest_qp_num; in ib_uverbs_query_qp()
1681 resp.qp_access_flags = attr->qp_access_flags; in ib_uverbs_query_qp()
1682 resp.pkey_index = attr->pkey_index; in ib_uverbs_query_qp()
1683 resp.alt_pkey_index = attr->alt_pkey_index; in ib_uverbs_query_qp()
1684 resp.sq_draining = attr->sq_draining; in ib_uverbs_query_qp()
1685 resp.max_rd_atomic = attr->max_rd_atomic; in ib_uverbs_query_qp()
1686 resp.max_dest_rd_atomic = attr->max_dest_rd_atomic; in ib_uverbs_query_qp()
1687 resp.min_rnr_timer = attr->min_rnr_timer; in ib_uverbs_query_qp()
1688 resp.port_num = attr->port_num; in ib_uverbs_query_qp()
1689 resp.timeout = attr->timeout; in ib_uverbs_query_qp()
1690 resp.retry_cnt = attr->retry_cnt; in ib_uverbs_query_qp()
1691 resp.rnr_retry = attr->rnr_retry; in ib_uverbs_query_qp()
1692 resp.alt_port_num = attr->alt_port_num; in ib_uverbs_query_qp()
1693 resp.alt_timeout = attr->alt_timeout; in ib_uverbs_query_qp()
1695 copy_ah_attr_to_uverbs(&resp.dest, &attr->ah_attr); in ib_uverbs_query_qp()
1696 copy_ah_attr_to_uverbs(&resp.alt_dest, &attr->alt_ah_attr); in ib_uverbs_query_qp()
1698 resp.max_send_wr = init_attr->cap.max_send_wr; in ib_uverbs_query_qp()
1699 resp.max_recv_wr = init_attr->cap.max_recv_wr; in ib_uverbs_query_qp()
1700 resp.max_send_sge = init_attr->cap.max_send_sge; in ib_uverbs_query_qp()
1701 resp.max_recv_sge = init_attr->cap.max_recv_sge; in ib_uverbs_query_qp()
1702 resp.max_inline_data = init_attr->cap.max_inline_data; in ib_uverbs_query_qp()
1703 resp.sq_sig_all = init_attr->sq_sig_type == IB_SIGNAL_ALL_WR; in ib_uverbs_query_qp()
1705 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_query_qp()
1934 struct ib_uverbs_ex_modify_qp_resp resp = { in ib_uverbs_ex_modify_qp() local
1935 .response_length = uverbs_response_length(attrs, sizeof(resp)) in ib_uverbs_ex_modify_qp()
1954 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_modify_qp()
1960 struct ib_uverbs_destroy_qp_resp resp; in ib_uverbs_destroy_qp() local
1974 memset(&resp, 0, sizeof(resp)); in ib_uverbs_destroy_qp()
1975 resp.events_reported = obj->uevent.events_reported; in ib_uverbs_destroy_qp()
1979 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_destroy_qp()
1996 struct ib_uverbs_post_send_resp resp; in ib_uverbs_post_send() local
2156 resp.bad_wr = 0; in ib_uverbs_post_send()
2160 ++resp.bad_wr; in ib_uverbs_post_send()
2165 ret2 = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_post_send()
2288 struct ib_uverbs_post_recv_resp resp; in ib_uverbs_post_recv() local
2310 resp.bad_wr = 0; in ib_uverbs_post_recv()
2317 ++resp.bad_wr; in ib_uverbs_post_recv()
2323 ret2 = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_post_recv()
2339 struct ib_uverbs_post_srq_recv_resp resp; in ib_uverbs_post_srq_recv() local
2361 resp.bad_wr = 0; in ib_uverbs_post_srq_recv()
2369 ++resp.bad_wr; in ib_uverbs_post_srq_recv()
2374 ret2 = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_post_srq_recv()
2391 struct ib_uverbs_create_ah_resp resp; in ib_uverbs_create_ah() local
2448 resp.ah_handle = uobj->id; in ib_uverbs_create_ah()
2449 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_create_ah()
2883 struct ib_uverbs_ex_create_wq_resp resp = {}; in ib_uverbs_ex_create_wq() local
2949 resp.wq_handle = obj->uevent.uobject.id; in ib_uverbs_ex_create_wq()
2950 resp.max_sge = wq_init_attr.max_sge; in ib_uverbs_ex_create_wq()
2951 resp.max_wr = wq_init_attr.max_wr; in ib_uverbs_ex_create_wq()
2952 resp.wqn = wq->wq_num; in ib_uverbs_ex_create_wq()
2953 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_create_wq()
2954 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_create_wq()
2970 struct ib_uverbs_ex_destroy_wq_resp resp = {}; in ib_uverbs_ex_destroy_wq() local
2982 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_destroy_wq()
2988 resp.events_reported = obj->uevent.events_reported; in ib_uverbs_ex_destroy_wq()
2992 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_destroy_wq()
3049 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()
3142 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_create_rwq_ind_table()
3179 struct ib_uverbs_create_flow_resp resp = {}; in ib_uverbs_ex_create_flow() local
3325 resp.flow_handle = uobj->id; in ib_uverbs_ex_create_flow()
3326 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_create_flow()
3362 struct ib_uverbs_create_srq_resp resp = {}; in __uverbs_create_xsrq() local
3434 resp.srqn = srq->ext.xrc.srq_num; in __uverbs_create_xsrq()
3446 resp.srq_handle = obj->uevent.uobject.id; in __uverbs_create_xsrq()
3447 resp.max_wr = attr.attr.max_wr; in __uverbs_create_xsrq()
3448 resp.max_sge = attr.attr.max_sge; in __uverbs_create_xsrq()
3449 return uverbs_response(attrs, &resp, sizeof(resp)); in __uverbs_create_xsrq()
3533 struct ib_uverbs_query_srq_resp resp; in ib_uverbs_query_srq() local
3554 memset(&resp, 0, sizeof resp); in ib_uverbs_query_srq()
3556 resp.max_wr = attr.max_wr; in ib_uverbs_query_srq()
3557 resp.max_sge = attr.max_sge; in ib_uverbs_query_srq()
3558 resp.srq_limit = attr.srq_limit; in ib_uverbs_query_srq()
3560 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_query_srq()
3566 struct ib_uverbs_destroy_srq_resp resp; in ib_uverbs_destroy_srq() local
3580 memset(&resp, 0, sizeof(resp)); in ib_uverbs_destroy_srq()
3581 resp.events_reported = obj->events_reported; in ib_uverbs_destroy_srq()
3585 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_destroy_srq()
3590 struct ib_uverbs_ex_query_device_resp resp = {}; in ib_uverbs_ex_query_device() local
3616 copy_query_dev_fields(ucontext, &resp.base, &attr); in ib_uverbs_ex_query_device()
3618 resp.odp_caps.general_caps = attr.odp_caps.general_caps; in ib_uverbs_ex_query_device()
3619 resp.odp_caps.per_transport_caps.rc_odp_caps = in ib_uverbs_ex_query_device()
3621 resp.odp_caps.per_transport_caps.uc_odp_caps = in ib_uverbs_ex_query_device()
3623 resp.odp_caps.per_transport_caps.ud_odp_caps = in ib_uverbs_ex_query_device()
3625 resp.xrc_odp_caps = attr.odp_caps.per_transport_caps.xrc_odp_caps; in ib_uverbs_ex_query_device()
3627 resp.timestamp_mask = attr.timestamp_mask; in ib_uverbs_ex_query_device()
3628 resp.hca_core_clock = attr.hca_core_clock; in ib_uverbs_ex_query_device()
3629 resp.device_cap_flags_ex = attr.device_cap_flags; in ib_uverbs_ex_query_device()
3630 resp.rss_caps.supported_qpts = attr.rss_caps.supported_qpts; in ib_uverbs_ex_query_device()
3631 resp.rss_caps.max_rwq_indirection_tables = in ib_uverbs_ex_query_device()
3633 resp.rss_caps.max_rwq_indirection_table_size = in ib_uverbs_ex_query_device()
3635 resp.max_wq_type_rq = attr.max_wq_type_rq; in ib_uverbs_ex_query_device()
3636 resp.raw_packet_caps = attr.raw_packet_caps; in ib_uverbs_ex_query_device()
3637 resp.tm_caps.max_rndv_hdr_size = attr.tm_caps.max_rndv_hdr_size; in ib_uverbs_ex_query_device()
3638 resp.tm_caps.max_num_tags = attr.tm_caps.max_num_tags; in ib_uverbs_ex_query_device()
3639 resp.tm_caps.max_ops = attr.tm_caps.max_ops; in ib_uverbs_ex_query_device()
3640 resp.tm_caps.max_sge = attr.tm_caps.max_sge; in ib_uverbs_ex_query_device()
3641 resp.tm_caps.flags = attr.tm_caps.flags; in ib_uverbs_ex_query_device()
3642 resp.cq_moderation_caps.max_cq_moderation_count = in ib_uverbs_ex_query_device()
3644 resp.cq_moderation_caps.max_cq_moderation_period = in ib_uverbs_ex_query_device()
3646 resp.max_dm_size = attr.max_dm_size; in ib_uverbs_ex_query_device()
3647 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_query_device()
3649 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_query_device()
3688 #define UAPI_DEF_WRITE_IO(req, resp) \ argument
3693 .write.req_size = sizeof(req), .write.resp_size = sizeof(resp)
3697 #define UAPI_DEF_WRITE_UDATA_IO(req, resp) \ argument
3698 UAPI_DEF_WRITE_IO(req, resp), \
3703 BUILD_BUG_ON_ZERO(offsetof(resp, driver_data) != \
3704 sizeof(resp))
3716 #define UAPI_DEF_WRITE_IO_EX(req, req_last_member, resp, resp_last_member) \ argument
3719 .write.resp_size = offsetofend(resp, resp_last_member)