1MLX5DV_INIT_OBJ(3)         Library Functions Manual         MLX5DV_INIT_OBJ(3)
2
3
4

NAME

6       mlx5dv_init_obj  -  Initialize  mlx5  direct  verbs object from ibv_xxx
7       structures
8

SYNOPSIS

10       #include <infiniband/mlx5dv.h>
11
12       int mlx5dv_init_obj(struct mlx5dv_obj *obj, uint64_t obj_type);
13

DESCRIPTION

15       mlx5dv_init_obj() This  function  will  initialize  mlx5dv_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 mlx5dv_qp {
24               uint32_t                *dbrec;
25               struct {
26                       void            *buf;
27                       uint32_t        wqe_cnt;
28                       uint32_t        stride;
29               } sq;
30               struct {
31                       void            *buf;
32                       uint32_t        wqe_cnt;
33                       uint32_t        stride;
34               } rq;
35               struct {
36                       void            *reg;
37                       uint32_t        size;
38               } bf;
39               uint64_t                comp_mask;
40               off_t               uar_mmap_offset;
41               uint32_t       tirn;
42               uint32_t       tisn;
43               uint32_t       rqn;
44               uint32_t       sqn;
45               uint64_t       tir_icm_address;
46       };
47
48       struct mlx5dv_cq {
49               void                    *buf;
50               uint32_t                *dbrec;
51               uint32_t                cqe_cnt;
52               uint32_t                cqe_size;
53               void                    *cq_uar;
54               uint32_t                cqn;
55               uint64_t                comp_mask;
56       };
57
58       struct mlx5dv_srq {
59               void                    *buf;
60               uint32_t                *dbrec;
61               uint32_t                stride;
62               uint32_t                head;
63               uint32_t                tail;
64               uint64_t                comp_mask;
65               uint32_t                srqn;
66       };
67
68       struct mlx5dv_rwq {
69               void            *buf;
70               uint32_t        *dbrec;
71               uint32_t        wqe_cnt;
72               uint32_t        stride;
73               uint64_t        comp_mask;
74       };
75
76       struct mlx5dv_dm {
77               void      *buf;
78               uint64_t  length;
79               uint64_t  comp_mask;
80               uint64_t  remote_va;
81       };
82
83       struct mlx5dv_ah {
84               struct mlx5_wqe_av    *av;
85               uint64_t              comp_mask;
86       };
87
88       struct mlx5dv_pd {
89               uint32_t              pdn;
90               uint64_t              comp_mask;
91       };
92
93       struct mlx5dv_obj {
94               struct {
95                       struct ibv_qp           *in;
96                       struct mlx5dv_qp        *out;
97               } qp;
98               struct {
99                       struct ibv_cq           *in;
100                       struct mlx5dv_cq        *out;
101               } cq;
102               struct {
103                       struct ibv_srq          *in;
104                       struct mlx5dv_srq       *out;
105               } srq;
106               struct {
107                       struct ibv_wq           *in;
108                       struct mlx5dv_rwq       *out;
109               } rwq;
110               struct {
111                       struct ibv_dm       *in;
112                       struct mlx5dv_dm    *out;
113               } dm;
114               struct {
115                       struct ibv_ah       *in;
116                       struct mlx5dv_ah    *out;
117               } ah;
118               struct {
119                       struct ibv_pd           *in;
120                       struct mlx5dv_pd        *out;
121               } pd;
122       };
123
124       enum mlx5dv_obj_type {
125               MLX5DV_OBJ_QP   = 1 << 0,
126               MLX5DV_OBJ_CQ   = 1 << 1,
127               MLX5DV_OBJ_SRQ  = 1 << 2,
128               MLX5DV_OBJ_RWQ  = 1 << 3,
129               MLX5DV_OBJ_DM   = 1 << 4,
130               MLX5DV_OBJ_AH   = 1 << 5,
131               MLX5DV_OBJ_PD   = 1 << 6,
132       };
133

RETURN VALUE

135       0 on success or the value of errno  on  failure  (which  indicates  the
136       failure reason).
137

NOTES

139        *   The   information   if   doorbell   is   blueflame   is  based  on
140       mlx5dv_qp->bf->size, in case of 0 it's not a BF.
141        * Compatibility masks (comp_mask) are in/out fields.
142

SEE ALSO

144       mlx5dv(7)
145

AUTHORS

147       Leon Romanovsky <leonro@mellanox.com>
148
149
150
1511.0.0                             2017-02-02                MLX5DV_INIT_OBJ(3)
Impressum