1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2018 6WIND S.A.
3 * Copyright 2018 Mellanox
12 /* Verbs headers do not support -pedantic. */
14 #pragma GCC diagnostic ignored "-Wpedantic"
16 #include <infiniband/mlx4dv.h>
17 #include <infiniband/verbs.h>
19 #pragma GCC diagnostic error "-Wpedantic"
23 int (*fork_init)(void);
24 int (*get_async_event)(struct ibv_context *context,
25 struct ibv_async_event *event);
26 void (*ack_async_event)(struct ibv_async_event *event);
27 struct ibv_pd *(*alloc_pd)(struct ibv_context *context);
28 int (*dealloc_pd)(struct ibv_pd *pd);
29 struct ibv_device **(*get_device_list)(int *num_devices);
30 void (*free_device_list)(struct ibv_device **list);
31 struct ibv_context *(*open_device)(struct ibv_device *device);
32 int (*close_device)(struct ibv_context *context);
33 const char *(*get_device_name)(struct ibv_device *device);
34 int (*query_device)(struct ibv_context *context,
35 struct ibv_device_attr *device_attr);
36 int (*query_device_ex)(struct ibv_context *context,
37 const struct ibv_query_device_ex_input *input,
38 struct ibv_device_attr_ex *attr);
39 int (*query_port)(struct ibv_context *context, uint8_t port_num,
40 struct ibv_port_attr *port_attr);
41 const char *(*port_state_str)(enum ibv_port_state port_state);
42 struct ibv_comp_channel *(*create_comp_channel)
43 (struct ibv_context *context);
44 int (*destroy_comp_channel)(struct ibv_comp_channel *channel);
45 struct ibv_cq *(*create_cq)(struct ibv_context *context, int cqe,
47 struct ibv_comp_channel *channel,
49 int (*destroy_cq)(struct ibv_cq *cq);
50 int (*get_cq_event)(struct ibv_comp_channel *channel,
51 struct ibv_cq **cq, void **cq_context);
52 void (*ack_cq_events)(struct ibv_cq *cq, unsigned int nevents);
53 struct ibv_flow *(*create_flow)(struct ibv_qp *qp,
54 struct ibv_flow_attr *flow);
55 int (*destroy_flow)(struct ibv_flow *flow_id);
56 struct ibv_qp *(*create_qp)(struct ibv_pd *pd,
57 struct ibv_qp_init_attr *qp_init_attr);
58 struct ibv_qp *(*create_qp_ex)
59 (struct ibv_context *context,
60 struct ibv_qp_init_attr_ex *qp_init_attr_ex);
61 int (*destroy_qp)(struct ibv_qp *qp);
62 int (*modify_qp)(struct ibv_qp *qp, struct ibv_qp_attr *attr,
64 struct ibv_mr *(*reg_mr)(struct ibv_pd *pd, void *addr,
65 size_t length, int access);
66 int (*dereg_mr)(struct ibv_mr *mr);
67 struct ibv_rwq_ind_table *(*create_rwq_ind_table)
68 (struct ibv_context *context,
69 struct ibv_rwq_ind_table_init_attr *init_attr);
70 int (*destroy_rwq_ind_table)(struct ibv_rwq_ind_table *rwq_ind_table);
71 struct ibv_wq *(*create_wq)(struct ibv_context *context,
72 struct ibv_wq_init_attr *wq_init_attr);
73 int (*destroy_wq)(struct ibv_wq *wq);
74 int (*modify_wq)(struct ibv_wq *wq, struct ibv_wq_attr *wq_attr);
75 int (*dv_init_obj)(struct mlx4dv_obj *obj, uint64_t obj_type);
76 int (*dv_set_context_attr)(struct ibv_context *context,
77 enum mlx4dv_set_ctx_attr_type attr_type,
81 const struct mlx4_glue *mlx4_glue;
83 #endif /* MLX4_GLUE_H_ */