1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

Added all generated API functions

This commit is contained in:
Annika Wierichs 2018-01-20 12:27:40 +01:00
parent 83b8311fdc
commit 815903dda6
13 changed files with 9873 additions and 337 deletions

View file

@ -40,12 +40,101 @@
extern "C" {
#endif
struct ibv_device ** ibv_get_device_list(int * num_devices);
const char * ibv_get_device_name(struct ibv_device *device);
struct ibv_context * ibv_open_device(struct ibv_device * device);
int ibv_query_port(struct ibv_context * context, uint8_t port_num, struct ibv_port_attr * port_attr);
const char * ibv_wc_status_str(enum ibv_wc_status status);
int ibv_rate_to_mult(enum ibv_rate rate);
enum ibv_rate mult_to_ibv_rate(int mult);
int ibv_rate_to_mbps(enum ibv_rate rate);
enum ibv_rate mbps_to_ibv_rate(int mbps);
struct ibv_cq * ibv_cq_ex_to_cq(struct ibv_cq_ex * cq);
int ibv_start_poll(struct ibv_cq_ex * cq, struct ibv_poll_cq_attr * attr);
int ibv_next_poll(struct ibv_cq_ex * cq);
void ibv_end_poll(struct ibv_cq_ex * cq);
enum ibv_wc_opcode ibv_wc_read_opcode(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_vendor_err(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_byte_len(struct ibv_cq_ex * cq);
__be32 ibv_wc_read_imm_data(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_invalidated_rkey(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_qp_num(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_src_qp(struct ibv_cq_ex * cq);
int ibv_wc_read_wc_flags(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_slid(struct ibv_cq_ex * cq);
uint8_t ibv_wc_read_sl(struct ibv_cq_ex * cq);
uint8_t ibv_wc_read_dlid_path_bits(struct ibv_cq_ex * cq);
uint64_t ibv_wc_read_completion_ts(struct ibv_cq_ex * cq);
uint16_t ibv_wc_read_cvlan(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_flow_tag(struct ibv_cq_ex * cq);
int ibv_post_wq_recv(struct ibv_wq * wq, struct ibv_recv_wr * recv_wr, struct ibv_recv_wr ** bad_recv_wr);
struct verbs_context * verbs_get_ctx(struct ibv_context * ctx);
struct ibv_device ** ibv_get_device_list(int * num_devices);
void ibv_free_device_list(struct ibv_device ** list);
const char * ibv_get_device_name(struct ibv_device * device);
__be64 ibv_get_device_guid(struct ibv_device * device);
struct ibv_context * ibv_open_device(struct ibv_device * device);
int ibv_close_device(struct ibv_context * context);
int ibv_get_async_event(struct ibv_context * context, struct ibv_async_event * event);
void ibv_ack_async_event(struct ibv_async_event * event);
int ibv_query_device(struct ibv_context * context, struct ibv_device_attr * device_attr);
int ibv_query_port(struct ibv_context * context, uint8_t port_num, struct ibv_port_attr * port_attr);
int ___ibv_query_port(struct ibv_context * context, uint8_t port_num, struct ibv_port_attr * port_attr);
int ibv_query_gid(struct ibv_context * context, uint8_t port_num, int index, union ibv_gid * gid);
int ibv_query_pkey(struct ibv_context * context, uint8_t port_num, int index, __be16 * pkey);
struct ibv_pd * ibv_alloc_pd(struct ibv_context * context);
int ibv_dealloc_pd(struct ibv_pd * pd);
struct ibv_flow * ibv_create_flow(struct ibv_qp * qp, struct ibv_flow_attr * flow);
int ibv_destroy_flow(struct ibv_flow * flow_id);
struct ibv_xrcd * ibv_open_xrcd(struct ibv_context * context, struct ibv_xrcd_init_attr * xrcd_init_attr);
int ibv_close_xrcd(struct ibv_xrcd * xrcd);
struct ibv_mr * ibv_reg_mr(struct ibv_pd * pd, void * addr, int length, int access);
int ibv_rereg_mr(struct ibv_mr * mr, int flags, struct ibv_pd * pd, void * addr, int length, int access);
int ibv_dereg_mr(struct ibv_mr * mr);
struct ibv_mw * ibv_alloc_mw(struct ibv_pd * pd, enum ibv_mw_type type);
int ibv_dealloc_mw(struct ibv_mw * mw);
uint32_t ibv_inc_rkey(uint32_t rkey);
int ibv_bind_mw(struct ibv_qp * qp, struct ibv_mw * mw, struct ibv_mw_bind * mw_bind);
struct ibv_comp_channel * ibv_create_comp_channel(struct ibv_context * context);
int ibv_destroy_comp_channel(struct ibv_comp_channel * channel);
struct ibv_cq * ibv_create_cq(struct ibv_context * context, int cqe, void * cq_context, struct ibv_comp_channel * channel, int comp_vector);
struct ibv_cq_ex * ibv_create_cq_ex(struct ibv_context * context, struct ibv_cq_init_attr_ex * cq_attr);
int ibv_resize_cq(struct ibv_cq * cq, int cqe);
int ibv_destroy_cq(struct ibv_cq * cq);
int ibv_get_cq_event(struct ibv_comp_channel * channel, struct ibv_cq ** cq, void ** cq_context);
void ibv_ack_cq_events(struct ibv_cq * cq, unsigned int nevents);
int ibv_poll_cq(struct ibv_cq * cq, int num_entries, struct ibv_wc * wc);
int ibv_req_notify_cq(struct ibv_cq * cq, int solicited_only);
struct ibv_srq * ibv_create_srq(struct ibv_pd * pd, struct ibv_srq_init_attr * srq_init_attr);
struct ibv_srq * ibv_create_srq_ex(struct ibv_context * context, struct ibv_srq_init_attr_ex * srq_init_attr_ex);
int ibv_modify_srq(struct ibv_srq * srq, struct ibv_srq_attr * srq_attr, int srq_attr_mask);
int ibv_query_srq(struct ibv_srq * srq, struct ibv_srq_attr * srq_attr);
int ibv_get_srq_num(struct ibv_srq * srq, uint32_t * srq_num);
int ibv_destroy_srq(struct ibv_srq * srq);
int ibv_post_srq_recv(struct ibv_srq * srq, struct ibv_recv_wr * recv_wr, struct ibv_recv_wr ** bad_recv_wr);
struct ibv_qp * ibv_create_qp(struct ibv_pd * pd, struct ibv_qp_init_attr * qp_init_attr);
struct ibv_qp * ibv_create_qp_ex(struct ibv_context * context, struct ibv_qp_init_attr_ex * qp_init_attr_ex);
int ibv_query_rt_values_ex(struct ibv_context * context, struct ibv_values_ex * values);
int ibv_query_device_ex(struct ibv_context * context, const struct ibv_query_device_ex_input * input, struct ibv_device_attr_ex * attr);
struct ibv_qp * ibv_open_qp(struct ibv_context * context, struct ibv_qp_open_attr * qp_open_attr);
int ibv_modify_qp(struct ibv_qp * qp, struct ibv_qp_attr * attr, int attr_mask);
int ibv_query_qp(struct ibv_qp * qp, struct ibv_qp_attr * attr, int attr_mask, struct ibv_qp_init_attr * init_attr);
int ibv_destroy_qp(struct ibv_qp * qp);
struct ibv_wq * ibv_create_wq(struct ibv_context * context, struct ibv_wq_init_attr * wq_init_attr);
int ibv_modify_wq(struct ibv_wq * wq, struct ibv_wq_attr * wq_attr);
int ibv_destroy_wq(struct ibv_wq * wq);
struct ibv_rwq_ind_table * ibv_create_rwq_ind_table(struct ibv_context * context, struct ibv_rwq_ind_table_init_attr * init_attr);
int ibv_destroy_rwq_ind_table(struct ibv_rwq_ind_table * rwq_ind_table);
int ibv_post_send(struct ibv_qp * qp, struct ibv_send_wr * wr, struct ibv_send_wr ** bad_wr);
int ibv_post_recv(struct ibv_qp * qp, struct ibv_recv_wr * wr, struct ibv_recv_wr ** bad_wr);
struct ibv_ah * ibv_create_ah(struct ibv_pd * pd, struct ibv_ah_attr * attr);
int ibv_init_ah_from_wc(struct ibv_context * context, uint8_t port_num, struct ibv_wc * wc, struct ibv_grh * grh, struct ibv_ah_attr * ah_attr);
struct ibv_ah * ibv_create_ah_from_wc(struct ibv_pd * pd, struct ibv_wc * wc, struct ibv_grh * grh, uint8_t port_num);
int ibv_destroy_ah(struct ibv_ah * ah);
int ibv_attach_mcast(struct ibv_qp * qp, const union ibv_gid * gid, uint16_t lid);
int ibv_detach_mcast(struct ibv_qp * qp, const union ibv_gid * gid, uint16_t lid);
int ibv_fork_init( );
const char * ibv_node_type_str(enum ibv_node_type node_type);
const char * ibv_port_state_str(enum ibv_port_state port_state);
const char * ibv_event_type_str(enum ibv_event_type event);
int ibv_resolve_eth_l2_from_gid(struct ibv_context * context, struct ibv_ah_attr * attr, uint8_t [6] eth_mac, uint16_t * vid);
int ibv_is_qpt_supported(uint32_t caps, enum ibv_qp_type qpt);
void kernel_ibv_log();

View file

@ -67,15 +67,103 @@ extern const size_t image_size;
#define UHYVE_PORT_LSEEK 0x504
// InfiniBand uhyve port IDs
#define UHYVE_PORT_SET_IB_POOL_ADDR 0x609
#define UHYVE_PORT_IBV_OPEN_DEVICE 0x610
#define UHYVE_PORT_IBV_GET_DEVICE_LIST 0x611
#define UHYVE_PORT_IBV_GET_DEVICE_NAME 0x612
#define UHYVE_PORT_IBV_QUERY_PORT 0x613
#define UHYVE_PORT_IBV_CREATE_COMP_CHANNEL 0x614
#define UHYVE_PORT_KERNEL_IBV_LOG 0x515
#define UHYVE_PORT_SET_IB_POOL_ADDR 0x60F
#define UHYVE_PORT_IBV_WC_STATUS_STR 0x610
#define UHYVE_PORT_IBV_RATE_TO_MULT 0x611
#define UHYVE_PORT_MULT_TO_IBV_RATE 0x612
#define UHYVE_PORT_IBV_RATE_TO_MBPS 0x613
#define UHYVE_PORT_MBPS_TO_IBV_RATE 0x614
#define UHYVE_PORT_IBV_CQ_EX_TO_CQ 0x615
#define UHYVE_PORT_IBV_START_POLL 0x616
#define UHYVE_PORT_IBV_NEXT_POLL 0x617
#define UHYVE_PORT_IBV_END_POLL 0x618
#define UHYVE_PORT_IBV_WC_READ_OPCODE 0x619
#define UHYVE_PORT_IBV_WC_READ_VENDOR_ERR 0x61A
#define UHYVE_PORT_IBV_WC_READ_BYTE_LEN 0x61B
#define UHYVE_PORT_IBV_WC_READ_IMM_DATA 0x61C
#define UHYVE_PORT_IBV_WC_READ_INVALIDATED_RKEY 0x61D
#define UHYVE_PORT_IBV_WC_READ_QP_NUM 0x61E
#define UHYVE_PORT_IBV_WC_READ_SRC_QP 0x61F
#define UHYVE_PORT_IBV_WC_READ_WC_FLAGS 0x620
#define UHYVE_PORT_IBV_WC_READ_SLID 0x621
#define UHYVE_PORT_IBV_WC_READ_SL 0x622
#define UHYVE_PORT_IBV_WC_READ_DLID_PATH_BITS 0x623
#define UHYVE_PORT_IBV_WC_READ_COMPLETION_TS 0x624
#define UHYVE_PORT_IBV_WC_READ_CVLAN 0x625
#define UHYVE_PORT_IBV_WC_READ_FLOW_TAG 0x626
#define UHYVE_PORT_IBV_POST_WQ_RECV 0x627
#define UHYVE_PORT_VERBS_GET_CTX 0x628
#define UHYVE_PORT_IBV_GET_DEVICE_LIST 0x629
#define UHYVE_PORT_IBV_FREE_DEVICE_LIST 0x62A
#define UHYVE_PORT_IBV_GET_DEVICE_NAME 0x62B
#define UHYVE_PORT_IBV_GET_DEVICE_GUID 0x62C
#define UHYVE_PORT_IBV_OPEN_DEVICE 0x62D
#define UHYVE_PORT_IBV_CLOSE_DEVICE 0x62E
#define UHYVE_PORT_IBV_GET_ASYNC_EVENT 0x62F
#define UHYVE_PORT_IBV_ACK_ASYNC_EVENT 0x630
#define UHYVE_PORT_IBV_QUERY_DEVICE 0x631
#define UHYVE_PORT_IBV_QUERY_PORT 0x632
#define UHYVE_PORT____IBV_QUERY_PORT 0x633
#define UHYVE_PORT_IBV_QUERY_GID 0x634
#define UHYVE_PORT_IBV_QUERY_PKEY 0x635
#define UHYVE_PORT_IBV_ALLOC_PD 0x636
#define UHYVE_PORT_IBV_DEALLOC_PD 0x637
#define UHYVE_PORT_IBV_CREATE_FLOW 0x638
#define UHYVE_PORT_IBV_DESTROY_FLOW 0x639
#define UHYVE_PORT_IBV_OPEN_XRCD 0x63A
#define UHYVE_PORT_IBV_CLOSE_XRCD 0x63B
#define UHYVE_PORT_IBV_REG_MR 0x63C
#define UHYVE_PORT_IBV_REREG_MR 0x63D
#define UHYVE_PORT_IBV_DEREG_MR 0x63E
#define UHYVE_PORT_IBV_ALLOC_MW 0x63F
#define UHYVE_PORT_IBV_DEALLOC_MW 0x640
#define UHYVE_PORT_IBV_INC_RKEY 0x641
#define UHYVE_PORT_IBV_BIND_MW 0x642
#define UHYVE_PORT_IBV_CREATE_COMP_CHANNEL 0x643
#define UHYVE_PORT_IBV_DESTROY_COMP_CHANNEL 0x644
#define UHYVE_PORT_IBV_CREATE_CQ 0x645
#define UHYVE_PORT_IBV_CREATE_CQ_EX 0x646
#define UHYVE_PORT_IBV_RESIZE_CQ 0x647
#define UHYVE_PORT_IBV_DESTROY_CQ 0x648
#define UHYVE_PORT_IBV_GET_CQ_EVENT 0x649
#define UHYVE_PORT_IBV_ACK_CQ_EVENTS 0x64A
#define UHYVE_PORT_IBV_POLL_CQ 0x64B
#define UHYVE_PORT_IBV_REQ_NOTIFY_CQ 0x64C
#define UHYVE_PORT_IBV_CREATE_SRQ 0x64D
#define UHYVE_PORT_IBV_CREATE_SRQ_EX 0x64E
#define UHYVE_PORT_IBV_MODIFY_SRQ 0x64F
#define UHYVE_PORT_IBV_QUERY_SRQ 0x650
#define UHYVE_PORT_IBV_GET_SRQ_NUM 0x651
#define UHYVE_PORT_IBV_DESTROY_SRQ 0x652
#define UHYVE_PORT_IBV_POST_SRQ_RECV 0x653
#define UHYVE_PORT_IBV_CREATE_QP 0x654
#define UHYVE_PORT_IBV_CREATE_QP_EX 0x655
#define UHYVE_PORT_IBV_QUERY_RT_VALUES_EX 0x656
#define UHYVE_PORT_IBV_QUERY_DEVICE_EX 0x657
#define UHYVE_PORT_IBV_OPEN_QP 0x658
#define UHYVE_PORT_IBV_MODIFY_QP 0x659
#define UHYVE_PORT_IBV_QUERY_QP 0x65A
#define UHYVE_PORT_IBV_DESTROY_QP 0x65B
#define UHYVE_PORT_IBV_CREATE_WQ 0x65C
#define UHYVE_PORT_IBV_MODIFY_WQ 0x65D
#define UHYVE_PORT_IBV_DESTROY_WQ 0x65E
#define UHYVE_PORT_IBV_CREATE_RWQ_IND_TABLE 0x65F
#define UHYVE_PORT_IBV_DESTROY_RWQ_IND_TABLE 0x660
#define UHYVE_PORT_IBV_POST_SEND 0x661
#define UHYVE_PORT_IBV_POST_RECV 0x662
#define UHYVE_PORT_IBV_CREATE_AH 0x663
#define UHYVE_PORT_IBV_INIT_AH_FROM_WC 0x664
#define UHYVE_PORT_IBV_CREATE_AH_FROM_WC 0x665
#define UHYVE_PORT_IBV_DESTROY_AH 0x666
#define UHYVE_PORT_IBV_ATTACH_MCAST 0x667
#define UHYVE_PORT_IBV_DETACH_MCAST 0x668
#define UHYVE_PORT_IBV_FORK_INIT 0x669
#define UHYVE_PORT_IBV_NODE_TYPE_STR 0x66A
#define UHYVE_PORT_IBV_PORT_STATE_STR 0x66B
#define UHYVE_PORT_IBV_EVENT_TYPE_STR 0x66C
#define UHYVE_PORT_IBV_RESOLVE_ETH_L2_FROM_GID 0x66D
#define UHYVE_PORT_IBV_IS_QPT_SUPPORTED 0x66E
#define UHYVE_PORT_KERNEL_IBV_LOG 0x66F
#define BUILTIN_EXPECT(exp, b) __builtin_expect((exp), (b))
//#define BUILTIN_EXPECT(exp, b) (exp)

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,96 @@
#define UHYVE_PORT_IBV_OPEN_DEVICE 0x510
#define UHYVE_PORT_IBV_GET_DEVICE_NAME 0x511
#define UHYVE_PORT_IBV_QUERY_PORT 0x512
#define UHYVE_PORT_IBV_CREATE_COMP_CHANNEL 0x513
#define UHYVE_PORT_SET_IB_POOL_ADDR 0x60F
#define UHYVE_PORT_IBV_WC_STATUS_STR 0x610
#define UHYVE_PORT_IBV_RATE_TO_MULT 0x611
#define UHYVE_PORT_MULT_TO_IBV_RATE 0x612
#define UHYVE_PORT_IBV_RATE_TO_MBPS 0x613
#define UHYVE_PORT_MBPS_TO_IBV_RATE 0x614
#define UHYVE_PORT_IBV_CQ_EX_TO_CQ 0x615
#define UHYVE_PORT_IBV_START_POLL 0x616
#define UHYVE_PORT_IBV_NEXT_POLL 0x617
#define UHYVE_PORT_IBV_END_POLL 0x618
#define UHYVE_PORT_IBV_WC_READ_OPCODE 0x619
#define UHYVE_PORT_IBV_WC_READ_VENDOR_ERR 0x61A
#define UHYVE_PORT_IBV_WC_READ_BYTE_LEN 0x61B
#define UHYVE_PORT_IBV_WC_READ_IMM_DATA 0x61C
#define UHYVE_PORT_IBV_WC_READ_INVALIDATED_RKEY 0x61D
#define UHYVE_PORT_IBV_WC_READ_QP_NUM 0x61E
#define UHYVE_PORT_IBV_WC_READ_SRC_QP 0x61F
#define UHYVE_PORT_IBV_WC_READ_WC_FLAGS 0x620
#define UHYVE_PORT_IBV_WC_READ_SLID 0x621
#define UHYVE_PORT_IBV_WC_READ_SL 0x622
#define UHYVE_PORT_IBV_WC_READ_DLID_PATH_BITS 0x623
#define UHYVE_PORT_IBV_WC_READ_COMPLETION_TS 0x624
#define UHYVE_PORT_IBV_WC_READ_CVLAN 0x625
#define UHYVE_PORT_IBV_WC_READ_FLOW_TAG 0x626
#define UHYVE_PORT_IBV_POST_WQ_RECV 0x627
#define UHYVE_PORT_VERBS_GET_CTX 0x628
#define UHYVE_PORT_IBV_GET_DEVICE_LIST 0x629
#define UHYVE_PORT_IBV_FREE_DEVICE_LIST 0x62A
#define UHYVE_PORT_IBV_GET_DEVICE_NAME 0x62B
#define UHYVE_PORT_IBV_GET_DEVICE_GUID 0x62C
#define UHYVE_PORT_IBV_OPEN_DEVICE 0x62D
#define UHYVE_PORT_IBV_CLOSE_DEVICE 0x62E
#define UHYVE_PORT_IBV_GET_ASYNC_EVENT 0x62F
#define UHYVE_PORT_IBV_ACK_ASYNC_EVENT 0x630
#define UHYVE_PORT_IBV_QUERY_DEVICE 0x631
#define UHYVE_PORT_IBV_QUERY_PORT 0x632
#define UHYVE_PORT____IBV_QUERY_PORT 0x633
#define UHYVE_PORT_IBV_QUERY_GID 0x634
#define UHYVE_PORT_IBV_QUERY_PKEY 0x635
#define UHYVE_PORT_IBV_ALLOC_PD 0x636
#define UHYVE_PORT_IBV_DEALLOC_PD 0x637
#define UHYVE_PORT_IBV_CREATE_FLOW 0x638
#define UHYVE_PORT_IBV_DESTROY_FLOW 0x639
#define UHYVE_PORT_IBV_OPEN_XRCD 0x63A
#define UHYVE_PORT_IBV_CLOSE_XRCD 0x63B
#define UHYVE_PORT_IBV_REG_MR 0x63C
#define UHYVE_PORT_IBV_REREG_MR 0x63D
#define UHYVE_PORT_IBV_DEREG_MR 0x63E
#define UHYVE_PORT_IBV_ALLOC_MW 0x63F
#define UHYVE_PORT_IBV_DEALLOC_MW 0x640
#define UHYVE_PORT_IBV_INC_RKEY 0x641
#define UHYVE_PORT_IBV_BIND_MW 0x642
#define UHYVE_PORT_IBV_CREATE_COMP_CHANNEL 0x643
#define UHYVE_PORT_IBV_DESTROY_COMP_CHANNEL 0x644
#define UHYVE_PORT_IBV_CREATE_CQ 0x645
#define UHYVE_PORT_IBV_CREATE_CQ_EX 0x646
#define UHYVE_PORT_IBV_RESIZE_CQ 0x647
#define UHYVE_PORT_IBV_DESTROY_CQ 0x648
#define UHYVE_PORT_IBV_GET_CQ_EVENT 0x649
#define UHYVE_PORT_IBV_ACK_CQ_EVENTS 0x64A
#define UHYVE_PORT_IBV_POLL_CQ 0x64B
#define UHYVE_PORT_IBV_REQ_NOTIFY_CQ 0x64C
#define UHYVE_PORT_IBV_CREATE_SRQ 0x64D
#define UHYVE_PORT_IBV_CREATE_SRQ_EX 0x64E
#define UHYVE_PORT_IBV_MODIFY_SRQ 0x64F
#define UHYVE_PORT_IBV_QUERY_SRQ 0x650
#define UHYVE_PORT_IBV_GET_SRQ_NUM 0x651
#define UHYVE_PORT_IBV_DESTROY_SRQ 0x652
#define UHYVE_PORT_IBV_POST_SRQ_RECV 0x653
#define UHYVE_PORT_IBV_CREATE_QP 0x654
#define UHYVE_PORT_IBV_CREATE_QP_EX 0x655
#define UHYVE_PORT_IBV_QUERY_RT_VALUES_EX 0x656
#define UHYVE_PORT_IBV_QUERY_DEVICE_EX 0x657
#define UHYVE_PORT_IBV_OPEN_QP 0x658
#define UHYVE_PORT_IBV_MODIFY_QP 0x659
#define UHYVE_PORT_IBV_QUERY_QP 0x65A
#define UHYVE_PORT_IBV_DESTROY_QP 0x65B
#define UHYVE_PORT_IBV_CREATE_WQ 0x65C
#define UHYVE_PORT_IBV_MODIFY_WQ 0x65D
#define UHYVE_PORT_IBV_DESTROY_WQ 0x65E
#define UHYVE_PORT_IBV_CREATE_RWQ_IND_TABLE 0x65F
#define UHYVE_PORT_IBV_DESTROY_RWQ_IND_TABLE 0x660
#define UHYVE_PORT_IBV_POST_SEND 0x661
#define UHYVE_PORT_IBV_POST_RECV 0x662
#define UHYVE_PORT_IBV_CREATE_AH 0x663
#define UHYVE_PORT_IBV_INIT_AH_FROM_WC 0x664
#define UHYVE_PORT_IBV_CREATE_AH_FROM_WC 0x665
#define UHYVE_PORT_IBV_DESTROY_AH 0x666
#define UHYVE_PORT_IBV_ATTACH_MCAST 0x667
#define UHYVE_PORT_IBV_DETACH_MCAST 0x668
#define UHYVE_PORT_IBV_FORK_INIT 0x669
#define UHYVE_PORT_IBV_NODE_TYPE_STR 0x66A
#define UHYVE_PORT_IBV_PORT_STATE_STR 0x66B
#define UHYVE_PORT_IBV_EVENT_TYPE_STR 0x66C
#define UHYVE_PORT_IBV_RESOLVE_ETH_L2_FROM_GID 0x66D
#define UHYVE_PORT_IBV_IS_QPT_SUPPORTED 0x66E

View file

@ -0,0 +1,95 @@
const char * ibv_wc_status_str(enum ibv_wc_status status);
int ibv_rate_to_mult(enum ibv_rate rate);
enum ibv_rate mult_to_ibv_rate(int mult);
int ibv_rate_to_mbps(enum ibv_rate rate);
enum ibv_rate mbps_to_ibv_rate(int mbps);
struct ibv_cq * ibv_cq_ex_to_cq(struct ibv_cq_ex * cq);
int ibv_start_poll(struct ibv_cq_ex * cq, struct ibv_poll_cq_attr * attr);
int ibv_next_poll(struct ibv_cq_ex * cq);
void ibv_end_poll(struct ibv_cq_ex * cq);
enum ibv_wc_opcode ibv_wc_read_opcode(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_vendor_err(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_byte_len(struct ibv_cq_ex * cq);
__be32 ibv_wc_read_imm_data(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_invalidated_rkey(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_qp_num(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_src_qp(struct ibv_cq_ex * cq);
int ibv_wc_read_wc_flags(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_slid(struct ibv_cq_ex * cq);
uint8_t ibv_wc_read_sl(struct ibv_cq_ex * cq);
uint8_t ibv_wc_read_dlid_path_bits(struct ibv_cq_ex * cq);
uint64_t ibv_wc_read_completion_ts(struct ibv_cq_ex * cq);
uint16_t ibv_wc_read_cvlan(struct ibv_cq_ex * cq);
uint32_t ibv_wc_read_flow_tag(struct ibv_cq_ex * cq);
int ibv_post_wq_recv(struct ibv_wq * wq, struct ibv_recv_wr * recv_wr, struct ibv_recv_wr ** bad_recv_wr);
struct verbs_context * verbs_get_ctx(struct ibv_context * ctx);
struct ibv_device ** ibv_get_device_list(int * num_devices);
void ibv_free_device_list(struct ibv_device ** list);
const char * ibv_get_device_name(struct ibv_device * device);
__be64 ibv_get_device_guid(struct ibv_device * device);
struct ibv_context * ibv_open_device(struct ibv_device * device);
int ibv_close_device(struct ibv_context * context);
int ibv_get_async_event(struct ibv_context * context, struct ibv_async_event * event);
void ibv_ack_async_event(struct ibv_async_event * event);
int ibv_query_device(struct ibv_context * context, struct ibv_device_attr * device_attr);
int ibv_query_port(struct ibv_context * context, uint8_t port_num, struct ibv_port_attr * port_attr);
int ___ibv_query_port(struct ibv_context * context, uint8_t port_num, struct ibv_port_attr * port_attr);
int ibv_query_gid(struct ibv_context * context, uint8_t port_num, int index, union ibv_gid * gid);
int ibv_query_pkey(struct ibv_context * context, uint8_t port_num, int index, __be16 * pkey);
struct ibv_pd * ibv_alloc_pd(struct ibv_context * context);
int ibv_dealloc_pd(struct ibv_pd * pd);
struct ibv_flow * ibv_create_flow(struct ibv_qp * qp, struct ibv_flow_attr * flow);
int ibv_destroy_flow(struct ibv_flow * flow_id);
struct ibv_xrcd * ibv_open_xrcd(struct ibv_context * context, struct ibv_xrcd_init_attr * xrcd_init_attr);
int ibv_close_xrcd(struct ibv_xrcd * xrcd);
struct ibv_mr * ibv_reg_mr(struct ibv_pd * pd, void * addr, int length, int access);
int ibv_rereg_mr(struct ibv_mr * mr, int flags, struct ibv_pd * pd, void * addr, int length, int access);
int ibv_dereg_mr(struct ibv_mr * mr);
struct ibv_mw * ibv_alloc_mw(struct ibv_pd * pd, enum ibv_mw_type type);
int ibv_dealloc_mw(struct ibv_mw * mw);
uint32_t ibv_inc_rkey(uint32_t rkey);
int ibv_bind_mw(struct ibv_qp * qp, struct ibv_mw * mw, struct ibv_mw_bind * mw_bind);
struct ibv_comp_channel * ibv_create_comp_channel(struct ibv_context * context);
int ibv_destroy_comp_channel(struct ibv_comp_channel * channel);
struct ibv_cq * ibv_create_cq(struct ibv_context * context, int cqe, void * cq_context, struct ibv_comp_channel * channel, int comp_vector);
struct ibv_cq_ex * ibv_create_cq_ex(struct ibv_context * context, struct ibv_cq_init_attr_ex * cq_attr);
int ibv_resize_cq(struct ibv_cq * cq, int cqe);
int ibv_destroy_cq(struct ibv_cq * cq);
int ibv_get_cq_event(struct ibv_comp_channel * channel, struct ibv_cq ** cq, void ** cq_context);
void ibv_ack_cq_events(struct ibv_cq * cq, unsigned int nevents);
int ibv_poll_cq(struct ibv_cq * cq, int num_entries, struct ibv_wc * wc);
int ibv_req_notify_cq(struct ibv_cq * cq, int solicited_only);
struct ibv_srq * ibv_create_srq(struct ibv_pd * pd, struct ibv_srq_init_attr * srq_init_attr);
struct ibv_srq * ibv_create_srq_ex(struct ibv_context * context, struct ibv_srq_init_attr_ex * srq_init_attr_ex);
int ibv_modify_srq(struct ibv_srq * srq, struct ibv_srq_attr * srq_attr, int srq_attr_mask);
int ibv_query_srq(struct ibv_srq * srq, struct ibv_srq_attr * srq_attr);
int ibv_get_srq_num(struct ibv_srq * srq, uint32_t * srq_num);
int ibv_destroy_srq(struct ibv_srq * srq);
int ibv_post_srq_recv(struct ibv_srq * srq, struct ibv_recv_wr * recv_wr, struct ibv_recv_wr ** bad_recv_wr);
struct ibv_qp * ibv_create_qp(struct ibv_pd * pd, struct ibv_qp_init_attr * qp_init_attr);
struct ibv_qp * ibv_create_qp_ex(struct ibv_context * context, struct ibv_qp_init_attr_ex * qp_init_attr_ex);
int ibv_query_rt_values_ex(struct ibv_context * context, struct ibv_values_ex * values);
int ibv_query_device_ex(struct ibv_context * context, const struct ibv_query_device_ex_input * input, struct ibv_device_attr_ex * attr);
struct ibv_qp * ibv_open_qp(struct ibv_context * context, struct ibv_qp_open_attr * qp_open_attr);
int ibv_modify_qp(struct ibv_qp * qp, struct ibv_qp_attr * attr, int attr_mask);
int ibv_query_qp(struct ibv_qp * qp, struct ibv_qp_attr * attr, int attr_mask, struct ibv_qp_init_attr * init_attr);
int ibv_destroy_qp(struct ibv_qp * qp);
struct ibv_wq * ibv_create_wq(struct ibv_context * context, struct ibv_wq_init_attr * wq_init_attr);
int ibv_modify_wq(struct ibv_wq * wq, struct ibv_wq_attr * wq_attr);
int ibv_destroy_wq(struct ibv_wq * wq);
struct ibv_rwq_ind_table * ibv_create_rwq_ind_table(struct ibv_context * context, struct ibv_rwq_ind_table_init_attr * init_attr);
int ibv_destroy_rwq_ind_table(struct ibv_rwq_ind_table * rwq_ind_table);
int ibv_post_send(struct ibv_qp * qp, struct ibv_send_wr * wr, struct ibv_send_wr ** bad_wr);
int ibv_post_recv(struct ibv_qp * qp, struct ibv_recv_wr * wr, struct ibv_recv_wr ** bad_wr);
struct ibv_ah * ibv_create_ah(struct ibv_pd * pd, struct ibv_ah_attr * attr);
int ibv_init_ah_from_wc(struct ibv_context * context, uint8_t port_num, struct ibv_wc * wc, struct ibv_grh * grh, struct ibv_ah_attr * ah_attr);
struct ibv_ah * ibv_create_ah_from_wc(struct ibv_pd * pd, struct ibv_wc * wc, struct ibv_grh * grh, uint8_t port_num);
int ibv_destroy_ah(struct ibv_ah * ah);
int ibv_attach_mcast(struct ibv_qp * qp, const union ibv_gid * gid, uint16_t lid);
int ibv_detach_mcast(struct ibv_qp * qp, const union ibv_gid * gid, uint16_t lid);
int ibv_fork_init( );
const char * ibv_node_type_str(enum ibv_node_type node_type);
const char * ibv_port_state_str(enum ibv_port_state port_state);
const char * ibv_event_type_str(enum ibv_event_type event);
int ibv_resolve_eth_l2_from_gid(struct ibv_context * context, struct ibv_ah_attr * attr, uint8_t [6] eth_mac, uint16_t * vid);
int ibv_is_qpt_supported(uint32_t caps, enum ibv_qp_type qpt);

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,935 @@
typedef enum {
UHYVE_PORT_IBV_OPEN_DEVICE = 0x510,
UHYVE_PORT_IBV_GET_DEVICE_NAME = 0x511,
UHYVE_PORT_IBV_QUERY_PORT = 0x512,
UHYVE_PORT_IBV_CREATE_COMP_CHANNEL = 0x513,
} uhyve_ibv_t;
UHYVE_PORT_SET_IB_POOL_ADDR = 0x60F,
UHYVE_PORT_IBV_WC_STATUS_STR = 0x610,
UHYVE_PORT_IBV_RATE_TO_MULT = 0x611,
UHYVE_PORT_MULT_TO_IBV_RATE = 0x612,
UHYVE_PORT_IBV_RATE_TO_MBPS = 0x613,
UHYVE_PORT_MBPS_TO_IBV_RATE = 0x614,
UHYVE_PORT_IBV_CQ_EX_TO_CQ = 0x615,
UHYVE_PORT_IBV_START_POLL = 0x616,
UHYVE_PORT_IBV_NEXT_POLL = 0x617,
UHYVE_PORT_IBV_END_POLL = 0x618,
UHYVE_PORT_IBV_WC_READ_OPCODE = 0x619,
UHYVE_PORT_IBV_WC_READ_VENDOR_ERR = 0x61A,
UHYVE_PORT_IBV_WC_READ_BYTE_LEN = 0x61B,
UHYVE_PORT_IBV_WC_READ_IMM_DATA = 0x61C,
UHYVE_PORT_IBV_WC_READ_INVALIDATED_RKEY = 0x61D,
UHYVE_PORT_IBV_WC_READ_QP_NUM = 0x61E,
UHYVE_PORT_IBV_WC_READ_SRC_QP = 0x61F,
UHYVE_PORT_IBV_WC_READ_WC_FLAGS = 0x620,
UHYVE_PORT_IBV_WC_READ_SLID = 0x621,
UHYVE_PORT_IBV_WC_READ_SL = 0x622,
UHYVE_PORT_IBV_WC_READ_DLID_PATH_BITS = 0x623,
UHYVE_PORT_IBV_WC_READ_COMPLETION_TS = 0x624,
UHYVE_PORT_IBV_WC_READ_CVLAN = 0x625,
UHYVE_PORT_IBV_WC_READ_FLOW_TAG = 0x626,
UHYVE_PORT_IBV_POST_WQ_RECV = 0x627,
UHYVE_PORT_VERBS_GET_CTX = 0x628,
UHYVE_PORT_IBV_GET_DEVICE_LIST = 0x629,
UHYVE_PORT_IBV_FREE_DEVICE_LIST = 0x62A,
UHYVE_PORT_IBV_GET_DEVICE_NAME = 0x62B,
UHYVE_PORT_IBV_GET_DEVICE_GUID = 0x62C,
UHYVE_PORT_IBV_OPEN_DEVICE = 0x62D,
UHYVE_PORT_IBV_CLOSE_DEVICE = 0x62E,
UHYVE_PORT_IBV_GET_ASYNC_EVENT = 0x62F,
UHYVE_PORT_IBV_ACK_ASYNC_EVENT = 0x630,
UHYVE_PORT_IBV_QUERY_DEVICE = 0x631,
UHYVE_PORT_IBV_QUERY_PORT = 0x632,
UHYVE_PORT____IBV_QUERY_PORT = 0x633,
UHYVE_PORT_IBV_QUERY_GID = 0x634,
UHYVE_PORT_IBV_QUERY_PKEY = 0x635,
UHYVE_PORT_IBV_ALLOC_PD = 0x636,
UHYVE_PORT_IBV_DEALLOC_PD = 0x637,
UHYVE_PORT_IBV_CREATE_FLOW = 0x638,
UHYVE_PORT_IBV_DESTROY_FLOW = 0x639,
UHYVE_PORT_IBV_OPEN_XRCD = 0x63A,
UHYVE_PORT_IBV_CLOSE_XRCD = 0x63B,
UHYVE_PORT_IBV_REG_MR = 0x63C,
UHYVE_PORT_IBV_REREG_MR = 0x63D,
UHYVE_PORT_IBV_DEREG_MR = 0x63E,
UHYVE_PORT_IBV_ALLOC_MW = 0x63F,
UHYVE_PORT_IBV_DEALLOC_MW = 0x640,
UHYVE_PORT_IBV_INC_RKEY = 0x641,
UHYVE_PORT_IBV_BIND_MW = 0x642,
UHYVE_PORT_IBV_CREATE_COMP_CHANNEL = 0x643,
UHYVE_PORT_IBV_DESTROY_COMP_CHANNEL = 0x644,
UHYVE_PORT_IBV_CREATE_CQ = 0x645,
UHYVE_PORT_IBV_CREATE_CQ_EX = 0x646,
UHYVE_PORT_IBV_RESIZE_CQ = 0x647,
UHYVE_PORT_IBV_DESTROY_CQ = 0x648,
UHYVE_PORT_IBV_GET_CQ_EVENT = 0x649,
UHYVE_PORT_IBV_ACK_CQ_EVENTS = 0x64A,
UHYVE_PORT_IBV_POLL_CQ = 0x64B,
UHYVE_PORT_IBV_REQ_NOTIFY_CQ = 0x64C,
UHYVE_PORT_IBV_CREATE_SRQ = 0x64D,
UHYVE_PORT_IBV_CREATE_SRQ_EX = 0x64E,
UHYVE_PORT_IBV_MODIFY_SRQ = 0x64F,
UHYVE_PORT_IBV_QUERY_SRQ = 0x650,
UHYVE_PORT_IBV_GET_SRQ_NUM = 0x651,
UHYVE_PORT_IBV_DESTROY_SRQ = 0x652,
UHYVE_PORT_IBV_POST_SRQ_RECV = 0x653,
UHYVE_PORT_IBV_CREATE_QP = 0x654,
UHYVE_PORT_IBV_CREATE_QP_EX = 0x655,
UHYVE_PORT_IBV_QUERY_RT_VALUES_EX = 0x656,
UHYVE_PORT_IBV_QUERY_DEVICE_EX = 0x657,
UHYVE_PORT_IBV_OPEN_QP = 0x658,
UHYVE_PORT_IBV_MODIFY_QP = 0x659,
UHYVE_PORT_IBV_QUERY_QP = 0x65A,
UHYVE_PORT_IBV_DESTROY_QP = 0x65B,
UHYVE_PORT_IBV_CREATE_WQ = 0x65C,
UHYVE_PORT_IBV_MODIFY_WQ = 0x65D,
UHYVE_PORT_IBV_DESTROY_WQ = 0x65E,
UHYVE_PORT_IBV_CREATE_RWQ_IND_TABLE = 0x65F,
UHYVE_PORT_IBV_DESTROY_RWQ_IND_TABLE = 0x660,
UHYVE_PORT_IBV_POST_SEND = 0x661,
UHYVE_PORT_IBV_POST_RECV = 0x662,
UHYVE_PORT_IBV_CREATE_AH = 0x663,
UHYVE_PORT_IBV_INIT_AH_FROM_WC = 0x664,
UHYVE_PORT_IBV_CREATE_AH_FROM_WC = 0x665,
UHYVE_PORT_IBV_DESTROY_AH = 0x666,
UHYVE_PORT_IBV_ATTACH_MCAST = 0x667,
UHYVE_PORT_IBV_DETACH_MCAST = 0x668,
UHYVE_PORT_IBV_FORK_INIT = 0x669,
UHYVE_PORT_IBV_NODE_TYPE_STR = 0x66A,
UHYVE_PORT_IBV_PORT_STATE_STR = 0x66B,
UHYVE_PORT_IBV_EVENT_TYPE_STR = 0x66C,
UHYVE_PORT_IBV_RESOLVE_ETH_L2_FROM_GID = 0x66D,
UHYVE_PORT_IBV_IS_QPT_SUPPORTED = 0x66E,
} uhyve_ibv_t;
typedef struct {
// Parameters:
enum ibv_wc_status status;
// Return value:
const char * ret;
} __attribute__((packed)) uhyve_ibv_wc_status_str_t;
typedef struct {
// Parameters:
enum ibv_rate rate;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_rate_to_mult_t;
typedef struct {
// Parameters:
int mult;
// Return value:
enum ibv_rate ret;
} __attribute__((packed)) uhyve_mult_to_ibv_rate_t;
typedef struct {
// Parameters:
enum ibv_rate rate;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_rate_to_mbps_t;
typedef struct {
// Parameters:
int mbps;
// Return value:
enum ibv_rate ret;
} __attribute__((packed)) uhyve_mbps_to_ibv_rate_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
struct ibv_cq * ret;
} __attribute__((packed)) uhyve_ibv_cq_ex_to_cq_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
struct ibv_poll_cq_attr * attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_start_poll_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_next_poll_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
} __attribute__((packed)) uhyve_ibv_end_poll_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
enum ibv_wc_opcode ret;
} __attribute__((packed)) uhyve_ibv_wc_read_opcode_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_vendor_err_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_byte_len_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
__be32 ret;
} __attribute__((packed)) uhyve_ibv_wc_read_imm_data_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_invalidated_rkey_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_qp_num_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_src_qp_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_wc_read_wc_flags_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_slid_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint8_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_sl_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint8_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_dlid_path_bits_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint64_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_completion_ts_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint16_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_cvlan_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_flow_tag_t;
typedef struct {
// Parameters:
struct ibv_wq * wq;
struct ibv_recv_wr * recv_wr;
struct ibv_recv_wr ** bad_recv_wr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_post_wq_recv_t;
typedef struct {
// Parameters:
struct ibv_context * ctx;
// Return value:
struct verbs_context * ret;
} __attribute__((packed)) uhyve_verbs_get_ctx_t;
typedef struct {
// Parameters:
int * num_devices;
// Return value:
struct ibv_device ** ret;
} __attribute__((packed)) uhyve_ibv_get_device_list_t;
typedef struct {
// Parameters:
struct ibv_device ** list;
} __attribute__((packed)) uhyve_ibv_free_device_list_t;
typedef struct {
// Parameters:
struct ibv_device * device;
// Return value:
const char * ret;
} __attribute__((packed)) uhyve_ibv_get_device_name_t;
typedef struct {
// Parameters:
struct ibv_device * device;
// Return value:
__be64 ret;
} __attribute__((packed)) uhyve_ibv_get_device_guid_t;
typedef struct {
// Parameters:
struct ibv_device * device;
// Return value:
struct ibv_context * ret;
} __attribute__((packed)) uhyve_ibv_open_device_t;
typedef struct {
// Parameters:
struct ibv_context * context;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_close_device_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_async_event * event;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_get_async_event_t;
typedef struct {
// Parameters:
struct ibv_async_event * event;
} __attribute__((packed)) uhyve_ibv_ack_async_event_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_device_attr * device_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_device_t;
typedef struct {
// Parameters:
struct ibv_context * context;
uint8_t port_num;
struct ibv_port_attr * port_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_port_t;
typedef struct {
// Parameters:
struct ibv_context * context;
uint8_t port_num;
struct ibv_port_attr * port_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve____ibv_query_port_t;
typedef struct {
// Parameters:
struct ibv_context * context;
uint8_t port_num;
int index;
union ibv_gid * gid;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_gid_t;
typedef struct {
// Parameters:
struct ibv_context * context;
uint8_t port_num;
int index;
__be16 * pkey;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_pkey_t;
typedef struct {
// Parameters:
struct ibv_context * context;
// Return value:
struct ibv_pd * ret;
} __attribute__((packed)) uhyve_ibv_alloc_pd_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_dealloc_pd_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_flow_attr * flow;
// Return value:
struct ibv_flow * ret;
} __attribute__((packed)) uhyve_ibv_create_flow_t;
typedef struct {
// Parameters:
struct ibv_flow * flow_id;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_flow_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_xrcd_init_attr * xrcd_init_attr;
// Return value:
struct ibv_xrcd * ret;
} __attribute__((packed)) uhyve_ibv_open_xrcd_t;
typedef struct {
// Parameters:
struct ibv_xrcd * xrcd;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_close_xrcd_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
void * addr;
int length;
int access;
// Return value:
struct ibv_mr * ret;
} __attribute__((packed)) uhyve_ibv_reg_mr_t;
typedef struct {
// Parameters:
struct ibv_mr * mr;
int flags;
struct ibv_pd * pd;
void * addr;
int length;
int access;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_rereg_mr_t;
typedef struct {
// Parameters:
struct ibv_mr * mr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_dereg_mr_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
enum ibv_mw_type type;
// Return value:
struct ibv_mw * ret;
} __attribute__((packed)) uhyve_ibv_alloc_mw_t;
typedef struct {
// Parameters:
struct ibv_mw * mw;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_dealloc_mw_t;
typedef struct {
// Parameters:
uint32_t rkey;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_inc_rkey_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_mw * mw;
struct ibv_mw_bind * mw_bind;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_bind_mw_t;
typedef struct {
// Parameters:
struct ibv_context * context;
// Return value:
struct ibv_comp_channel * ret;
} __attribute__((packed)) uhyve_ibv_create_comp_channel_t;
typedef struct {
// Parameters:
struct ibv_comp_channel * channel;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_comp_channel_t;
typedef struct {
// Parameters:
struct ibv_context * context;
int cqe;
void * cq_context;
struct ibv_comp_channel * channel;
int comp_vector;
// Return value:
struct ibv_cq * ret;
} __attribute__((packed)) uhyve_ibv_create_cq_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_cq_init_attr_ex * cq_attr;
// Return value:
struct ibv_cq_ex * ret;
} __attribute__((packed)) uhyve_ibv_create_cq_ex_t;
typedef struct {
// Parameters:
struct ibv_cq * cq;
int cqe;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_resize_cq_t;
typedef struct {
// Parameters:
struct ibv_cq * cq;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_cq_t;
typedef struct {
// Parameters:
struct ibv_comp_channel * channel;
struct ibv_cq ** cq;
void ** cq_context;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_get_cq_event_t;
typedef struct {
// Parameters:
struct ibv_cq * cq;
unsigned int nevents;
} __attribute__((packed)) uhyve_ibv_ack_cq_events_t;
typedef struct {
// Parameters:
struct ibv_cq * cq;
int num_entries;
struct ibv_wc * wc;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_poll_cq_t;
typedef struct {
// Parameters:
struct ibv_cq * cq;
int solicited_only;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_req_notify_cq_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
struct ibv_srq_init_attr * srq_init_attr;
// Return value:
struct ibv_srq * ret;
} __attribute__((packed)) uhyve_ibv_create_srq_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_srq_init_attr_ex * srq_init_attr_ex;
// Return value:
struct ibv_srq * ret;
} __attribute__((packed)) uhyve_ibv_create_srq_ex_t;
typedef struct {
// Parameters:
struct ibv_srq * srq;
struct ibv_srq_attr * srq_attr;
int srq_attr_mask;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_modify_srq_t;
typedef struct {
// Parameters:
struct ibv_srq * srq;
struct ibv_srq_attr * srq_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_srq_t;
typedef struct {
// Parameters:
struct ibv_srq * srq;
uint32_t * srq_num;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_get_srq_num_t;
typedef struct {
// Parameters:
struct ibv_srq * srq;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_srq_t;
typedef struct {
// Parameters:
struct ibv_srq * srq;
struct ibv_recv_wr * recv_wr;
struct ibv_recv_wr ** bad_recv_wr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_post_srq_recv_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
struct ibv_qp_init_attr * qp_init_attr;
// Return value:
struct ibv_qp * ret;
} __attribute__((packed)) uhyve_ibv_create_qp_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_qp_init_attr_ex * qp_init_attr_ex;
// Return value:
struct ibv_qp * ret;
} __attribute__((packed)) uhyve_ibv_create_qp_ex_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_values_ex * values;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_rt_values_ex_t;
typedef struct {
// Parameters:
struct ibv_context * context;
const struct ibv_query_device_ex_input * input;
struct ibv_device_attr_ex * attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_device_ex_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_qp_open_attr * qp_open_attr;
// Return value:
struct ibv_qp * ret;
} __attribute__((packed)) uhyve_ibv_open_qp_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_qp_attr * attr;
int attr_mask;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_modify_qp_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_qp_attr * attr;
int attr_mask;
struct ibv_qp_init_attr * init_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_qp_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_qp_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_wq_init_attr * wq_init_attr;
// Return value:
struct ibv_wq * ret;
} __attribute__((packed)) uhyve_ibv_create_wq_t;
typedef struct {
// Parameters:
struct ibv_wq * wq;
struct ibv_wq_attr * wq_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_modify_wq_t;
typedef struct {
// Parameters:
struct ibv_wq * wq;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_wq_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_rwq_ind_table_init_attr * init_attr;
// Return value:
struct ibv_rwq_ind_table * ret;
} __attribute__((packed)) uhyve_ibv_create_rwq_ind_table_t;
typedef struct {
// Parameters:
struct ibv_rwq_ind_table * rwq_ind_table;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_rwq_ind_table_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_send_wr * wr;
struct ibv_send_wr ** bad_wr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_post_send_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_recv_wr * wr;
struct ibv_recv_wr ** bad_wr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_post_recv_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
struct ibv_ah_attr * attr;
// Return value:
struct ibv_ah * ret;
} __attribute__((packed)) uhyve_ibv_create_ah_t;
typedef struct {
// Parameters:
struct ibv_context * context;
uint8_t port_num;
struct ibv_wc * wc;
struct ibv_grh * grh;
struct ibv_ah_attr * ah_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_init_ah_from_wc_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
struct ibv_wc * wc;
struct ibv_grh * grh;
uint8_t port_num;
// Return value:
struct ibv_ah * ret;
} __attribute__((packed)) uhyve_ibv_create_ah_from_wc_t;
typedef struct {
// Parameters:
struct ibv_ah * ah;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_ah_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
const union ibv_gid * gid;
uint16_t lid;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_attach_mcast_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
const union ibv_gid * gid;
uint16_t lid;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_detach_mcast_t;
typedef struct {
// Parameters:
;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_fork_init_t;
typedef struct {
// Parameters:
enum ibv_node_type node_type;
// Return value:
const char * ret;
} __attribute__((packed)) uhyve_ibv_node_type_str_t;
typedef struct {
// Parameters:
enum ibv_port_state port_state;
// Return value:
const char * ret;
} __attribute__((packed)) uhyve_ibv_port_state_str_t;
typedef struct {
// Parameters:
enum ibv_event_type event;
// Return value:
const char * ret;
} __attribute__((packed)) uhyve_ibv_event_type_str_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_ah_attr * attr;
uint8_t [6] eth_mac;
uint16_t * vid;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_resolve_eth_l2_from_gid_t;
typedef struct {
// Parameters:
uint32_t caps;
enum ibv_qp_type qpt;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_is_qpt_supported_t;
void call_ibv_wc_status_str(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_rate_to_mult(struct kvm_run * run, uint8_t * guest_mem);
void call_mult_to_ibv_rate(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_rate_to_mbps(struct kvm_run * run, uint8_t * guest_mem);
void call_mbps_to_ibv_rate(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_cq_ex_to_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_start_poll(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_next_poll(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_end_poll(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_opcode(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_vendor_err(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_byte_len(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_imm_data(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_invalidated_rkey(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_qp_num(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_src_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_wc_flags(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_slid(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_sl(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_dlid_path_bits(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_completion_ts(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_cvlan(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_flow_tag(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_post_wq_recv(struct kvm_run * run, uint8_t * guest_mem);
void call_verbs_get_ctx(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_device_list(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_free_device_list(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_device_name(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_device_guid(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_open_device(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_close_device(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_async_event(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_ack_async_event(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_device(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_port(struct kvm_run * run, uint8_t * guest_mem);
void call____ibv_query_port(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_gid(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_pkey(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_alloc_pd(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_dealloc_pd(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_flow(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_flow(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_open_xrcd(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_close_xrcd(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_reg_mr(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_rereg_mr(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_dereg_mr(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_alloc_mw(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_dealloc_mw(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_inc_rkey(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_bind_mw(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_comp_channel(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_comp_channel(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_cq_ex(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_resize_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_cq_event(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_ack_cq_events(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_poll_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_req_notify_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_srq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_srq_ex(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_modify_srq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_srq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_srq_num(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_srq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_post_srq_recv(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_qp_ex(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_rt_values_ex(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_device_ex(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_open_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_modify_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_wq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_modify_wq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_wq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_rwq_ind_table(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_rwq_ind_table(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_post_send(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_post_recv(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_ah(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_init_ah_from_wc(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_ah_from_wc(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_ah(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_attach_mcast(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_detach_mcast(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_fork_init(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_node_type_str(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_port_state_str(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_event_type_str(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_resolve_eth_l2_from_gid(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_is_qpt_supported(struct kvm_run * run, uint8_t * guest_mem);

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,293 @@
case UHYVE_PORT_IBV_OPEN_DEVICE:
call_ibv_open_device(run, guest_mem);
case UHYVE_PORT_SET_IB_POOL_ADDR: {
unsigned data = *((unsigned*)((size_t)run+run->io.data_offset));
uint64_t * temp = (uint64_t*)(guest_mem + data);
ib_pool_addr = (uint8_t*) *temp;
ib_pool_top = ib_pool_addr;
break;
}
case UHYVE_PORT_IBV_WC_STATUS_STR:
call_ibv_wc_status_str(run, guest_mem);
break;
case UHYVE_PORT_IBV_RATE_TO_MULT:
call_ibv_rate_to_mult(run, guest_mem);
break;
case UHYVE_PORT_MULT_TO_IBV_RATE:
call_mult_to_ibv_rate(run, guest_mem);
break;
case UHYVE_PORT_IBV_RATE_TO_MBPS:
call_ibv_rate_to_mbps(run, guest_mem);
break;
case UHYVE_PORT_MBPS_TO_IBV_RATE:
call_mbps_to_ibv_rate(run, guest_mem);
break;
case UHYVE_PORT_IBV_CQ_EX_TO_CQ:
call_ibv_cq_ex_to_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_START_POLL:
call_ibv_start_poll(run, guest_mem);
break;
case UHYVE_PORT_IBV_NEXT_POLL:
call_ibv_next_poll(run, guest_mem);
break;
case UHYVE_PORT_IBV_END_POLL:
call_ibv_end_poll(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_OPCODE:
call_ibv_wc_read_opcode(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_VENDOR_ERR:
call_ibv_wc_read_vendor_err(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_BYTE_LEN:
call_ibv_wc_read_byte_len(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_IMM_DATA:
call_ibv_wc_read_imm_data(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_INVALIDATED_RKEY:
call_ibv_wc_read_invalidated_rkey(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_QP_NUM:
call_ibv_wc_read_qp_num(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_SRC_QP:
call_ibv_wc_read_src_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_WC_FLAGS:
call_ibv_wc_read_wc_flags(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_SLID:
call_ibv_wc_read_slid(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_SL:
call_ibv_wc_read_sl(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_DLID_PATH_BITS:
call_ibv_wc_read_dlid_path_bits(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_COMPLETION_TS:
call_ibv_wc_read_completion_ts(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_CVLAN:
call_ibv_wc_read_cvlan(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_FLOW_TAG:
call_ibv_wc_read_flow_tag(run, guest_mem);
break;
case UHYVE_PORT_IBV_POST_WQ_RECV:
call_ibv_post_wq_recv(run, guest_mem);
break;
case UHYVE_PORT_VERBS_GET_CTX:
call_verbs_get_ctx(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_DEVICE_LIST:
call_ibv_get_device_list(run, guest_mem);
break;
case UHYVE_PORT_IBV_FREE_DEVICE_LIST:
call_ibv_free_device_list(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_DEVICE_NAME:
call_ibv_get_device_name(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_DEVICE_GUID:
call_ibv_get_device_guid(run, guest_mem);
break;
case UHYVE_PORT_IBV_OPEN_DEVICE:
call_ibv_open_device(run, guest_mem);
break;
case UHYVE_PORT_IBV_CLOSE_DEVICE:
call_ibv_close_device(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_ASYNC_EVENT:
call_ibv_get_async_event(run, guest_mem);
break;
case UHYVE_PORT_IBV_ACK_ASYNC_EVENT:
call_ibv_ack_async_event(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_DEVICE:
call_ibv_query_device(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_PORT:
call_ibv_query_port(run, guest_mem);
break;
case UHYVE_PORT____IBV_QUERY_PORT:
call____ibv_query_port(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_GID:
call_ibv_query_gid(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_PKEY:
call_ibv_query_pkey(run, guest_mem);
break;
case UHYVE_PORT_IBV_ALLOC_PD:
call_ibv_alloc_pd(run, guest_mem);
break;
case UHYVE_PORT_IBV_DEALLOC_PD:
call_ibv_dealloc_pd(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_FLOW:
call_ibv_create_flow(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_FLOW:
call_ibv_destroy_flow(run, guest_mem);
break;
case UHYVE_PORT_IBV_OPEN_XRCD:
call_ibv_open_xrcd(run, guest_mem);
break;
case UHYVE_PORT_IBV_CLOSE_XRCD:
call_ibv_close_xrcd(run, guest_mem);
break;
case UHYVE_PORT_IBV_REG_MR:
call_ibv_reg_mr(run, guest_mem);
break;
case UHYVE_PORT_IBV_REREG_MR:
call_ibv_rereg_mr(run, guest_mem);
break;
case UHYVE_PORT_IBV_DEREG_MR:
call_ibv_dereg_mr(run, guest_mem);
break;
case UHYVE_PORT_IBV_ALLOC_MW:
call_ibv_alloc_mw(run, guest_mem);
break;
case UHYVE_PORT_IBV_DEALLOC_MW:
call_ibv_dealloc_mw(run, guest_mem);
break;
case UHYVE_PORT_IBV_INC_RKEY:
call_ibv_inc_rkey(run, guest_mem);
break;
case UHYVE_PORT_IBV_BIND_MW:
call_ibv_bind_mw(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_COMP_CHANNEL:
call_ibv_create_comp_channel(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_COMP_CHANNEL:
call_ibv_destroy_comp_channel(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_CQ:
call_ibv_create_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_CQ_EX:
call_ibv_create_cq_ex(run, guest_mem);
break;
case UHYVE_PORT_IBV_RESIZE_CQ:
call_ibv_resize_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_CQ:
call_ibv_destroy_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_CQ_EVENT:
call_ibv_get_cq_event(run, guest_mem);
break;
case UHYVE_PORT_IBV_ACK_CQ_EVENTS:
call_ibv_ack_cq_events(run, guest_mem);
break;
case UHYVE_PORT_IBV_POLL_CQ:
call_ibv_poll_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_REQ_NOTIFY_CQ:
call_ibv_req_notify_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_SRQ:
call_ibv_create_srq(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_SRQ_EX:
call_ibv_create_srq_ex(run, guest_mem);
break;
case UHYVE_PORT_IBV_MODIFY_SRQ:
call_ibv_modify_srq(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_SRQ:
call_ibv_query_srq(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_SRQ_NUM:
call_ibv_get_srq_num(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_SRQ:
call_ibv_destroy_srq(run, guest_mem);
break;
case UHYVE_PORT_IBV_POST_SRQ_RECV:
call_ibv_post_srq_recv(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_QP:
call_ibv_create_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_QP_EX:
call_ibv_create_qp_ex(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_RT_VALUES_EX:
call_ibv_query_rt_values_ex(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_DEVICE_EX:
call_ibv_query_device_ex(run, guest_mem);
break;
case UHYVE_PORT_IBV_OPEN_QP:
call_ibv_open_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_MODIFY_QP:
call_ibv_modify_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_QP:
call_ibv_query_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_QP:
call_ibv_destroy_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_WQ:
call_ibv_create_wq(run, guest_mem);
break;
case UHYVE_PORT_IBV_MODIFY_WQ:
call_ibv_modify_wq(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_WQ:
call_ibv_destroy_wq(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_RWQ_IND_TABLE:
call_ibv_create_rwq_ind_table(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_RWQ_IND_TABLE:
call_ibv_destroy_rwq_ind_table(run, guest_mem);
break;
case UHYVE_PORT_IBV_POST_SEND:
call_ibv_post_send(run, guest_mem);
break;
case UHYVE_PORT_IBV_POST_RECV:
call_ibv_post_recv(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_AH:
call_ibv_create_ah(run, guest_mem);
break;
case UHYVE_PORT_IBV_INIT_AH_FROM_WC:
call_ibv_init_ah_from_wc(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_AH_FROM_WC:
call_ibv_create_ah_from_wc(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_AH:
call_ibv_destroy_ah(run, guest_mem);
break;
case UHYVE_PORT_IBV_ATTACH_MCAST:
call_ibv_attach_mcast(run, guest_mem);
break;
case UHYVE_PORT_IBV_DETACH_MCAST:
call_ibv_detach_mcast(run, guest_mem);
break;
case UHYVE_PORT_IBV_FORK_INIT:
call_ibv_fork_init(run, guest_mem);
break;
case UHYVE_PORT_IBV_NODE_TYPE_STR:
call_ibv_node_type_str(run, guest_mem);
break;
case UHYVE_PORT_IBV_PORT_STATE_STR:
call_ibv_port_state_str(run, guest_mem);
break;
case UHYVE_PORT_IBV_EVENT_TYPE_STR:
call_ibv_event_type_str(run, guest_mem);
break;
case UHYVE_PORT_IBV_RESOLVE_ETH_L2_FROM_GID:
call_ibv_resolve_eth_l2_from_gid(run, guest_mem);
break;
case UHYVE_PORT_IBV_IS_QPT_SUPPORTED:
call_ibv_is_qpt_supported(run, guest_mem);
break;

View file

@ -1,5 +1,4 @@
#!/usr/bin/env python
"""Copyright (c) 2017, Annika Wierichs, RWTH Aachen University
All rights reserved.
@ -92,19 +91,20 @@ from parser import generate_struct_conversions
# Path of the input file containing function prototypes.
SRC_PATH = "function-prototypes-0.txt"
SRC_PATH = "function-prototypes.txt"
# Paths of the files that are generated by the script.
IBV_GEN_PATH = "GEN-kernel-ibv.c"
KERNEL_GEN_PATH = "GEN-kernel.c"
KERNEL_HEADER_GEN_PATH = "GEN-kernel-header.h"
UHYVE_CASES_GEN_PATH = "GEN-tools-uhyve.c"
UHYVE_IBV_HEADER_GEN_PATH = "GEN-tools-uhyve-ibv-ports.h"
INCLUDE_STDDEF_GEN_PATH = "GEN-include-hermit-stddef.h"
UHYVE_IBV_HEADER_STRUCTS_GEN_PATH = "GEN-tools-uhyve-ibv-structs.h"
# UHYVE_IBV_HEADER_STRUCTS_GEN_PATH = "GEN-tools-uhyve-ibv-structs.h"
UHYVE_HOST_FCNS_GEN_PATH = "GEN-tools-uhyve-ibv.c"
# VERBS_HEADER_PATH = "verbs-0.h"
# Starting number of the sequence used for IBV ports.
PORT_NUMBER_START = 0x510
PORT_NUMBER_START = 0x610
TABS = ["", "\t", "\t\t", "\t\t\t", "\t\t\t\t"]
NEWLINES = ["", "\n", "\n\n"]
@ -112,8 +112,12 @@ NEWLINES = ["", "\n", "\n\n"]
class Type:
def __init__(self, string):
ts = string
if (string[-1] is "*") and (string[-2] is not " "):
ts = string[:-1] + " *"
# if len(string) > 2 and string[-1] is "*":
# if string[-2] is "*" and string[-3] is not " ":
# ts = string[:-2] + " **"
# elif string[-2] is not " ":
# ts = string[:-1] + " *"
self.type_string = ts
self.type_components = ts.split(" ")
@ -127,9 +131,15 @@ class Type:
def is_struct(self):
return self.type_components[0] == "struct"
def is_char_arr(self):
return self.is_pointer() and "char" in self.type_components
def is_pointer(self):
return self.type_components[-1] == "*"
def is_pointer_pointer(self):
return self.type_components[-1] == "**"
def is_void(self):
return self.type_string == "void"
@ -139,10 +149,12 @@ class FunctionParameter:
components = string.split(" ")
type_string = " ".join(components[:-1])
# print("string in FunctionParameter: ", string)
self.type = Type(type_string)
self.name = components[-1]
def get_full_expression:
def get_full_expression(self):
return self.type.type_string + " " + self.name
def get_struct_name(self):
@ -154,6 +166,9 @@ class FunctionParameter:
def is_pointer(self):
return self.type.is_pointer()
def is_pointer_pointer(self):
return self.type.is_pointer_pointer()
class FunctionPrototype:
def __init__(self, string):
@ -166,33 +181,40 @@ class FunctionPrototype:
self.ret = Type(" ".join(ret_and_name[:-1]))
self.function_name = ret_and_name[-1]
def generate_args_struct(ret, function_name, params):
def generate_args_struct(self):
"""Generates the struct to hold a function's parameters and return value.
Args:
ret: Return type as string.
function_name: Function name as string.
params: Parameters as list of strings.
Returns:
Generated struct as string.
"""
code = ""
code = "typedef struct {\n"
if self.get_num_parameters() > 0:
code += "\t// Parameters:\n"
for param in self.parameters:
code += "\t{0};\n".format(param.get_full_expression())
code += "\t// Parameters:\n"
for param in self.parameters or []:
code += "\t{0};\n".format(param.get_full_expression())
if not self.ret.is_void():
code += "\t// Return value:\n"
code += "\t{0} ret;\n".format(self.ret.type_string)
code += "}} __attribute__((packed)) {0};\n\n".format( self.get_args_struct_name())
code += "}} __attribute__((packed)) {0};\n\n".format(self.get_args_struct_name())
return code
def generate_function_declaration(self):
return "{} {}({});\n".format(self.ret.type_string, self.function_name,
self.get_string_of_parameters())
def get_string_of_parameters(self):
return ", ".join([param.get_full_expression() for param in self.parameters])
def generate_uhyve_function_declaration(self):
name = self.get_uhyve_call_function_name()
return "void {0}(struct kvm_run * run, uint8_t * guest_mem);\n".format(name)
def get_uhyve_call_function_name(self):
return "call_{0}".format(self.function_name)
def get_num_parameters(self):
return len(self.parameters)
@ -210,232 +232,126 @@ class FunctionPrototype:
# -----------------------------------------------------------------------------
def generate_pretty_comment(string):
return "/*\n * {0}\n */\n\n".format(string)
# def get_struct_name(function_name):
# """Returns the matching struct name for a given function name.
# """
# return "uhyve_{0}_t".format(function_name)
def generate_kernel_header_declarations(function_prototypes):
code = ""
for pt in function_prototypes:
code += pt.generate_function_declaration()
return code
# def parse_line(line):
# """Parses a line containing a function prototype.
# Args:
# line: Line of the following format:
# <return_type> <function_name>(<param_type> <param_name>, [...])
# Returns:
# [Return type, function name, parameters] as Tuple[string, string, list[string]]
# """
# parens_split = line.split("(")
# ret_and_name = parens_split[0].split(" ")
# all_params = parens_split[-1][:-1]
# ret = " ".join(ret_and_name[:-1])
# function_name = ret_and_name[-1]
# params = all_params.split(",")
# params[-1] = params[-1][:-1]
# return ret, function_name, params
# def generate_struct(ret, function_name, params):
# """Generates the struct to hold a function's parameters and return value.
# Args:
# ret: Return type as string.
# function_name: Function name as string.
# params: Parameters as list of strings.
# Returns:
# Generated struct as string.
# """
# struct = "typedef struct {\n"
# if params:
# struct += "\t// Parameters:\n"
# for param in params:
# struct += "\t{0};\n".format(param)
# if ret is not "void":
# struct += "\t// Return value:\n"
# struct += "\t{0} ret;\n".format(ret)
# struct_name = get_struct_name(function_name)
# struct += "}} __attribute__((packed)) {0};\n\n".format(struct_name)
# return struct
# TODO: hier gehts weiter
def generate_kernel_function(ret, function_name, params):
def generate_kernel_function(function_prototype):
"""Generates the kernel function that sends the KVM exit IO to uhyve.
Args:
ret: Return type as string.
function_name: Function name as string.
params: Parameters as list of strings.
Returns:
Generated function as string.
"""
code = ""
fnc_name = function_prototype.function_name
ret_type = function_prototype.ret
params = function_prototype.parameters
port_name = function_prototype.get_port_name()
code = "{0} {1}({2}) {{\n".format(ret, function_name, ", ".join(params))
comma_separated_params = function_prototype.get_string_of_parameters()
code = "{0} {1}({2}) {{\n".format(ret_type.type_string, fnc_name, comma_separated_params)
code += "\t{0} uhyve_args;\n".format(function_prototype.get_args_struct_name())
# Create uhyve_args and define parameters
struct_name = get_struct_name(function_name)
code += "\t{0} ret_guest;\n".format(ret)
code += "\t{0} uhyve_args;\n".format(struct_name)
# TODO: Make a class for function prototypes
for param in params:
param_split = param.split(" ")
param_type = " ".join(param_split[:-1])
param_name = param_split[-1]
# Define struct members according to their type.
if "**" in param_type:
for p in params or []:
if p.is_pointer_pointer():
code += "\t// TODO: Take care of ** parameter.\n"
elif "*" in param_type:
# TODO: char ptrs
code += "\tuhyve_args.{0} = guest_to_host_{1}({2});\n".format(param_name,
param_split[1])
else:
code += "\tuhyve_args,{0} = {0};\n".format(param_name)
code += "\tuhyve_args.{0} = {0};\n".format(p.name)
code += "\n"
# call uhyve_send() using the respective port ID.
port_name = "UHYVE_PORT_" + function_name.upper()
code += "\n\tuhyve_send({0}, (unsigned) virt_to_phys((size_t) " \
"&uhyve_args));\n\n".format(port_name)
for param in params:
param_split = param.split(" ")
param_type = " ".join(param_split[:-1])
param_name = param_split[-1]
# Define struct members according to their type.
if "**" in param_type:
code += "\t// TODO: Take care of ** parameter.\n"
elif "*" in param_type:
code += "\thost_to_guest_{0}({1}, GUEST);".format(param_split[1], param_name)
if "**" in ret:
code += "\t// TODO: Take care of ** parameter.\n"
elif "*" in ret:
code += "\tret_guest = host_to_guest_{0}(uhyve_args.ret, HOST)\n".format(ret[1])
else:
code += "\tret_guest = uhyve_args.ret;\n"
code += "\n\treturn ret_guest;\n"
code += "}\n\n\n"
code += "\tuhyve_send({0}, (unsigned) virt_to_phys((size_t) &uhyve_args));\n".format(port_name)
if not ret_type.is_void():
code += "\n\treturn uhyve_args.ret;\n"
code += "}\n\n"
return code
# case UHYVE_PORT_SET_IB_POOL_ADDR:
# printf("LOG: UHYVE CASE\n");
# unsigned data = *((unsigned*)((size_t)run+run->io.data_offset));
# uint64_t * temp = (uint64_t*)(guest_mem + data);
# /* printf("LOG: Value of uint64 pool start: %" PRIu64 "\n", *temp); */
# printf("LOG: Value of uint64 pool start: %p\n", *temp);
# ib_pool_addr = (uint8_t*) *temp;
# /* printf("LOG: Value of uint8 pool start: %" PRIu8 "\n", ib_pool_addr); */
# printf("LOG: Value of uint8 pool start: %p\n", ib_pool_addr);
# ib_pool_top = ib_pool_addr;
# break;
# TODO: done
def generate_uhyve_cases(function_prototypes):
""" Generates all switch-cases for uhyve's KVM exit IO.
Returns:
Generated switch-cases [string]
"""
code = ""
code = "\t\t\tcase UHYVE_PORT_SET_IB_POOL_ADDR: {\n"
code += "\t\t\t\t\tunsigned data = *((unsigned*)((size_t)run+run->io.data_offset));\n"
code += "\t\t\t\t\tuint64_t * temp = (uint64_t*)(guest_mem + data);\n"
code += "\t\t\t\t\tib_pool_addr = (uint8_t*) *temp;\n"
code += "\t\t\t\t\tib_pool_top = ib_pool_addr;\n"
code += "\t\t\t\t\tbreak;\n"
code += "\t\t\t}\n\n"
for pt in function_prototypes:
name = pt.function_name
call_fnc_name = pt.get_uhyve_call_function_name()
port_name = pt.get_port_name()
code += "{0}{1}case {2}:".format(NEWLINES[1], TABS[3], port_name)
code += "{0}{1}call_{2}(run, guest_mem);".format(NEWLINES[1], TABS[4], name)
code += "{0}{1}break;".format(NEWLINES[1], TABS[4])
code += "\t\t\tcase {0}:\n".format(port_name)
code += "\t\t\t\t{0}(run, guest_mem);\n".format(call_fnc_name)
code += "\t\t\t\tbreak;\n"
return code
def generate_uhyve_function(prototype):
args_struct_name = prototype.get_args_struct_name()
fnc_name = prototype.function_name
ret_type = prototype.ret
code = generate_pretty_comment(fnc_name)
code += "void call_{0}(struct kvm_run * run, uint8_t * guest_mem) {{\n".format(fnc_name)
code += "\tprintf(\"LOG: UHYVE - call_{0}\\n\");\n".format(fnc_name)
code += "\tunsigned data = *((unsigned*) ((size_t) run + run->io.data_offset));\n"
code += "\t{0} * args = ({0} *) (guest_mem + data);\n\n".format(args_struct_name)
code += "\tuse_ib_mem_pool = true;\n"
code += ("\t" + ("args->ret = " if not ret_type.is_void() else "")
+ "{0}(".format(fnc_name))
if prototype.get_num_parameters() > 0:
for param in prototype.parameters[:-1] or []:
code += "args->{}, ".format(param.name)
code += "args->{});\n".format(prototype.parameters[-1].name)
code += "\tuse_ib_mem_pool = false;\n}\n\n\n"
return code
# TODO: hier gehts weiter
def generate_uhyve_host_function(ret, function_name, params):
"""Generates a switch-case that catches a KVM exit IO for the given function in uhyve.
Args:
ret: Return type as string.
function_name: Function name as string.
params: Parameters as list of strings.
Returns:
Generated switch-case code as string.
"""
def generate_host_call_parameter(param):
"""Generates the parameter for the host's function called from within uhyve.
This distinguishes between pointers and non-pointers since pointers have to
be converted to host memory addresses.
Example for pointer: guest_mem+(size_t)args->param
Example for non-pointer: args->param
Args:
param: The parameter type and name as a single string.
Returns:
Generated parameter,
"""
param_name = param.split(" ")[-1]
if "**" in param:
host_param = "/* TODO: param {0}*/".format(param_name)
elif "*" in param:
host_param = "guest_mem+(size_t)args->{0}".format(param_name)
else:
host_param = "{0}".format(param_name)
return host_param
struct_name = get_struct_name(function_name)
fcn = "{0}void call_{1}(struct kvm_run * run, uint8_t * guest_mem) {{".format(NEWLINES[1], function_name)
fcn += "{0}{1}unsigned data = *((unsigned*)((size_t)run+run->io.data_offset));".format(NEWLINES[1], TABS[1])
fcn += "{0}{1}{2} * args = ({2} *) (guest_mem + data);".format(NEWLINES[1], TABS[1], struct_name)
fcn += "{0}{1}{2} host_ret = {3}(".format(NEWLINES[2], TABS[1], ret, function_name)
for param in params[:-1]:
fcn += generate_host_call_parameter(param) + ", "
else:
fcn += generate_host_call_parameter(params[-1]) + ");"
if "**" in ret:
fcn += "{0}{1}// TODO: Take care of {2} return value.".format(NEWLINES[1], TABS[1], ret)
elif "*" in ret:
fcn += "{0}{1}memcpy(guest_mem+(size_t)args->ret, host_ret, sizeof(host_ret));".format(NEWLINES[1], TABS[1])
fcn += "{0}{1}// TODO: Convert ptrs contained in return value.".format(NEWLINES[1], TABS[1])
fcn += "{0}{1}// TODO: Delete host_ret data structure.".format(NEWLINES[1], TABS[1])
else:
fcn += "{0}{1}args->ret = host_ret;".format(NEWLINES[1], TABS[1])
fcn += "{0}}}{0}".format(NEWLINES[1])
return fcn
def generate_port_enum(function_names):
def generate_port_enum(function_prototypes):
"""Generates the enum mapping KVM exit IO port names to port numbers.
Args:
function_names: All function names to be mapped to ports as list of strings.
function_prototypes: All function names to be mapped to ports as list of strings.
Returns:
Generated complete enum.
"""
port_enum = "typedef enum {"
for num, function_name in enumerate(function_names, PORT_NUMBER_START):
port_enum += "\n\tUHYVE_PORT_{0} = 0x{1},".format(function_name.upper(),
format(num, "X"))
port_enum += "\n} uhyve_ibv_t;"
code = "typedef enum {\n"
code += "\tUHYVE_PORT_SET_IB_POOL_ADDR = 0x{0},\n".format(format(PORT_NUMBER_START-1, "X"))
for num, pt in enumerate(function_prototypes, PORT_NUMBER_START):
port_name = pt.get_port_name()
code += "\t{0} = 0x{1},\n".format(port_name, format(num, "X"))
code += "} uhyve_ibv_t;"
return port_enum
return code
def generate_port_macros(function_names):
def generate_port_macros(function_prototypes):
"""Generates the compiler macros mapping KVM exit IO port names to port numbers.
Args:
@ -444,47 +360,47 @@ def generate_port_macros(function_names):
Returns:
Generated list of compiler macros.
"""
macros = ""
for num, function_name in enumerate(function_names, PORT_NUMBER_START):
macros += "\n#define UHYVE_PORT_{0} 0x{1}".format(function_name.upper(),
format(num, "X"))
return macros
code = "#define UHYVE_PORT_SET_IB_POOL_ADDR 0x{0}\n".format(format(PORT_NUMBER_START-1, "X"))
for num, pt in enumerate(function_prototypes, PORT_NUMBER_START):
port_name = pt.get_port_name()
code += "#define {0} 0x{1}\n".format(port_name, format(num, "X"))
return code
if __name__ == "__main__":
"""TODO: Doc
"""
with open(SRC_PATH, "r") as f_src, \
open(IBV_GEN_PATH, "w") as f_ibv, \
open(UHYVE_HOST_FCNS_GEN_PATH, "w") as f_uhyve_host_fncs, \
open(UHYVE_IBV_HEADER_STRUCTS_GEN_PATH, "w") as f_structs:
function_names = []
# Make this like the structure below.
for line in f_src:
ret, function_name, params = parse_line(line)
function_names.append(function_name)
prototypes = []
struct = generate_struct(ret, function_name, params)
f_ibv.write(struct)
f_structs.write(struct)
with open(SRC_PATH, "r") as f:
for line in f:
if line:
prototypes.append(FunctionPrototype(line))
kernel_function = generate_kernel_function(ret, function_name, params)
f_ibv.write(kernel_function)
with open(UHYVE_CASES_GEN_PATH, "w") as f:
f.write(generate_uhyve_cases(prototypes))
uhyve_fnc = generate_uhyve_host_function(ret, function_name, params)
f_uhyve_host_fncs.write(uhyve_fnc)
with open(INCLUDE_STDDEF_GEN_PATH, "w") as f:
f.write(generate_port_macros(prototypes))
with open(UHYVE_IBV_HEADER_GEN_PATH, "w") as f_uhyve_ibv:
port_enum = generate_port_enum(function_names)
f_uhyve_ibv.write(port_enum)
with open(UHYVE_IBV_HEADER_GEN_PATH, "w") as f:
f.write(generate_port_enum(prototypes))
f.write("\n\n")
with open(UHYVE_CASES_GEN_PATH, "w") as f_cases:
uhyve_cases = generate_uhyve_cases(function_names)
f_cases.write(uhyve_cases)
for pt in prototypes:
f.write(pt.generate_args_struct())
f.write("\n\n")
with open(INCLUDE_STDDEF_GEN_PATH, "w") as f_stddef:
port_macros = generate_port_macros(function_names)
f_stddef.write(port_macros)
for pt in prototypes:
f.write(pt.generate_uhyve_function_declaration())
generate_struct_conversions()
with open(UHYVE_HOST_FCNS_GEN_PATH, "w") as f:
for pt in prototypes:
f.write(generate_uhyve_function(pt))
with open(KERNEL_HEADER_GEN_PATH, "w") as f:
f.write(generate_kernel_header_declarations(prototypes))
with open(KERNEL_GEN_PATH, "w") as f:
for pt in prototypes:
f.write(generate_pretty_comment(pt.function_name))
f.write(pt.generate_args_struct())
f.write(generate_kernel_function(pt))
f.write("\n")

File diff suppressed because it is too large Load diff

View file

@ -19,41 +19,316 @@
#ifndef UHYVE_IBV_H
#define UHYVE_IBV_H
#include <infiniband/verbs.h> // Linux include
#include <infiniband/verbs.h>
#include <linux/kvm.h>
#include <stdbool.h>
#define MAX_NUM_OF_IBV_DEVICES 16
extern bool use_ib_mem_pool;
typedef enum {
UHYVE_PORT_SET_IB_POOL_ADDR = 0x609,
UHYVE_PORT_IBV_OPEN_DEVICE = 0x610,
UHYVE_PORT_IBV_GET_DEVICE_LIST = 0x611,
UHYVE_PORT_IBV_GET_DEVICE_NAME = 0x612,
UHYVE_PORT_IBV_QUERY_PORT = 0x613,
UHYVE_PORT_IBV_CREATE_COMP_CHANNEL = 0x614,
UHYVE_PORT_KERNEL_IBV_LOG = 0x615,
UHYVE_PORT_SET_IB_POOL_ADDR = 0x60F,
UHYVE_PORT_IBV_WC_STATUS_STR = 0x610,
UHYVE_PORT_IBV_RATE_TO_MULT = 0x611,
UHYVE_PORT_MULT_TO_IBV_RATE = 0x612,
UHYVE_PORT_IBV_RATE_TO_MBPS = 0x613,
UHYVE_PORT_MBPS_TO_IBV_RATE = 0x614,
UHYVE_PORT_IBV_CQ_EX_TO_CQ = 0x615,
UHYVE_PORT_IBV_START_POLL = 0x616,
UHYVE_PORT_IBV_NEXT_POLL = 0x617,
UHYVE_PORT_IBV_END_POLL = 0x618,
UHYVE_PORT_IBV_WC_READ_OPCODE = 0x619,
UHYVE_PORT_IBV_WC_READ_VENDOR_ERR = 0x61A,
UHYVE_PORT_IBV_WC_READ_BYTE_LEN = 0x61B,
UHYVE_PORT_IBV_WC_READ_IMM_DATA = 0x61C,
UHYVE_PORT_IBV_WC_READ_INVALIDATED_RKEY = 0x61D,
UHYVE_PORT_IBV_WC_READ_QP_NUM = 0x61E,
UHYVE_PORT_IBV_WC_READ_SRC_QP = 0x61F,
UHYVE_PORT_IBV_WC_READ_WC_FLAGS = 0x620,
UHYVE_PORT_IBV_WC_READ_SLID = 0x621,
UHYVE_PORT_IBV_WC_READ_SL = 0x622,
UHYVE_PORT_IBV_WC_READ_DLID_PATH_BITS = 0x623,
UHYVE_PORT_IBV_WC_READ_COMPLETION_TS = 0x624,
UHYVE_PORT_IBV_WC_READ_CVLAN = 0x625,
UHYVE_PORT_IBV_WC_READ_FLOW_TAG = 0x626,
UHYVE_PORT_IBV_POST_WQ_RECV = 0x627,
UHYVE_PORT_VERBS_GET_CTX = 0x628,
UHYVE_PORT_IBV_GET_DEVICE_LIST = 0x629,
UHYVE_PORT_IBV_FREE_DEVICE_LIST = 0x62A,
UHYVE_PORT_IBV_GET_DEVICE_NAME = 0x62B,
UHYVE_PORT_IBV_GET_DEVICE_GUID = 0x62C,
UHYVE_PORT_IBV_OPEN_DEVICE = 0x62D,
UHYVE_PORT_IBV_CLOSE_DEVICE = 0x62E,
UHYVE_PORT_IBV_GET_ASYNC_EVENT = 0x62F,
UHYVE_PORT_IBV_ACK_ASYNC_EVENT = 0x630,
UHYVE_PORT_IBV_QUERY_DEVICE = 0x631,
UHYVE_PORT_IBV_QUERY_PORT = 0x632,
UHYVE_PORT____IBV_QUERY_PORT = 0x633,
UHYVE_PORT_IBV_QUERY_GID = 0x634,
UHYVE_PORT_IBV_QUERY_PKEY = 0x635,
UHYVE_PORT_IBV_ALLOC_PD = 0x636,
UHYVE_PORT_IBV_DEALLOC_PD = 0x637,
UHYVE_PORT_IBV_CREATE_FLOW = 0x638,
UHYVE_PORT_IBV_DESTROY_FLOW = 0x639,
UHYVE_PORT_IBV_OPEN_XRCD = 0x63A,
UHYVE_PORT_IBV_CLOSE_XRCD = 0x63B,
UHYVE_PORT_IBV_REG_MR = 0x63C,
UHYVE_PORT_IBV_REREG_MR = 0x63D,
UHYVE_PORT_IBV_DEREG_MR = 0x63E,
UHYVE_PORT_IBV_ALLOC_MW = 0x63F,
UHYVE_PORT_IBV_DEALLOC_MW = 0x640,
UHYVE_PORT_IBV_INC_RKEY = 0x641,
UHYVE_PORT_IBV_BIND_MW = 0x642,
UHYVE_PORT_IBV_CREATE_COMP_CHANNEL = 0x643,
UHYVE_PORT_IBV_DESTROY_COMP_CHANNEL = 0x644,
UHYVE_PORT_IBV_CREATE_CQ = 0x645,
UHYVE_PORT_IBV_CREATE_CQ_EX = 0x646,
UHYVE_PORT_IBV_RESIZE_CQ = 0x647,
UHYVE_PORT_IBV_DESTROY_CQ = 0x648,
UHYVE_PORT_IBV_GET_CQ_EVENT = 0x649,
UHYVE_PORT_IBV_ACK_CQ_EVENTS = 0x64A,
UHYVE_PORT_IBV_POLL_CQ = 0x64B,
UHYVE_PORT_IBV_REQ_NOTIFY_CQ = 0x64C,
UHYVE_PORT_IBV_CREATE_SRQ = 0x64D,
UHYVE_PORT_IBV_CREATE_SRQ_EX = 0x64E,
UHYVE_PORT_IBV_MODIFY_SRQ = 0x64F,
UHYVE_PORT_IBV_QUERY_SRQ = 0x650,
UHYVE_PORT_IBV_GET_SRQ_NUM = 0x651,
UHYVE_PORT_IBV_DESTROY_SRQ = 0x652,
UHYVE_PORT_IBV_POST_SRQ_RECV = 0x653,
UHYVE_PORT_IBV_CREATE_QP = 0x654,
UHYVE_PORT_IBV_CREATE_QP_EX = 0x655,
UHYVE_PORT_IBV_QUERY_RT_VALUES_EX = 0x656,
UHYVE_PORT_IBV_QUERY_DEVICE_EX = 0x657,
UHYVE_PORT_IBV_OPEN_QP = 0x658,
UHYVE_PORT_IBV_MODIFY_QP = 0x659,
UHYVE_PORT_IBV_QUERY_QP = 0x65A,
UHYVE_PORT_IBV_DESTROY_QP = 0x65B,
UHYVE_PORT_IBV_CREATE_WQ = 0x65C,
UHYVE_PORT_IBV_MODIFY_WQ = 0x65D,
UHYVE_PORT_IBV_DESTROY_WQ = 0x65E,
UHYVE_PORT_IBV_CREATE_RWQ_IND_TABLE = 0x65F,
UHYVE_PORT_IBV_DESTROY_RWQ_IND_TABLE = 0x660,
UHYVE_PORT_IBV_POST_SEND = 0x661,
UHYVE_PORT_IBV_POST_RECV = 0x662,
UHYVE_PORT_IBV_CREATE_AH = 0x663,
UHYVE_PORT_IBV_INIT_AH_FROM_WC = 0x664,
UHYVE_PORT_IBV_CREATE_AH_FROM_WC = 0x665,
UHYVE_PORT_IBV_DESTROY_AH = 0x666,
UHYVE_PORT_IBV_ATTACH_MCAST = 0x667,
UHYVE_PORT_IBV_DETACH_MCAST = 0x668,
UHYVE_PORT_IBV_FORK_INIT = 0x669,
UHYVE_PORT_IBV_NODE_TYPE_STR = 0x66A,
UHYVE_PORT_IBV_PORT_STATE_STR = 0x66B,
UHYVE_PORT_IBV_EVENT_TYPE_STR = 0x66C,
UHYVE_PORT_IBV_RESOLVE_ETH_L2_FROM_GID = 0x66D,
UHYVE_PORT_IBV_IS_QPT_SUPPORTED = 0x66E,
UHYVE_PORT_KERNEL_IBV_LOG = 0x66F,
} uhyve_ibv_t;
typedef struct {
// Parameters:
enum ibv_wc_status status;
// Return value:
const char * ret;
} __attribute__((packed)) uhyve_ibv_wc_status_str_t;
typedef struct {
// Parameters:
enum ibv_rate rate;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_rate_to_mult_t;
typedef struct {
// Parameters:
int mult;
// Return value:
enum ibv_rate ret;
} __attribute__((packed)) uhyve_mult_to_ibv_rate_t;
typedef struct {
// Parameters:
enum ibv_rate rate;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_rate_to_mbps_t;
typedef struct {
// Parameters:
int mbps;
// Return value:
enum ibv_rate ret;
} __attribute__((packed)) uhyve_mbps_to_ibv_rate_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
struct ibv_cq * ret;
} __attribute__((packed)) uhyve_ibv_cq_ex_to_cq_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
struct ibv_poll_cq_attr * attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_start_poll_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_next_poll_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
} __attribute__((packed)) uhyve_ibv_end_poll_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
enum ibv_wc_opcode ret;
} __attribute__((packed)) uhyve_ibv_wc_read_opcode_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_vendor_err_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_byte_len_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
__be32 ret;
} __attribute__((packed)) uhyve_ibv_wc_read_imm_data_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_invalidated_rkey_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_qp_num_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_src_qp_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_wc_read_wc_flags_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_slid_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint8_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_sl_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint8_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_dlid_path_bits_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint64_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_completion_ts_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint16_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_cvlan_t;
typedef struct {
// Parameters:
struct ibv_cq_ex * cq;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_wc_read_flow_tag_t;
typedef struct {
// Parameters:
struct ibv_wq * wq;
struct ibv_recv_wr * recv_wr;
struct ibv_recv_wr ** bad_recv_wr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_post_wq_recv_t;
typedef struct {
// Parameters:
struct ibv_context * ctx;
// Return value:
struct verbs_context * ret;
} __attribute__((packed)) uhyve_verbs_get_ctx_t;
typedef struct {
// Parameters:
int * num_devices;
// Return value:
// struct ibv_device * ret[MAX_NUM_OF_IBV_DEVICES];
struct ibv_device ** ret;
} __attribute__((packed)) uhyve_ibv_get_device_list_t;
typedef struct {
// Parameters:
struct ibv_device ** list;
} __attribute__((packed)) uhyve_ibv_free_device_list_t;
typedef struct {
// Parameters:
struct ibv_device * device;
// Return value:
const char * ret; // TODO Should this be const?
const char * ret;
} __attribute__((packed)) uhyve_ibv_get_device_name_t;
typedef struct {
// Parameters:
struct ibv_device * device;
// Return value:
__be64 ret;
} __attribute__((packed)) uhyve_ibv_get_device_guid_t;
typedef struct {
// Parameters:
struct ibv_device * device;
@ -61,6 +336,34 @@ typedef struct {
struct ibv_context * ret;
} __attribute__((packed)) uhyve_ibv_open_device_t;
typedef struct {
// Parameters:
struct ibv_context * context;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_close_device_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_async_event * event;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_get_async_event_t;
typedef struct {
// Parameters:
struct ibv_async_event * event;
} __attribute__((packed)) uhyve_ibv_ack_async_event_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_device_attr * device_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_device_t;
typedef struct {
// Parameters:
struct ibv_context * context;
@ -70,6 +373,139 @@ typedef struct {
int ret;
} __attribute__((packed)) uhyve_ibv_query_port_t;
typedef struct {
// Parameters:
struct ibv_context * context;
uint8_t port_num;
struct ibv_port_attr * port_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve____ibv_query_port_t;
typedef struct {
// Parameters:
struct ibv_context * context;
uint8_t port_num;
int index;
union ibv_gid * gid;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_gid_t;
typedef struct {
// Parameters:
struct ibv_context * context;
uint8_t port_num;
int index;
__be16 * pkey;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_pkey_t;
typedef struct {
// Parameters:
struct ibv_context * context;
// Return value:
struct ibv_pd * ret;
} __attribute__((packed)) uhyve_ibv_alloc_pd_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_dealloc_pd_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_flow_attr * flow;
// Return value:
struct ibv_flow * ret;
} __attribute__((packed)) uhyve_ibv_create_flow_t;
typedef struct {
// Parameters:
struct ibv_flow * flow_id;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_flow_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_xrcd_init_attr * xrcd_init_attr;
// Return value:
struct ibv_xrcd * ret;
} __attribute__((packed)) uhyve_ibv_open_xrcd_t;
typedef struct {
// Parameters:
struct ibv_xrcd * xrcd;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_close_xrcd_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
void * addr;
int length;
int access;
// Return value:
struct ibv_mr * ret;
} __attribute__((packed)) uhyve_ibv_reg_mr_t;
typedef struct {
// Parameters:
struct ibv_mr * mr;
int flags;
struct ibv_pd * pd;
void * addr;
int length;
int access;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_rereg_mr_t;
typedef struct {
// Parameters:
struct ibv_mr * mr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_dereg_mr_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
enum ibv_mw_type type;
// Return value:
struct ibv_mw * ret;
} __attribute__((packed)) uhyve_ibv_alloc_mw_t;
typedef struct {
// Parameters:
struct ibv_mw * mw;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_dealloc_mw_t;
typedef struct {
// Parameters:
uint32_t rkey;
// Return value:
uint32_t ret;
} __attribute__((packed)) uhyve_ibv_inc_rkey_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_mw * mw;
struct ibv_mw_bind * mw_bind;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_bind_mw_t;
typedef struct {
// Parameters:
struct ibv_context * context;
@ -77,10 +513,455 @@ typedef struct {
struct ibv_comp_channel * ret;
} __attribute__((packed)) uhyve_ibv_create_comp_channel_t;
void call_ibv_open_device(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_device_name(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_port(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_comp_channel(struct kvm_run * run, uint8_t * guest_mem);
typedef struct {
// Parameters:
struct ibv_comp_channel * channel;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_comp_channel_t;
typedef struct {
// Parameters:
struct ibv_context * context;
int cqe;
void * cq_context;
struct ibv_comp_channel * channel;
int comp_vector;
// Return value:
struct ibv_cq * ret;
} __attribute__((packed)) uhyve_ibv_create_cq_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_cq_init_attr_ex * cq_attr;
// Return value:
struct ibv_cq_ex * ret;
} __attribute__((packed)) uhyve_ibv_create_cq_ex_t;
typedef struct {
// Parameters:
struct ibv_cq * cq;
int cqe;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_resize_cq_t;
typedef struct {
// Parameters:
struct ibv_cq * cq;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_cq_t;
typedef struct {
// Parameters:
struct ibv_comp_channel * channel;
struct ibv_cq ** cq;
void ** cq_context;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_get_cq_event_t;
typedef struct {
// Parameters:
struct ibv_cq * cq;
unsigned int nevents;
} __attribute__((packed)) uhyve_ibv_ack_cq_events_t;
typedef struct {
// Parameters:
struct ibv_cq * cq;
int num_entries;
struct ibv_wc * wc;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_poll_cq_t;
typedef struct {
// Parameters:
struct ibv_cq * cq;
int solicited_only;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_req_notify_cq_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
struct ibv_srq_init_attr * srq_init_attr;
// Return value:
struct ibv_srq * ret;
} __attribute__((packed)) uhyve_ibv_create_srq_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_srq_init_attr_ex * srq_init_attr_ex;
// Return value:
struct ibv_srq * ret;
} __attribute__((packed)) uhyve_ibv_create_srq_ex_t;
typedef struct {
// Parameters:
struct ibv_srq * srq;
struct ibv_srq_attr * srq_attr;
int srq_attr_mask;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_modify_srq_t;
typedef struct {
// Parameters:
struct ibv_srq * srq;
struct ibv_srq_attr * srq_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_srq_t;
typedef struct {
// Parameters:
struct ibv_srq * srq;
uint32_t * srq_num;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_get_srq_num_t;
typedef struct {
// Parameters:
struct ibv_srq * srq;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_srq_t;
typedef struct {
// Parameters:
struct ibv_srq * srq;
struct ibv_recv_wr * recv_wr;
struct ibv_recv_wr ** bad_recv_wr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_post_srq_recv_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
struct ibv_qp_init_attr * qp_init_attr;
// Return value:
struct ibv_qp * ret;
} __attribute__((packed)) uhyve_ibv_create_qp_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_qp_init_attr_ex * qp_init_attr_ex;
// Return value:
struct ibv_qp * ret;
} __attribute__((packed)) uhyve_ibv_create_qp_ex_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_values_ex * values;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_rt_values_ex_t;
typedef struct {
// Parameters:
struct ibv_context * context;
const struct ibv_query_device_ex_input * input;
struct ibv_device_attr_ex * attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_device_ex_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_qp_open_attr * qp_open_attr;
// Return value:
struct ibv_qp * ret;
} __attribute__((packed)) uhyve_ibv_open_qp_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_qp_attr * attr;
int attr_mask;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_modify_qp_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_qp_attr * attr;
int attr_mask;
struct ibv_qp_init_attr * init_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_query_qp_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_qp_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_wq_init_attr * wq_init_attr;
// Return value:
struct ibv_wq * ret;
} __attribute__((packed)) uhyve_ibv_create_wq_t;
typedef struct {
// Parameters:
struct ibv_wq * wq;
struct ibv_wq_attr * wq_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_modify_wq_t;
typedef struct {
// Parameters:
struct ibv_wq * wq;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_wq_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_rwq_ind_table_init_attr * init_attr;
// Return value:
struct ibv_rwq_ind_table * ret;
} __attribute__((packed)) uhyve_ibv_create_rwq_ind_table_t;
typedef struct {
// Parameters:
struct ibv_rwq_ind_table * rwq_ind_table;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_rwq_ind_table_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_send_wr * wr;
struct ibv_send_wr ** bad_wr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_post_send_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
struct ibv_recv_wr * wr;
struct ibv_recv_wr ** bad_wr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_post_recv_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
struct ibv_ah_attr * attr;
// Return value:
struct ibv_ah * ret;
} __attribute__((packed)) uhyve_ibv_create_ah_t;
typedef struct {
// Parameters:
struct ibv_context * context;
uint8_t port_num;
struct ibv_wc * wc;
struct ibv_grh * grh;
struct ibv_ah_attr * ah_attr;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_init_ah_from_wc_t;
typedef struct {
// Parameters:
struct ibv_pd * pd;
struct ibv_wc * wc;
struct ibv_grh * grh;
uint8_t port_num;
// Return value:
struct ibv_ah * ret;
} __attribute__((packed)) uhyve_ibv_create_ah_from_wc_t;
typedef struct {
// Parameters:
struct ibv_ah * ah;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_destroy_ah_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
const union ibv_gid * gid;
uint16_t lid;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_attach_mcast_t;
typedef struct {
// Parameters:
struct ibv_qp * qp;
const union ibv_gid * gid;
uint16_t lid;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_detach_mcast_t;
typedef struct {
// Parameters:
;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_fork_init_t;
typedef struct {
// Parameters:
enum ibv_node_type node_type;
// Return value:
const char * ret;
} __attribute__((packed)) uhyve_ibv_node_type_str_t;
typedef struct {
// Parameters:
enum ibv_port_state port_state;
// Return value:
const char * ret;
} __attribute__((packed)) uhyve_ibv_port_state_str_t;
typedef struct {
// Parameters:
enum ibv_event_type event;
// Return value:
const char * ret;
} __attribute__((packed)) uhyve_ibv_event_type_str_t;
typedef struct {
// Parameters:
struct ibv_context * context;
struct ibv_ah_attr * attr;
uint8_t [6] eth_mac;
uint16_t * vid;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_resolve_eth_l2_from_gid_t;
typedef struct {
// Parameters:
uint32_t caps;
enum ibv_qp_type qpt;
// Return value:
int ret;
} __attribute__((packed)) uhyve_ibv_is_qpt_supported_t;
void call_ibv_wc_status_str(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_rate_to_mult(struct kvm_run * run, uint8_t * guest_mem);
void call_mult_to_ibv_rate(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_rate_to_mbps(struct kvm_run * run, uint8_t * guest_mem);
void call_mbps_to_ibv_rate(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_cq_ex_to_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_start_poll(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_next_poll(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_end_poll(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_opcode(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_vendor_err(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_byte_len(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_imm_data(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_invalidated_rkey(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_qp_num(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_src_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_wc_flags(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_slid(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_sl(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_dlid_path_bits(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_completion_ts(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_cvlan(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_wc_read_flow_tag(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_post_wq_recv(struct kvm_run * run, uint8_t * guest_mem);
void call_verbs_get_ctx(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_device_list(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_free_device_list(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_device_name(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_device_guid(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_open_device(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_close_device(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_async_event(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_ack_async_event(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_device(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_port(struct kvm_run * run, uint8_t * guest_mem);
void call____ibv_query_port(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_gid(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_pkey(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_alloc_pd(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_dealloc_pd(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_flow(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_flow(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_open_xrcd(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_close_xrcd(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_reg_mr(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_rereg_mr(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_dereg_mr(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_alloc_mw(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_dealloc_mw(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_inc_rkey(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_bind_mw(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_comp_channel(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_comp_channel(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_cq_ex(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_resize_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_cq_event(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_ack_cq_events(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_poll_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_req_notify_cq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_srq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_srq_ex(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_modify_srq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_srq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_get_srq_num(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_srq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_post_srq_recv(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_qp_ex(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_rt_values_ex(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_device_ex(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_open_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_modify_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_query_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_qp(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_wq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_modify_wq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_wq(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_rwq_ind_table(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_rwq_ind_table(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_post_send(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_post_recv(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_ah(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_init_ah_from_wc(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_create_ah_from_wc(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_destroy_ah(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_attach_mcast(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_detach_mcast(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_fork_init(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_node_type_str(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_port_state_str(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_event_type_str(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_resolve_eth_l2_from_gid(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_is_qpt_supported(struct kvm_run * run, uint8_t * guest_mem);
#endif // UHYVE_IBV_H

View file

@ -1256,6 +1256,8 @@ static int vcpu_loop(void)
break;
}
// InfiniBand
case UHYVE_PORT_KERNEL_IBV_LOG: {
unsigned data = *((unsigned*)((size_t)run+run->io.data_offset));
char* str = (char*) (guest_mem + data);
@ -1263,39 +1265,299 @@ static int vcpu_loop(void)
break;
}
// InfiniBand
case UHYVE_PORT_SET_IB_POOL_ADDR:
printf("LOG: UHYVE CASE\n");
unsigned data = *((unsigned*)((size_t)run+run->io.data_offset));
uint64_t * temp = (uint64_t*)(guest_mem + data);
/* printf("LOG: Value of uint64 pool start: %" PRIu64 "\n", *temp); */
printf("LOG: Value of uint64 pool start: %p\n", *temp);
ib_pool_addr = (uint8_t*) *temp;
/* printf("LOG: Value of uint8 pool start: %" PRIu8 "\n", ib_pool_addr); */
printf("LOG: Value of uint8 pool start: %p\n", ib_pool_addr);
ib_pool_top = ib_pool_addr;
break;
case UHYVE_PORT_SET_IB_POOL_ADDR: {
unsigned data = *((unsigned*)((size_t)run+run->io.data_offset));
uint64_t * temp = (uint64_t*)(guest_mem + data);
ib_pool_addr = (uint8_t*) *temp;
ib_pool_top = ib_pool_addr;
break;
}
case UHYVE_PORT_IBV_WC_STATUS_STR:
call_ibv_wc_status_str(run, guest_mem);
break;
case UHYVE_PORT_IBV_RATE_TO_MULT:
call_ibv_rate_to_mult(run, guest_mem);
break;
case UHYVE_PORT_MULT_TO_IBV_RATE:
call_mult_to_ibv_rate(run, guest_mem);
break;
case UHYVE_PORT_IBV_RATE_TO_MBPS:
call_ibv_rate_to_mbps(run, guest_mem);
break;
case UHYVE_PORT_MBPS_TO_IBV_RATE:
call_mbps_to_ibv_rate(run, guest_mem);
break;
case UHYVE_PORT_IBV_CQ_EX_TO_CQ:
call_ibv_cq_ex_to_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_START_POLL:
call_ibv_start_poll(run, guest_mem);
break;
case UHYVE_PORT_IBV_NEXT_POLL:
call_ibv_next_poll(run, guest_mem);
break;
case UHYVE_PORT_IBV_END_POLL:
call_ibv_end_poll(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_OPCODE:
call_ibv_wc_read_opcode(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_VENDOR_ERR:
call_ibv_wc_read_vendor_err(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_BYTE_LEN:
call_ibv_wc_read_byte_len(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_IMM_DATA:
call_ibv_wc_read_imm_data(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_INVALIDATED_RKEY:
call_ibv_wc_read_invalidated_rkey(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_QP_NUM:
call_ibv_wc_read_qp_num(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_SRC_QP:
call_ibv_wc_read_src_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_WC_FLAGS:
call_ibv_wc_read_wc_flags(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_SLID:
call_ibv_wc_read_slid(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_SL:
call_ibv_wc_read_sl(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_DLID_PATH_BITS:
call_ibv_wc_read_dlid_path_bits(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_COMPLETION_TS:
call_ibv_wc_read_completion_ts(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_CVLAN:
call_ibv_wc_read_cvlan(run, guest_mem);
break;
case UHYVE_PORT_IBV_WC_READ_FLOW_TAG:
call_ibv_wc_read_flow_tag(run, guest_mem);
break;
case UHYVE_PORT_IBV_POST_WQ_RECV:
call_ibv_post_wq_recv(run, guest_mem);
break;
case UHYVE_PORT_VERBS_GET_CTX:
call_verbs_get_ctx(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_DEVICE_LIST:
printf("LOG: UHYVE CASE\n");
call_ibv_get_device_list(run, guest_mem);
break;
case UHYVE_PORT_IBV_FREE_DEVICE_LIST:
call_ibv_free_device_list(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_DEVICE_NAME:
printf("LOG: UHYVE CASE UHYVE_PORT_IBV_GET_DEVICE_NAME\n");
call_ibv_get_device_name(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_DEVICE_GUID:
call_ibv_get_device_guid(run, guest_mem);
break;
case UHYVE_PORT_IBV_OPEN_DEVICE:
printf("LOG: UHYVE CASE UHYVE_PORT_IBV_OPEN_DEVICE\n");
call_ibv_open_device(run, guest_mem);
break;
case UHYVE_PORT_IBV_CLOSE_DEVICE:
call_ibv_close_device(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_ASYNC_EVENT:
call_ibv_get_async_event(run, guest_mem);
break;
case UHYVE_PORT_IBV_ACK_ASYNC_EVENT:
call_ibv_ack_async_event(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_DEVICE:
call_ibv_query_device(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_PORT:
printf("LOG: UHYVE CASE UHYVE_PORT_IBV_QUERY_PORT\n");
call_ibv_query_port(run, guest_mem);
break;
case UHYVE_PORT____IBV_QUERY_PORT:
call____ibv_query_port(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_GID:
call_ibv_query_gid(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_PKEY:
call_ibv_query_pkey(run, guest_mem);
break;
case UHYVE_PORT_IBV_ALLOC_PD:
call_ibv_alloc_pd(run, guest_mem);
break;
case UHYVE_PORT_IBV_DEALLOC_PD:
call_ibv_dealloc_pd(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_FLOW:
call_ibv_create_flow(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_FLOW:
call_ibv_destroy_flow(run, guest_mem);
break;
case UHYVE_PORT_IBV_OPEN_XRCD:
call_ibv_open_xrcd(run, guest_mem);
break;
case UHYVE_PORT_IBV_CLOSE_XRCD:
call_ibv_close_xrcd(run, guest_mem);
break;
case UHYVE_PORT_IBV_REG_MR:
call_ibv_reg_mr(run, guest_mem);
break;
case UHYVE_PORT_IBV_REREG_MR:
call_ibv_rereg_mr(run, guest_mem);
break;
case UHYVE_PORT_IBV_DEREG_MR:
call_ibv_dereg_mr(run, guest_mem);
break;
case UHYVE_PORT_IBV_ALLOC_MW:
call_ibv_alloc_mw(run, guest_mem);
break;
case UHYVE_PORT_IBV_DEALLOC_MW:
call_ibv_dealloc_mw(run, guest_mem);
break;
case UHYVE_PORT_IBV_INC_RKEY:
call_ibv_inc_rkey(run, guest_mem);
break;
case UHYVE_PORT_IBV_BIND_MW:
call_ibv_bind_mw(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_COMP_CHANNEL:
printf("LOG: UHYVE CASE UHYVE_PORT_IBV_CREATE_COMP_CHANNEL\n");
call_ibv_create_comp_channel(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_COMP_CHANNEL:
call_ibv_destroy_comp_channel(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_CQ:
call_ibv_create_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_CQ_EX:
call_ibv_create_cq_ex(run, guest_mem);
break;
case UHYVE_PORT_IBV_RESIZE_CQ:
call_ibv_resize_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_CQ:
call_ibv_destroy_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_CQ_EVENT:
call_ibv_get_cq_event(run, guest_mem);
break;
case UHYVE_PORT_IBV_ACK_CQ_EVENTS:
call_ibv_ack_cq_events(run, guest_mem);
break;
case UHYVE_PORT_IBV_POLL_CQ:
call_ibv_poll_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_REQ_NOTIFY_CQ:
call_ibv_req_notify_cq(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_SRQ:
call_ibv_create_srq(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_SRQ_EX:
call_ibv_create_srq_ex(run, guest_mem);
break;
case UHYVE_PORT_IBV_MODIFY_SRQ:
call_ibv_modify_srq(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_SRQ:
call_ibv_query_srq(run, guest_mem);
break;
case UHYVE_PORT_IBV_GET_SRQ_NUM:
call_ibv_get_srq_num(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_SRQ:
call_ibv_destroy_srq(run, guest_mem);
break;
case UHYVE_PORT_IBV_POST_SRQ_RECV:
call_ibv_post_srq_recv(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_QP:
call_ibv_create_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_QP_EX:
call_ibv_create_qp_ex(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_RT_VALUES_EX:
call_ibv_query_rt_values_ex(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_DEVICE_EX:
call_ibv_query_device_ex(run, guest_mem);
break;
case UHYVE_PORT_IBV_OPEN_QP:
call_ibv_open_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_MODIFY_QP:
call_ibv_modify_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_QUERY_QP:
call_ibv_query_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_QP:
call_ibv_destroy_qp(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_WQ:
call_ibv_create_wq(run, guest_mem);
break;
case UHYVE_PORT_IBV_MODIFY_WQ:
call_ibv_modify_wq(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_WQ:
call_ibv_destroy_wq(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_RWQ_IND_TABLE:
call_ibv_create_rwq_ind_table(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_RWQ_IND_TABLE:
call_ibv_destroy_rwq_ind_table(run, guest_mem);
break;
case UHYVE_PORT_IBV_POST_SEND:
call_ibv_post_send(run, guest_mem);
break;
case UHYVE_PORT_IBV_POST_RECV:
call_ibv_post_recv(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_AH:
call_ibv_create_ah(run, guest_mem);
break;
case UHYVE_PORT_IBV_INIT_AH_FROM_WC:
call_ibv_init_ah_from_wc(run, guest_mem);
break;
case UHYVE_PORT_IBV_CREATE_AH_FROM_WC:
call_ibv_create_ah_from_wc(run, guest_mem);
break;
case UHYVE_PORT_IBV_DESTROY_AH:
call_ibv_destroy_ah(run, guest_mem);
break;
case UHYVE_PORT_IBV_ATTACH_MCAST:
call_ibv_attach_mcast(run, guest_mem);
break;
case UHYVE_PORT_IBV_DETACH_MCAST:
call_ibv_detach_mcast(run, guest_mem);
break;
case UHYVE_PORT_IBV_FORK_INIT:
call_ibv_fork_init(run, guest_mem);
break;
case UHYVE_PORT_IBV_NODE_TYPE_STR:
call_ibv_node_type_str(run, guest_mem);
break;
case UHYVE_PORT_IBV_PORT_STATE_STR:
call_ibv_port_state_str(run, guest_mem);
break;
case UHYVE_PORT_IBV_EVENT_TYPE_STR:
call_ibv_event_type_str(run, guest_mem);
break;
case UHYVE_PORT_IBV_RESOLVE_ETH_L2_FROM_GID:
call_ibv_resolve_eth_l2_from_gid(run, guest_mem);
break;
case UHYVE_PORT_IBV_IS_QPT_SUPPORTED:
call_ibv_is_qpt_supported(run, guest_mem);
break;
default:
err(1, "KVM: unhandled KVM_EXIT_IO at port 0x%x, direction %d\n", run->io.port, run->io.direction);