4996
|
1 |
/*
|
|
2 |
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
3 |
*/
|
|
4 |
|
|
5 |
#ifndef _SYS_IB_ADAPTERS_MLNX_UMAP_H
|
|
6 |
#define _SYS_IB_ADAPTERS_MLNX_UMAP_H
|
|
7 |
|
|
8 |
#ifdef __cplusplus
|
|
9 |
extern "C" {
|
|
10 |
#endif
|
|
11 |
|
|
12 |
/*
|
|
13 |
* mlnx_umap.h
|
|
14 |
* Contains all of the definions necessary for communicating the data
|
|
15 |
* needed for direct userland access to resources on Mellanox HCAs.
|
|
16 |
*/
|
|
17 |
|
|
18 |
/*
|
|
19 |
* Note: The structs in this file are used in the interface(s)
|
|
20 |
* between kernel service drivers, e.g. daplt, and the libraries
|
|
21 |
* on top of them, e.g. udapl_tavor.so.1. When any of the
|
|
22 |
* structs in this file change, any version control between the
|
|
23 |
* kernel service driver and the library will need to change.
|
|
24 |
*
|
|
25 |
* There is a version control on the structs defined here. The library
|
|
26 |
* (consumer of structs from ibt_ci_data_out()) must verify a version
|
|
27 |
* field to correctly read the data provided by the kernel driver
|
|
28 |
* (tavor, arbel, and hermon).
|
|
29 |
*/
|
|
30 |
|
|
31 |
#define MLNX_UMAP_IF_VERSION 3
|
|
32 |
|
|
33 |
/*
|
|
34 |
* The following defines are used in the database type field for each database
|
|
35 |
* entry. They specify the type of object (UAR pages, PIDs, CQ, QP, and MR
|
|
36 |
* umemcookie) that corresponds to the database key value. On database queries,
|
|
37 |
* this type value must match the search criterion.
|
|
38 |
*/
|
|
39 |
#define MLNX_UMAP_UARPG_RSRC 0x11
|
|
40 |
#define MLNX_UMAP_BLUEFLAMEPG_RSRC 0x12
|
|
41 |
#define MLNX_UMAP_PID_RSRC 0x22
|
|
42 |
#define MLNX_UMAP_CQMEM_RSRC 0x33
|
|
43 |
#define MLNX_UMAP_QPMEM_RSRC 0x44
|
|
44 |
#define MLNX_UMAP_MRMEM_RSRC 0x55
|
|
45 |
#define MLNX_UMAP_SRQMEM_RSRC 0x66
|
|
46 |
#define MLNX_UMAP_DBRMEM_RSRC 0x77
|
|
47 |
#define MLNX_UMAP_MRMEM_MAHDL 0x88
|
|
48 |
#define MLNX_UMAP_RSRC_TYPE_MASK 0xFF
|
|
49 |
#define MLNX_UMAP_RSRC_TYPE_SHIFT 8
|
|
50 |
|
|
51 |
/* umap structures */
|
|
52 |
|
|
53 |
typedef struct mlnx_umap_cq_data_out_s {
|
|
54 |
uint32_t mcq_rev;
|
|
55 |
uint32_t mcq_cqnum;
|
|
56 |
uint64_t mcq_mapoffset;
|
|
57 |
uint64_t mcq_maplen;
|
|
58 |
uint32_t mcq_numcqe;
|
|
59 |
uint32_t mcq_cqesz;
|
|
60 |
|
|
61 |
/* Arbel/Hermon doorbell records */
|
|
62 |
uint64_t mcq_armdbr_mapoffset;
|
|
63 |
uint64_t mcq_armdbr_maplen;
|
|
64 |
uint64_t mcq_polldbr_mapoffset;
|
|
65 |
uint64_t mcq_polldbr_maplen;
|
|
66 |
uint32_t mcq_armdbr_offset;
|
|
67 |
uint32_t mcq_polldbr_offset;
|
|
68 |
} mlnx_umap_cq_data_out_t;
|
|
69 |
|
|
70 |
typedef struct mlnx_umap_qp_data_out_s {
|
|
71 |
uint32_t mqp_rev;
|
|
72 |
uint32_t mqp_qpnum;
|
|
73 |
uint64_t mqp_mapoffset;
|
|
74 |
uint64_t mqp_maplen;
|
|
75 |
|
|
76 |
uint32_t mqp_rq_off;
|
|
77 |
uint32_t mqp_rq_desc_addr;
|
|
78 |
uint32_t mqp_rq_numwqe;
|
|
79 |
uint32_t mqp_rq_wqesz;
|
|
80 |
|
|
81 |
uint32_t mqp_sq_off;
|
|
82 |
uint32_t mqp_sq_desc_addr;
|
|
83 |
uint32_t mqp_sq_numwqe;
|
|
84 |
uint32_t mqp_sq_wqesz;
|
|
85 |
|
|
86 |
/* Arbel/Hermon doorbell records */
|
|
87 |
uint64_t mqp_sdbr_mapoffset;
|
|
88 |
uint64_t mqp_sdbr_maplen;
|
|
89 |
uint64_t mqp_rdbr_mapoffset;
|
|
90 |
uint64_t mqp_rdbr_maplen;
|
|
91 |
uint32_t mqp_sdbr_offset;
|
|
92 |
uint32_t mqp_rdbr_offset;
|
|
93 |
|
|
94 |
/* Hermon send queue headroom, in units of wqes */
|
|
95 |
uint32_t mqp_sq_headroomwqes;
|
|
96 |
uint32_t mqp_reserved;
|
|
97 |
} mlnx_umap_qp_data_out_t;
|
|
98 |
|
|
99 |
typedef struct mlnx_umap_srq_data_out_s {
|
|
100 |
uint32_t msrq_rev;
|
|
101 |
uint32_t msrq_srqnum;
|
|
102 |
uint64_t msrq_mapoffset;
|
|
103 |
uint64_t msrq_maplen;
|
|
104 |
uint32_t msrq_desc_addr;
|
|
105 |
uint32_t msrq_numwqe;
|
|
106 |
uint32_t msrq_wqesz;
|
|
107 |
uint32_t msrq_pad1; /* reserved */
|
|
108 |
|
|
109 |
/* Arbel/Hermon doorbell records */
|
|
110 |
uint64_t msrq_rdbr_mapoffset;
|
|
111 |
uint64_t msrq_rdbr_maplen;
|
|
112 |
uint32_t msrq_rdbr_offset;
|
|
113 |
uint32_t msrq_reserved;
|
|
114 |
} mlnx_umap_srq_data_out_t;
|
|
115 |
|
|
116 |
typedef struct mlnx_umap_pd_data_out_s {
|
|
117 |
uint32_t mpd_pdnum;
|
|
118 |
uint32_t mpd_rev;
|
|
119 |
} mlnx_umap_pd_data_out_t;
|
|
120 |
|
|
121 |
/*
|
|
122 |
* The following structure is used currently to pass data back to
|
|
123 |
* libmlx4 on user allocation context.
|
|
124 |
*/
|
|
125 |
typedef struct mlnx_umap_ucontext_data_out_s {
|
|
126 |
uint32_t muc_qp_tab_size;
|
|
127 |
uint16_t muc_bf_reg_size;
|
|
128 |
uint16_t muc_bf_regs_per_page;
|
|
129 |
uint32_t muc_rev;
|
|
130 |
uint32_t muc_reserved;
|
|
131 |
} mlnx_umap_ucontext_data_out_t;
|
|
132 |
|
|
133 |
/*
|
|
134 |
* Information for ibt_ci_data_in() for memory regions.
|
|
135 |
*
|
|
136 |
* MLNX_UMAP_MMR_DATA_IN_IF_VERSION is the value used in the mmr_rev member.
|
|
137 |
* mmr_func is the callback handler. mmr_arg1 and mmr_arg2 are its arguments.
|
|
138 |
*/
|
|
139 |
#define MLNX_UMAP_MMR_DATA_IN_IF_VERSION 1
|
|
140 |
typedef struct mlnx_umap_mr_data_in_s {
|
|
141 |
uint32_t mmr_rev;
|
|
142 |
uint32_t mmr_reserved;
|
|
143 |
void (*mmr_func)(void *, void *);
|
|
144 |
void *mmr_arg1;
|
|
145 |
void *mmr_arg2;
|
|
146 |
} mlnx_umap_mr_data_in_t;
|
|
147 |
|
|
148 |
#ifdef __cplusplus
|
|
149 |
}
|
|
150 |
#endif
|
|
151 |
|
|
152 |
#endif /* _SYS_IB_ADAPTERS_MLNX_UMAP_H */
|