]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/ofed/libmlx5/mlx5dv_init_obj.3
MFV r361937:
[FreeBSD/FreeBSD.git] / contrib / ofed / libmlx5 / mlx5dv_init_obj.3
1 .\" -*- nroff -*-
2 .\" Licensed under the OpenIB.org (MIT) - See COPYING.md
3 .\"
4 .TH MLX5DV_INIT_OBJ 3 2017-02-02 1.0.0
5 .SH "NAME"
6 mlx5dv_init_obj \- Initialize mlx5 direct verbs object from ibv_xxx structures
7 .SH "SYNOPSIS"
8 .nf
9 .B #include <infiniband/mlx5dv.h>
10 .sp
11 .BI "int mlx5dv_init_obj(struct mlx5dv_obj *obj, uint64_t obj_type);
12 .fi
13 .SH "DESCRIPTION"
14 .B mlx5dv_init_obj()
15 This function will initialize mlx5dv_xxx structs based on supplied type. The information
16 for initialization is taken from ibv_xx structs supplied as part of input.
17
18 Request information of CQ marks its owned by direct verbs for all consumer index
19 related actions. The initialization type can be combination of several types together.
20 .PP
21 .nf
22 struct mlx5dv_qp {
23 .in +8
24 uint32_t                *dbrec;
25 struct {
26 .in +8
27 void            *buf;
28 uint32_t        wqe_cnt;
29 uint32_t        stride;
30 .in -8
31 } sq;
32 struct {
33 .in +8
34 void            *buf;
35 uint32_t        wqe_cnt;
36 uint32_t        stride;
37 .in -8
38 } rq;
39 struct {
40 .in +8
41 void            *reg;
42 uint32_t        size;
43 .in -8
44 } bf;
45 uint64_t                comp_mask;
46 .in -8
47 };
48
49 struct mlx5dv_cq {
50 .in +8
51 void                    *buf;
52 uint32_t                *dbrec;
53 uint32_t                cqe_cnt;
54 uint32_t                cqe_size;
55 void                    *uar;
56 uint32_t                cqn;
57 uint64_t                comp_mask;
58 .in -8
59 };
60
61 struct mlx5dv_srq {
62 .in +8
63 void                    *buf;
64 uint32_t                *dbrec;
65 uint32_t                stride;
66 uint32_t                head;
67 uint32_t                tail;
68 uint64_t                comp_mask;
69 .in -8
70 };
71
72 struct mlx5dv_rwq {
73 .in +8
74 void            *buf;
75 uint32_t        *dbrec;
76 uint32_t        wqe_cnt;
77 uint32_t        stride;
78 uint64_t        comp_mask;
79 .in -8
80 };
81
82 struct mlx5dv_obj {
83 .in +8
84 struct {
85 .in +8
86 struct ibv_qp           *in;
87 struct mlx5dv_qp        *out;
88 .in -8
89 } qp;
90 struct {
91 .in +8
92 struct ibv_cq           *in;
93 struct mlx5dv_cq        *out;
94 .in -8
95 } cq;
96 struct {
97 .in +8
98 struct ibv_srq          *in;
99 struct mlx5dv_srq       *out;
100 .in -8
101 } srq;
102 struct {
103 .in +8
104 struct ibv_wq           *in;
105 struct mlx5dv_rwq       *out;
106 .in -8
107 } rwq;
108 .in -8
109 };
110
111 enum mlx5dv_obj_type {
112 .in +8
113 MLX5DV_OBJ_QP   = 1 << 0,
114 MLX5DV_OBJ_CQ   = 1 << 1,
115 MLX5DV_OBJ_SRQ  = 1 << 2,
116 MLX5DV_OBJ_RWQ  = 1 << 3,
117 .in -8
118 };
119 .fi
120 .SH "RETURN VALUE"
121 0 on success or the value of errno on failure (which indicates the failure reason).
122 .SH "NOTES"
123  * The information if doorbell is blueflame is based on mlx5dv_qp->bf->size,
124 in case of 0 it's not a BF.
125  * Compatibility masks (comp_mask) are in/out fields.
126 .SH "SEE ALSO"
127 .BR mlx5dv (7)
128 .SH "AUTHORS"
129 .TP
130 Leon Romanovsky <leonro@mellanox.com>