Lines Matching full:resp

51  * Copy a response to userspace. If the provided 'resp' is larger than the
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 = ib_dev->phys_port_cnt; 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()
698 struct ib_uverbs_reg_mr_resp resp = {}; in ib_uverbs_reg_mr() local
761 resp.lkey = mr->lkey; in ib_uverbs_reg_mr()
762 resp.rkey = mr->rkey; in ib_uverbs_reg_mr()
763 resp.mr_handle = uobj->id; in ib_uverbs_reg_mr()
764 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_reg_mr()
776 struct ib_uverbs_rereg_mr_resp resp; in ib_uverbs_rereg_mr() local
838 memset(&resp, 0, sizeof(resp)); in ib_uverbs_rereg_mr()
839 resp.lkey = mr->lkey; in ib_uverbs_rereg_mr()
840 resp.rkey = mr->rkey; in ib_uverbs_rereg_mr()
842 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_rereg_mr()
869 struct ib_uverbs_alloc_mw_resp resp = {}; in ib_uverbs_alloc_mw() local
916 resp.rkey = mw->rkey; in ib_uverbs_alloc_mw()
917 resp.mw_handle = uobj->id; in ib_uverbs_alloc_mw()
918 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_alloc_mw()
944 struct ib_uverbs_create_comp_channel_resp resp; in ib_uverbs_create_comp_channel() local
963 resp.fd = uobj->id; in ib_uverbs_create_comp_channel()
964 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_create_comp_channel()
974 struct ib_uverbs_ex_create_cq_resp resp = {}; in create_cq() local
1028 resp.base.cq_handle = obj->uevent.uobject.id; in create_cq()
1029 resp.base.cqe = cq->cqe; in create_cq()
1030 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in create_cq()
1031 return uverbs_response(attrs, &resp, sizeof(resp)); in create_cq()
1084 struct ib_uverbs_resize_cq_resp resp = {}; in ib_uverbs_resize_cq() local
1100 resp.cqe = cq->cqe; in ib_uverbs_resize_cq()
1102 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_resize_cq()
1143 struct ib_uverbs_poll_cq_resp resp; in ib_uverbs_poll_cq() local
1160 data_ptr = header_ptr + sizeof resp; in ib_uverbs_poll_cq()
1162 memset(&resp, 0, sizeof resp); in ib_uverbs_poll_cq()
1163 while (resp.count < cmd.ne) { in ib_uverbs_poll_cq()
1175 ++resp.count; in ib_uverbs_poll_cq()
1178 if (copy_to_user(header_ptr, &resp, sizeof resp)) { in ib_uverbs_poll_cq()
1218 struct ib_uverbs_destroy_cq_resp resp; in ib_uverbs_destroy_cq() local
1232 memset(&resp, 0, sizeof(resp)); in ib_uverbs_destroy_cq()
1233 resp.comp_events_reported = obj->comp_events_reported; in ib_uverbs_destroy_cq()
1234 resp.async_events_reported = obj->uevent.events_reported; in ib_uverbs_destroy_cq()
1238 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_destroy_cq()
1253 struct ib_uverbs_ex_create_qp_resp resp = {}; in create_qp() local
1458 resp.base.qpn = qp->qp_num; in create_qp()
1459 resp.base.qp_handle = obj->uevent.uobject.id; in create_qp()
1460 resp.base.max_recv_sge = attr.cap.max_recv_sge; in create_qp()
1461 resp.base.max_send_sge = attr.cap.max_send_sge; in create_qp()
1462 resp.base.max_recv_wr = attr.cap.max_recv_wr; in create_qp()
1463 resp.base.max_send_wr = attr.cap.max_send_wr; in create_qp()
1464 resp.base.max_inline_data = attr.cap.max_inline_data; in create_qp()
1465 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in create_qp()
1466 return uverbs_response(attrs, &resp, sizeof(resp)); in create_qp()
1540 struct ib_uverbs_create_qp_resp resp = {}; in ib_uverbs_open_qp() local
1593 resp.qpn = qp->qp_num; in ib_uverbs_open_qp()
1594 resp.qp_handle = obj->uevent.uobject.id; in ib_uverbs_open_qp()
1595 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_open_qp()
1629 struct ib_uverbs_query_qp_resp resp; in ib_uverbs_query_qp() local
1660 memset(&resp, 0, sizeof resp); in ib_uverbs_query_qp()
1662 resp.qp_state = attr->qp_state; in ib_uverbs_query_qp()
1663 resp.cur_qp_state = attr->cur_qp_state; in ib_uverbs_query_qp()
1664 resp.path_mtu = attr->path_mtu; in ib_uverbs_query_qp()
1665 resp.path_mig_state = attr->path_mig_state; in ib_uverbs_query_qp()
1666 resp.qkey = attr->qkey; in ib_uverbs_query_qp()
1667 resp.rq_psn = attr->rq_psn; in ib_uverbs_query_qp()
1668 resp.sq_psn = attr->sq_psn; in ib_uverbs_query_qp()
1669 resp.dest_qp_num = attr->dest_qp_num; in ib_uverbs_query_qp()
1670 resp.qp_access_flags = attr->qp_access_flags; in ib_uverbs_query_qp()
1671 resp.pkey_index = attr->pkey_index; in ib_uverbs_query_qp()
1672 resp.alt_pkey_index = attr->alt_pkey_index; in ib_uverbs_query_qp()
1673 resp.sq_draining = attr->sq_draining; in ib_uverbs_query_qp()
1674 resp.max_rd_atomic = attr->max_rd_atomic; in ib_uverbs_query_qp()
1675 resp.max_dest_rd_atomic = attr->max_dest_rd_atomic; in ib_uverbs_query_qp()
1676 resp.min_rnr_timer = attr->min_rnr_timer; in ib_uverbs_query_qp()
1677 resp.port_num = attr->port_num; in ib_uverbs_query_qp()
1678 resp.timeout = attr->timeout; in ib_uverbs_query_qp()
1679 resp.retry_cnt = attr->retry_cnt; in ib_uverbs_query_qp()
1680 resp.rnr_retry = attr->rnr_retry; in ib_uverbs_query_qp()
1681 resp.alt_port_num = attr->alt_port_num; in ib_uverbs_query_qp()
1682 resp.alt_timeout = attr->alt_timeout; in ib_uverbs_query_qp()
1684 copy_ah_attr_to_uverbs(&resp.dest, &attr->ah_attr); in ib_uverbs_query_qp()
1685 copy_ah_attr_to_uverbs(&resp.alt_dest, &attr->alt_ah_attr); in ib_uverbs_query_qp()
1687 resp.max_send_wr = init_attr->cap.max_send_wr; in ib_uverbs_query_qp()
1688 resp.max_recv_wr = init_attr->cap.max_recv_wr; in ib_uverbs_query_qp()
1689 resp.max_send_sge = init_attr->cap.max_send_sge; in ib_uverbs_query_qp()
1690 resp.max_recv_sge = init_attr->cap.max_recv_sge; in ib_uverbs_query_qp()
1691 resp.max_inline_data = init_attr->cap.max_inline_data; in ib_uverbs_query_qp()
1692 resp.sq_sig_all = init_attr->sq_sig_type == IB_SIGNAL_ALL_WR; in ib_uverbs_query_qp()
1694 ret = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_query_qp()
1919 struct ib_uverbs_ex_modify_qp_resp resp = { in ib_uverbs_ex_modify_qp() local
1920 .response_length = uverbs_response_length(attrs, sizeof(resp)) in ib_uverbs_ex_modify_qp()
1942 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_modify_qp()
1948 struct ib_uverbs_destroy_qp_resp resp; in ib_uverbs_destroy_qp() local
1962 memset(&resp, 0, sizeof(resp)); in ib_uverbs_destroy_qp()
1963 resp.events_reported = obj->uevent.events_reported; in ib_uverbs_destroy_qp()
1967 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_destroy_qp()
1983 struct ib_uverbs_post_send_resp resp; in ib_uverbs_post_send() local
2143 resp.bad_wr = 0; in ib_uverbs_post_send()
2147 ++resp.bad_wr; in ib_uverbs_post_send()
2152 ret2 = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_post_send()
2275 struct ib_uverbs_post_recv_resp resp; in ib_uverbs_post_recv() local
2297 resp.bad_wr = 0; in ib_uverbs_post_recv()
2304 ++resp.bad_wr; in ib_uverbs_post_recv()
2310 ret2 = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_post_recv()
2326 struct ib_uverbs_post_srq_recv_resp resp; in ib_uverbs_post_srq_recv() local
2348 resp.bad_wr = 0; in ib_uverbs_post_srq_recv()
2356 ++resp.bad_wr; in ib_uverbs_post_srq_recv()
2361 ret2 = uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_post_srq_recv()
2378 struct ib_uverbs_create_ah_resp resp; in ib_uverbs_create_ah() local
2435 resp.ah_handle = uobj->id; in ib_uverbs_create_ah()
2436 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_create_ah()
2870 struct ib_uverbs_ex_create_wq_resp resp = {}; in ib_uverbs_ex_create_wq() local
2936 resp.wq_handle = obj->uevent.uobject.id; in ib_uverbs_ex_create_wq()
2937 resp.max_sge = wq_init_attr.max_sge; in ib_uverbs_ex_create_wq()
2938 resp.max_wr = wq_init_attr.max_wr; in ib_uverbs_ex_create_wq()
2939 resp.wqn = wq->wq_num; in ib_uverbs_ex_create_wq()
2940 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_create_wq()
2941 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_create_wq()
2957 struct ib_uverbs_ex_destroy_wq_resp resp = {}; in ib_uverbs_ex_destroy_wq() local
2969 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_destroy_wq()
2975 resp.events_reported = obj->uevent.events_reported; in ib_uverbs_ex_destroy_wq()
2979 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_destroy_wq()
3019 struct ib_uverbs_ex_create_rwq_ind_table_resp resp = {}; in ib_uverbs_ex_create_rwq_ind_table() local
3109 resp.ind_tbl_handle = uobj->id; in ib_uverbs_ex_create_rwq_ind_table()
3110 resp.ind_tbl_num = rwq_ind_tbl->ind_tbl_num; in ib_uverbs_ex_create_rwq_ind_table()
3111 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_create_rwq_ind_table()
3112 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_create_rwq_ind_table()
3149 struct ib_uverbs_create_flow_resp resp = {}; in ib_uverbs_ex_create_flow() local
3290 resp.flow_handle = uobj->id; in ib_uverbs_ex_create_flow()
3291 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_create_flow()
3327 struct ib_uverbs_create_srq_resp resp = {}; in __uverbs_create_xsrq() local
3399 resp.srqn = srq->ext.xrc.srq_num; in __uverbs_create_xsrq()
3411 resp.srq_handle = obj->uevent.uobject.id; in __uverbs_create_xsrq()
3412 resp.max_wr = attr.attr.max_wr; in __uverbs_create_xsrq()
3413 resp.max_sge = attr.attr.max_sge; in __uverbs_create_xsrq()
3414 return uverbs_response(attrs, &resp, sizeof(resp)); in __uverbs_create_xsrq()
3498 struct ib_uverbs_query_srq_resp resp; in ib_uverbs_query_srq() local
3519 memset(&resp, 0, sizeof resp); in ib_uverbs_query_srq()
3521 resp.max_wr = attr.max_wr; in ib_uverbs_query_srq()
3522 resp.max_sge = attr.max_sge; in ib_uverbs_query_srq()
3523 resp.srq_limit = attr.srq_limit; in ib_uverbs_query_srq()
3525 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_query_srq()
3531 struct ib_uverbs_destroy_srq_resp resp; in ib_uverbs_destroy_srq() local
3545 memset(&resp, 0, sizeof(resp)); in ib_uverbs_destroy_srq()
3546 resp.events_reported = obj->events_reported; in ib_uverbs_destroy_srq()
3550 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_destroy_srq()
3555 struct ib_uverbs_ex_query_device_resp resp = {}; in ib_uverbs_ex_query_device() local
3581 copy_query_dev_fields(ucontext, &resp.base, &attr); in ib_uverbs_ex_query_device()
3583 resp.odp_caps.general_caps = attr.odp_caps.general_caps; in ib_uverbs_ex_query_device()
3584 resp.odp_caps.per_transport_caps.rc_odp_caps = in ib_uverbs_ex_query_device()
3586 resp.odp_caps.per_transport_caps.uc_odp_caps = in ib_uverbs_ex_query_device()
3588 resp.odp_caps.per_transport_caps.ud_odp_caps = in ib_uverbs_ex_query_device()
3590 resp.xrc_odp_caps = attr.odp_caps.per_transport_caps.xrc_odp_caps; in ib_uverbs_ex_query_device()
3592 resp.timestamp_mask = attr.timestamp_mask; in ib_uverbs_ex_query_device()
3593 resp.hca_core_clock = attr.hca_core_clock; in ib_uverbs_ex_query_device()
3594 resp.device_cap_flags_ex = attr.device_cap_flags; in ib_uverbs_ex_query_device()
3595 resp.rss_caps.supported_qpts = attr.rss_caps.supported_qpts; in ib_uverbs_ex_query_device()
3596 resp.rss_caps.max_rwq_indirection_tables = in ib_uverbs_ex_query_device()
3598 resp.rss_caps.max_rwq_indirection_table_size = in ib_uverbs_ex_query_device()
3600 resp.max_wq_type_rq = attr.max_wq_type_rq; in ib_uverbs_ex_query_device()
3601 resp.raw_packet_caps = attr.raw_packet_caps; in ib_uverbs_ex_query_device()
3602 resp.tm_caps.max_rndv_hdr_size = attr.tm_caps.max_rndv_hdr_size; in ib_uverbs_ex_query_device()
3603 resp.tm_caps.max_num_tags = attr.tm_caps.max_num_tags; in ib_uverbs_ex_query_device()
3604 resp.tm_caps.max_ops = attr.tm_caps.max_ops; in ib_uverbs_ex_query_device()
3605 resp.tm_caps.max_sge = attr.tm_caps.max_sge; in ib_uverbs_ex_query_device()
3606 resp.tm_caps.flags = attr.tm_caps.flags; in ib_uverbs_ex_query_device()
3607 resp.cq_moderation_caps.max_cq_moderation_count = in ib_uverbs_ex_query_device()
3609 resp.cq_moderation_caps.max_cq_moderation_period = in ib_uverbs_ex_query_device()
3611 resp.max_dm_size = attr.max_dm_size; in ib_uverbs_ex_query_device()
3612 resp.response_length = uverbs_response_length(attrs, sizeof(resp)); in ib_uverbs_ex_query_device()
3614 return uverbs_response(attrs, &resp, sizeof(resp)); in ib_uverbs_ex_query_device()
3653 #define UAPI_DEF_WRITE_IO(req, resp) \ argument
3658 .write.req_size = sizeof(req), .write.resp_size = sizeof(resp)
3662 #define UAPI_DEF_WRITE_UDATA_IO(req, resp) \ argument
3663 UAPI_DEF_WRITE_IO(req, resp), \
3668 BUILD_BUG_ON_ZERO(offsetof(resp, driver_data) != \
3669 sizeof(resp))
3681 #define UAPI_DEF_WRITE_IO_EX(req, req_last_member, resp, resp_last_member) \ argument
3684 .write.resp_size = offsetofend(resp, resp_last_member)