1MLX4DV_INIT_OBJ(3) Library Functions Manual MLX4DV_INIT_OBJ(3)
2
3
4
6 mlx4dv_init_obj - Initialize mlx4 direct verbs object from ibv_xxx
7 structures
8
10 #include <infiniband/mlx4dv.h>
11
12 int mlx4dv_init_obj(struct mlx4dv_obj *obj, uint64_t obj_type);
13
15 mlx4dv_init_obj() This function will initialize mlx4dv_xxx structs
16 based on supplied type. The information for initialization is taken
17 from ibv_xx structs supplied as part of input.
18
19 Request information of CQ marks its owned by direct verbs for all con‐
20 sumer index related actions. The initialization type can be combination
21 of several types together.
22
23 struct mlx4dv_qp {
24 uint32_t *rdb;
25 uint32_t *sdb;
26 struct {
27 uint32_t wqe_cnt;
28 int wqe_shift;
29 int offset;
30 } sq;
31 struct {
32 uint32_t wqe_cnt;
33 int wqe_shift;
34 int offset;
35 } rq;
36 struct {
37 void *buf;
38 size_t length;
39 } buf;
40 uint64_t comp_mask; /* Use enum mlx4dv_qp_comp_mask */
41 off_t uar_mmap_offset; /* If MLX4DV_QP_MASK_UAR_MMAP_OFFSET is set in comp_mask, this will contain the mmap offset of *sdb* */
42 };
43
44 struct mlx4dv_cq {
45 struct {
46 void *buf;
47 size_t length;
48 } buf;
49 uint32_t cqe_cnt;
50 uint32_t cqn;
51 uint32_t *set_ci_db;
52 uint32_t *arm_db;
53 int arm_sn;
54 int cqe_size;
55 uint64_t comp_mask; /* Use enum mlx4dv_cq_comp_mask */
56 void *cq_uar;
57 };
58
59 struct mlx4dv_srq {
60 struct {
61 void *buf;
62 size_t length;
63 } buf;
64 int wqe_shift;
65 int head;
66 int tail;
67 uint32_t *db;
68 uint64_t comp_mask;
69 };
70
71 struct mlx4dv_rwq {
72 __be32 *rdb;
73 struct {
74 uint32_t wqe_cnt;
75 int wqe_shift;
76 int offset;
77 } rq;
78 struct {
79 void *buf;
80 size_t length;
81 } buf;
82 uint64_t comp_mask;
83 };
84
85 struct mlx4dv_obj {
86 struct {
87 struct ibv_qp *in;
88 struct mlx4dv_qp *out;
89 } qp;
90 struct {
91 struct ibv_cq *in;
92 struct mlx4dv_cq *out;
93 } cq;
94 };
95
96 enum mlx4dv_obj_type {
97 MLX4DV_OBJ_QP = 1 << 0,
98 MLX4DV_OBJ_CQ = 1 << 1,
99 MLX4DV_OBJ_SRQ = 1 << 2,
100 };
101
103 0 on success or the value of errno on failure (which indicates the
104 failure reason).
105
107 * Compatibility masks (comp_mask) are in/out fields.
108
110 mlx4dv(7)
111
113 Maor Gottlieb <maorg@mellanox.com>
114
115
116
1171.0.0 2017-02-02 MLX4DV_INIT_OBJ(3)