Command with response: --------------------- uint32_t command uint16_t in_words uint16_t out_words struct "command struct" Where: 'in_words' is the size of the in buffer/4 (8 + sizeof (struct "command struct")/4 'out_words' is the sizeof (struct "response struct"/)4 'command' is one of: IB_USER_VERBS_CMD_GET_CONTEXT IB_USER_VERBS_CMD_QUERY_DEVICE IB_USER_VERBS_CMD_QUERY_PORT IB_USER_VERBS_CMD_ALLOC_PD IB_USER_VERBS_CMD_CREATE_AH IB_USER_VERBS_CMD_REG_MR IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL IB_USER_VERBS_CMD_CREATE_CQ IB_USER_VERBS_CMD_RESIZE_CQ IB_USER_VERBS_CMD_DESTROY_CQ IB_USER_VERBS_CMD_POLL_CQ IB_USER_VERBS_CMD_CREATE_QP IB_USER_VERBS_CMD_QUERY_QP IB_USER_VERBS_CMD_DESTROY_QP IB_USER_VERBS_CMD_POST_SEND IB_USER_VERBS_CMD_POST_RECV IB_USER_VERBS_CMD_CREATE_SRQ IB_USER_VERBS_CMD_QUERY_SRQ IB_USER_VERBS_CMD_DESTROY_SRQ IB_USER_VERBS_CMD_POST_SRQ_RECV IB_USER_VERBS_CMD_QUERY_GID IB_USER_VERBS_CMD_QUERY_PKEY "command struct " is one of: 'ib_uverbs_query_gid' /* IB_USER_VERBS_CMD_QUERY_GID */ uint64_t response /* address of 'struct ib_uverbs_query_gid_resp' */ uint32_t gid_index uint8_t port_num uint8_t reserved[3] uint64_t driver_data where 'struct ibv_query_gid_resp' is: uint8_t gid[16]; 'ib_uverbs_query_pkey' /* IB_USER_VERBS_CMD_QUERY_PKEY */ uint64_t response; /* address of 'struct ib_uverbs_query_pkey_resp' */ uint32_t pkey_index; uint8_t port_num; uint8_t reserved[3]; uint64_t driver_data; where 'struct ib_uverbs_query_pkey_resp' is: uint16_t pkey; uint16_t reserved; 'ib_uverbs_create_comp_channel' /* IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL */ uint64_t response; /* address of 'struct 'ib_uverbs_create_comp_channel_resp' */ where 'struct ib_uverbs_create_comp_channel_resp' is: uint32_t fd 'ib_uverbs_get_context' /* IB_USER_VERBS_CMD_GET_CONTEXT */ uint64_t response; /* address of 'struct ib_uverbs_get_context_resp' */ uint64_t driver_data[] where 'struct ib_uverbs_get_context_resp' is: uint32_t async_fd; uint32_t num_comp_vectors; 'ib_uverbs_query_device' /* IB_USER_VERBS_CMD_QUERY_DEVICE */ uint64_t response; /* address of 'struct ib_uverbs_query_device_resp' */ uint64_t driver_data[] where 'struct ib_uverbs_query_device_resp' is: uint64_t fw_ver; uint64_t node_guid; uint64_t sys_image_guid; uint64_t max_mr_size; uint64_t page_size_cap; uint32_t vendor_id; uint32_t vendor_part_id; uint32_t hw_ver; uint32_t max_qp; uint32_t max_qp_wr; uint32_t device_cap_flags; uint32_t max_sge; uint32_t max_sge_rd; uint32_t max_cq; uint32_t max_cqe; uint32_t max_mr; uint32_t max_pd; uint32_t max_qp_rd_atom; uint32_t max_ee_rd_atom; uint32_t max_res_rd_atom; uint32_t max_qp_init_rd_atom; uint32_t max_ee_init_rd_atom; uint32_t atomic_cap; uint32_t max_ee; uint32_t max_rdd; uint32_t max_mw; uint32_t max_raw_ipv6_qp; uint32_t max_raw_ethy_qp; uint32_t max_mcast_grp; uint32_t max_mcast_qp_attach; uint32_t max_total_mcast_qp_attach; uint32_t max_ah; uint32_t max_fmr; uint32_t max_map_per_fmr; uint32_t max_srq; uint32_t max_srq_wr; uint32_t max_srq_sge; uint16_t max_pkeys; uint8_t local_ca_ack_delay; uint8_t phys_port_cnt; uint8_t reserved[4]; 'ib_uverbs_query_port' /* IB_USER_VERBS_CMD_QUERY_PORT */ uint64_t response; /* address of 'struct ib_uverbs_query_port_resp' */ uint8_t port_num; uint8_t reserved[7]; uint64_t driver_data[]; where 'struct ib_uverbs_query_port_resp' is: uint32_t port_cap_flags; uint32_t max_msg_sz; uint32_t bad_pkey_cntr; uint32_t qkey_viol_cntr; uint32_t gid_tbl_len; uint16_t pkey_tbl_len; uint16_t lid; uint16_t sm_lid; uint8_t state; uint8_t max_mtu; uint8_t active_mtu; uint8_t lmc; uint8_t max_vl_num; uint8_t sm_sl; uint8_t subnet_timeout; uint8_t init_type_reply; uint8_t active_width; uint8_t active_speed; uint8_t phys_state; uint8_t reserved[3]; 'ib_uverbs_alloc_pd' /* IB_USER_VERBS_CMD_ALLOC_PD */ uint64_t response; /* address of 'struct ib_uverbs_alloc_pd_resp' */ uint64_t driver_data[]; Where 'struct ib_uverbs_alloc_pd_resp' is: uint32_t pd_handle; uint32_t reserved; uint64_t drv_out[24]; 'ib_uverbs_reg_mr' /* IB_USER_VERBS_CMD_REG_MR */ uint64_t response; /* address of 'struct ib_uverbs_reg_mr_resp' */ uint64_t start; uint64_t length; uint64_t hca_va; uint32_t pd_handle; uint32_t access_flags; uint64_t driver_data[]; Where 'struct ib_uverbs_reg_mr_resp' is: uint32_t mr_handle; uint32_t lkey; uint32_t rkey; 'ib_uverbs_create_cq' /* IB_USER_VERBS_CMD_CREATE_CQ */ uint64_t response; /* address of 'struct ib_uverbs_create_cq_resp' */ uint64_t user_handle; uint32_t cqe; uint32_t comp_vector; int32_t comp_channel; uint32_t reserved; uint64_t driver_data[]; Where 'struct ib_uverbs_create_cq_resp' is: uint32_t cq_handle; uint32_t cqe; uint64_t drv_out[[24]; 'ib_uverbs_poll_cq' /* IB_USER_VERBS_CMD_POLL_CQ */ uint64_t response; /* address of 'struct ib_uverbs_poll_cq_resp' */ uint32_t cq_handle; uint32_t ne; Where 'struct ib_uverbs_poll_cq_resp' is: uint32_t count; uint32_t reserved; struct ib_uverbs_wc wc[]; And 'struct ib_uverbs_wc' is: uint64_t wr_id; uint32_t status; uint32_t opcode; uint32_t vendor_err; uint32_t byte_len; uint32_t imm_data; uint32_t qp_num; uint32_t src_qp; uint32_t wc_flags; uint16_t pkey_index; uint16_t slid; uint8_t sl; uint8_t dlid_path_bits; uint8_t port_num; uint8_t reserved; 'ib_uverbs_resize_cq' /* IB_USER_VERBS_CMD_RESIZE_CQ */ uint64_t response; /* address of 'struct ib_uverbs_resize_cq_resp' */ uint32_t cq_handle; uint32_t cqe; uint64_t driver_data[]; Where 'struct ib_uverbs_resize_cq_resp' is: uint32_t cqe; uint32_t reserved; uint64_t drv_out[24] 'ib_uverbs_destroy_cq' /* IB_USER_VERBS_CMD_DESTROY_CQ */ uint64_t response; /* address of 'struct ib_uverbs_destroy_cq_resp' */ uint32_t cq_handle; uint32_t reserved; Where 'struct ib_uverbs_destroy_cq_resp' is: uint32_t comp_events_reported; uint32_t async_events_reported; 'ib_uverbs_create_srq' /* IB_USER_VERBS_CMD_CREATE_SRQ */ uint64_t response; /* address of 'struct ib_uverbs_create_srq_resp' */ uint64_t user_handle; uint32_t pd_handle; uint32_t max_wr; uint32_t max_sge; uint32_t srq_limit; uint64_t driver_data[]; Where 'struct ib_uverbs_create_srq_resp' is: uint32_t srq_handle; uint32_t max_wr; uint32_t max_sge; uint32_t reserved; uint64_t drv_out[24] 'ib_uverbs_query_srq' /* IB_USER_VERBS_CMD_QUERY_SRQ */ uint64_t response; /* address of 'struct ib_uverbs_query_srq_resp' */ uint32_t srq_handle; uint32_t reserved; uint64_t driver_data[]; Where 'struct ib_uverbs_query_srq_resp' is: uint32_t max_wr; uint32_t max_sge; uint32_t srq_limit; uint32_t reserved; 'ib_uverbs_destroy_srq' /* IB_USER_VERBS_CMD_DESTROY_SRQ */ uint64_t response; /* address of 'struct ib_uverbs_destroy_srq_resp' */ uint32_t srq_handle; uint32_t reserved; Where 'struct ib_uverbs_destroy_srq_resp' is: uint32_t events_reported; 'ib_uverbs_create_qp' /* IB_USER_VERBS_CMD_CREATE_QP */ uint64_t response; /* address of 'struct ib_uverbs_create_qp_resp' */ uint64_t user_handle; uint32_t pd_handle; uint32_t send_cq_handle; uint32_t recv_cq_handle; uint32_t srq_handle; uint32_t max_send_wr; uint32_t max_recv_wr; uint32_t max_send_sge; uint32_t max_recv_sge; uint32_t max_inline_data; uint8_t sq_sig_all; uint8_t qp_type; uint8_t is_srq; uint8_t reserved; uint64_t driver_data[]; Where 'struct ib_uverbs_create_qp_resp' is: uint32_t qp_handle; uint32_t qpn; uint32_t max_send_wr; uint32_t max_recv_wr; uint32_t max_send_sge; uint32_t max_recv_sge; uint32_t max_inline_data; uint32_t reserved; uint64_t drv_out[24]; 'ib_uverbs_query_qp' /* IB_USER_VERBS_CMD_QUERY_QP */ uint64_t response; /* address of 'struct ib_uverbs_query_qp_resp' */ uint32_t qp_handle; uint32_t attr_mask; uint64_t driver_data[]; Where 'struct ib_uverbs_query_qp_resp' is: struct ib_uverbs_qp_dest dest; struct ib_uverbs_qp_dest alt_dest; uint32_t max_send_wr; uint32_t max_recv_wr; uint32_t max_send_sge; uint32_t max_recv_sge; uint32_t max_inline_data; uint32_t qkey; uint32_t rq_psn; uint32_t sq_psn; uint32_t dest_qp_num; uint32_t qp_access_flags; uint16_t pkey_index; uint16_t alt_pkey_index; uint8_t qp_state; uint8_t cur_qp_state; uint8_t path_mtu; uint8_t path_mig_state; uint8_t sq_draining; uint8_t max_rd_atomic; uint8_t max_dest_rd_atomic; uint8_t min_rnr_timer; uint8_t port_num; uint8_t timeout; uint8_t retry_cnt; uint8_t rnr_retry; uint8_t alt_port_num; uint8_t alt_timeout; uint8_t sq_sig_all; uint8_t reserved[5]; uint64_t driver_data[]; And 'struct ib_uverbs_qp_dest' is: uint8_t dgid[16]; uint32_t flow_label; uint16_t dlid; uint16_t reserved; uint8_t sgid_index; uint8_t hop_limit; uint8_t traffic_class; uint8_t sl; uint8_t src_path_bits; uint8_t static_rate; uint8_t is_global; uint8_t port_num; 'ib_uverbs_post_send' /* IB_USER_VERBS_CMD_POST_SEND */ uint64_t response; /* address of 'struct ib_uverbs_post_send_resp' */ uint32_t qp_handle; uint32_t wr_count; uint32_t sge_count; uint32_t wqe_size; struct ib_uverbs_send_wr send_wr[]; Where 'struct ib_uverbs_send_wr' is: uint64_t wr_id; uint32_t num_sge; uint32_t opcode; uint32_t send_flags; uint32_t imm_data; union { struct { uint64_t remote_addr; uint32_trkey; uint32_t reserved; } rdma; struct { uint64_t remote_addr; uint64_t compare_add; uint64_t swap; uint32_t rkey; uint32_t reserved; } atomic; struct { uint32_t ah; uint32_t remote_qpn; uint32_t remote_qkey; uint32_t reserved; } ud; } wr; And 'struct ib_uverbs_post_send_resp' is: uint32_t bad_wr; 'ib_uverbs_post_recv' /* IB_USER_VERBS_CMD_POST_RECV */ uint64_t response; /* address of 'struct ib_uverbs_post_recv_resp' */ uint32_t qp_handle; uint32_t wr_count; uint32_t sge_count; uint32_t wqe_size; struct ib_uverbs_recv_wr recv_wr[]; Where 'struct ib_uverbs_recv_wr' is: uint64_t wr_id; uint32_t num_sge; uint32_t reserved; And ''struct ib_uverbs_post_recv_resp' is: uint32_t bad_wr; 'ib_uverbs_post_srq_recv' /* IB_USER_VERBS_CMD_POST_SRQ_RECV */ uint64_t response; /* address of 'struct ib_uverbs_post_srq_recv_resp' */ uint32_t srq_handle; uint32_t wr_count; uint32_t sge_count; uint32_t wqe_size; struct ib_uverbs_recv_wr recv[]; Where 'struct ib_uverbs_post_srq_recv_resp' is: uint32_t bad_wr; 'ib_uverbs_create_ah' /* IB_USER_VERBS_CMD_CREATE_AH */ uint64_t response; /* address of 'struct ib_uverbs_create_ah_resp' */ uint64_t user_handle; uint32_t pd_handle; uint32_t reserved; struct ib_uverbs_ah_attr attr; Where 'struct ib_uverbs_create_ah_resp' is: uint32_t ah_handle; 'ib_uverbs_destroy_qp' /* IB_USER_VERBS_CMD_DESTROY_QP */ uint64_t response; /* address of 'struct ib_uverbs_destroy_qp_resp' */ uint32_t qp_handle; uint32_t reserved; Where 'struct ib_uverbs_destroy_qp_resp' is: uint32_t events_reported; Command with no response: ------------------------- uint32_t command uint16_t in_words uint16_t out_words struct "command struct" Where: 'in_words' is the size of the in buffer/4 (8 + sizeof (struct "command struct")/4 'out_words' is '0' 'command' is one of: IB_USER_VERBS_CMD_DEALLOC_PD IB_USER_VERBS_CMD_DESTROY_AH IB_USER_VERBS_CMD_DEREG_MR IB_USER_VERBS_CMD_REQ_NOTIFY_CQ IB_USER_VERBS_CMD_MODIFY_QP IB_USER_VERBS_CMD_ATTACH_MCAST IB_USER_VERBS_CMD_DETACH_MCAST IB_USER_VERBS_CMD_MODIFY_SRQ IB_USER_VERBS_CMD_DESTROY_SRQ "command struct" is one of: 'ib_uverbs_dealloc_pd' /* IB_USER_VERBS_CMD_DEALLOC_PD */ uint32_t pd_handle; 'ib_uverbs_dereg_mr' uint32_t mr_handle; 'ib_uverbs_req_notify_cq' /* IB_USER_VERBS_CMD_REQ_NOTIFY_CQ */ uint32_t cq_handle; uint32_t solicited_only; 'ib_uverbs_modify_srq' /* IB_USER_VERBS_CMD_MODIFY_SRQ */ uint32_t srq_handle; uint32_t attr_mask; uint32_t max_wr; uint32_t srq_limit; uint64_t driver_data[]; 'ib_uverbs_modify_qp' /* IB_USER_VERBS_CMD_MODIFY_QP */ struct ib_uverbs_qp_dest dest; struct ib_uverbs_qp_dest alt_dest; uint32_t qp_handle; uint32_t attr_mask; unit32_t qkey; uint32_t rq_psn; uint32_t sq_psn; uint32_t dest_qp_num; uint32_t qp_access_flags; uint16_t pkey_index; uint16_t alt_pkey_index; uint8_t qp_state; uint8_t cur_qp_state; uint8_t path_mtu; uint8_t path_mig_state; uint8_t en_sqd_async_notify; uint8_t max_rd_atomic; uint8_t max_dest_rd_atomic; uint8_t min_rnr_timer; uint8_t port_num; uint8_t timeout; uint8_t retry_cnt; uint8_t rnr_retry; uint8_t alt_port_num; uint8_t alt_timeout; uint8_t reserved[2]; uint64_t driver_data[]; 'ib_uverbs_destroy_ah' /* IB_USER_VERBS_CMD_DESTROY_AH */ uint32_t ah_handle; 'ib_uverbs_attach_mcast' /* IB_USER_VERBS_CMD_ATTACH_MCAST */ uint8_t gid[16]; uint32_t qp_handle; uint16_t mlid; uint16_t reserved; uint64_t driver_data[]; 'ib_uverbs_detach_mcast' /* IB_USER_VERBS_CMD_DETACH_MCAST */ uint8_t gid[16]; uint32_t qp_handle; uint16_t mlid; uint16_t reserved; uint64_t driver_data[];