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       };
41
42       struct mlx5dv_cq {
43               void                    *buf;
44               uint32_t                *dbrec;
45               uint32_t                cqe_cnt;
46               uint32_t                cqe_size;
47               void                    *cq_uar;
48               uint32_t                cqn;
49               uint64_t                comp_mask;
50       };
51
52       struct mlx5dv_srq {
53               void                    *buf;
54               uint32_t                *dbrec;
55               uint32_t                stride;
56               uint32_t                head;
57               uint32_t                tail;
58               uint64_t                comp_mask;
59               uint32_t                srqn;
60       };
61
62       struct mlx5dv_rwq {
63               void            *buf;
64               uint32_t        *dbrec;
65               uint32_t        wqe_cnt;
66               uint32_t        stride;
67               uint64_t        comp_mask;
68       };
69
70       struct mlx5dv_dm {
71               void      *buf;
72               uint64_t  length;
73               uint64_t  comp_mask;
74       };
75
76       struct mlx5dv_ah {
77               struct mlx5_wqe_av    *av;
78               uint64_t              comp_mask;
79       };
80
81       struct mlx5dv_pd {
82               uint32_t              pdn;
83               uint64_t              comp_mask;
84       };
85
86       struct mlx5dv_obj {
87               struct {
88                       struct ibv_qp           *in;
89                       struct mlx5dv_qp        *out;
90               } qp;
91               struct {
92                       struct ibv_cq           *in;
93                       struct mlx5dv_cq        *out;
94               } cq;
95               struct {
96                       struct ibv_srq          *in;
97                       struct mlx5dv_srq       *out;
98               } srq;
99               struct {
100                       struct ibv_wq           *in;
101                       struct mlx5dv_rwq       *out;
102               } rwq;
103               struct {
104                       struct ibv_dm       *in;
105                       struct mlx5dv_dm    *out;
106               } dm;
107               struct {
108                       struct ibv_ah       *in;
109                       struct mlx5dv_ah    *out;
110               } ah;
111               struct {
112                       struct ibv_pd           *in;
113                       struct mlx5dv_pd        *out;
114               } pd;
115       };
116
117       enum mlx5dv_obj_type {
118               MLX5DV_OBJ_QP   = 1 << 0,
119               MLX5DV_OBJ_CQ   = 1 << 1,
120               MLX5DV_OBJ_SRQ  = 1 << 2,
121               MLX5DV_OBJ_RWQ  = 1 << 3,
122               MLX5DV_OBJ_DM   = 1 << 4,
123               MLX5DV_OBJ_AH   = 1 << 5,
124               MLX5DV_OBJ_PD   = 1 << 6,
125       };
126

RETURN VALUE

128       0 on success or the value of errno  on  failure  (which  indicates  the
129       failure reason).
130

NOTES

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

SEE ALSO

137       mlx5dv(7)
138

AUTHORS

140       Leon Romanovsky <leonro@mellanox.com>
141
142
143
1441.0.0                             2017-02-02                MLX5DV_INIT_OBJ(3)
Impressum