-
Notifications
You must be signed in to change notification settings - Fork 29
/
psm2_hal_inline_t.h
313 lines (299 loc) · 13.9 KB
/
psm2_hal_inline_t.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
/*
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
GPL LICENSE SUMMARY
Copyright(c) 2017 Intel Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Contact Information:
Intel Corporation, www.intel.com
BSD LICENSE
Copyright(c) 2017 Intel Corporation.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* The psm2_hal_inline_t.h file serves as a template to allow all HAL
instances to easily and conveniently declare their HAL methods. */
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(initialize)
(psmi_hal_instance_t *);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(finalize_)
(void);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_num_units)
(void);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_num_ports)
(void);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_unit_active)
(int unit);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_node_id)
(int unit, int *nodep);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_port_active)
(int unit, int port);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_num_contexts)
(int unit);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_num_free_contexts)
(int unit);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(close_context)
(psmi_hal_hw_context *);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(context_open)
(int unit,
int port,
uint64_t open_timeout,
psm2_ep_t ep,
psm2_uuid_t const job_key,
psmi_context_t *psm_ctxt,
uint32_t cap_mask,
unsigned);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_port_index2pkey)
(int unit, int port, int index);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_cc_settings_bin)
(int unit, int port, char *ccabuf, size_t len_ccabuf);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_cc_table_bin)
(int unit, int port, uint16_t **ccatp);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_port_lmc)
(int unit, int port);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_port_rate)
(int unit, int port);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_port_sl2sc)
(int unit, int port, int sl);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_sc2vl_map)
(struct ips_proto *proto);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(set_pkey)
(psmi_hal_hw_context, uint16_t);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(poll_type)
(uint16_t, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_port_lid)
(int unit, int port);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_port_gid)
(int unit, int port,
uint64_t *hi, uint64_t *lo);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(free_tid)
(psmi_hal_hw_context, uint64_t tidlist, uint32_t tidcnt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_tidcache_invalidation)
(psmi_hal_hw_context, uint64_t tidlist, uint32_t *tidcnt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(update_tid)
(psmi_hal_hw_context, uint64_t vaddr, uint32_t *length,
uint64_t tidlist, uint32_t *tidcnt,
uint16_t flags);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(writev)
(const struct iovec *iov, int iovcnt, struct ips_epinfo *,
psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_sdma_ring_slot_status)
(int slotIdx, psmi_hal_sdma_ring_slot_status *,
uint32_t *errorCode,void *);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(dma_slot_available)
(int slotidx, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_hfi_event_bits)
(uint64_t *event_bits, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(ack_hfi_event)
(uint64_t ack_bits, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(hfi_reset_context)
(psmi_hal_hw_context);
static PSMI_HAL_INLINE uint64_t PSMI_HAL_CAT_INL_SYM(get_hw_status)
(psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_hw_status_freezemsg)
(volatile char** msg, psmi_hal_hw_context);
static PSMI_HAL_INLINE uint16_t PSMI_HAL_CAT_INL_SYM(get_user_major_bldtime_version)
(void);
static PSMI_HAL_INLINE uint16_t PSMI_HAL_CAT_INL_SYM(get_user_minor_bldtime_version)
(void);
static PSMI_HAL_INLINE uint16_t PSMI_HAL_CAT_INL_SYM(get_user_major_runtime_version)
(psmi_hal_hw_context);
static PSMI_HAL_INLINE uint16_t PSMI_HAL_CAT_INL_SYM(get_user_minor_runtime_version)
(psmi_hal_hw_context);
static PSMI_HAL_INLINE psmi_hal_cl_idx PSMI_HAL_CAT_INL_SYM(get_cl_q_head_index)
(psmi_hal_cl_q,
psmi_hal_hw_context);
static PSMI_HAL_INLINE psmi_hal_cl_idx PSMI_HAL_CAT_INL_SYM(get_cl_q_tail_index)
(psmi_hal_cl_q,
psmi_hal_hw_context);
static PSMI_HAL_INLINE void PSMI_HAL_CAT_INL_SYM(set_cl_q_head_index)
(psmi_hal_cl_idx,
psmi_hal_cl_q,
psmi_hal_hw_context);
static PSMI_HAL_INLINE void PSMI_HAL_CAT_INL_SYM(set_cl_q_tail_index)
(psmi_hal_cl_idx,
psmi_hal_cl_q,
psmi_hal_hw_context);
static inline int PSMI_HAL_CAT_INL_SYM(cl_q_empty)
(psmi_hal_cl_idx,
psmi_hal_cl_q,
psmi_hal_hw_context);
static inline int PSMI_HAL_CAT_INL_SYM(get_rhf)
(psmi_hal_cl_idx, psmi_hal_raw_rhf_t *,
psmi_hal_cl_q, psmi_hal_hw_context);
static inline int PSMI_HAL_CAT_INL_SYM(get_ips_message_hdr)
(psmi_hal_cl_idx, psmi_hal_raw_rhf_t, struct ips_message_header **,
psmi_hal_cl_q, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_receive_event)
(psmi_hal_cl_idx head_idx, psmi_hal_hw_context,
struct ips_recvhdrq_event *);
static PSMI_HAL_INLINE void *PSMI_HAL_CAT_INL_SYM(get_egr_buff)
(psmi_hal_cl_idx, psmi_hal_cl_q, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(retire_hdr_q_entry)
(psmi_hal_cl_idx *, psmi_hal_cl_q, psmi_hal_hw_context,
uint32_t elemsz, uint32_t elemlast,
int *emptyp);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_rhf_expected_sequence_number)
(unsigned int *, psmi_hal_cl_q, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(set_rhf_expected_sequence_number)
(unsigned int, psmi_hal_cl_q, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(check_rhf_sequence_number)
(unsigned int);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(set_pbc)
(struct ips_proto *proto, struct ips_flow *flow,
uint32_t isCtrlMsg, struct psm_hal_pbc *dest, uint32_t hdrlen,
uint32_t paylen);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_set_entry)
(uint32_t flowid, uint32_t genval, uint32_t seqnum,
psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_reset)
(psmi_hal_hw_context, uint32_t flowid, uint32_t genval,
uint32_t seqnum);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get)
(uint32_t flowid, uint64_t *ptf, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get_hw)
(uint32_t flowid, uint64_t *ptf, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get_seqnum)
(uint64_t val, uint32_t *pseqn);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get_genval)
(uint64_t val, uint32_t *pgv);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_check_update_pkt_seq)
(void *vpprotoexp
/* actually a:
struct ips_protoexp *protoexp */,
psmi_seqnum_t sequence_num,
void *vptidrecvc
/* actually a:
struct ips_tid_recv_desc *tidrecvc */,
struct ips_message_header *p_hdr,
void (*ips_protoexp_do_tf_generr)
(void *vpprotoexp
/* actually a:
struct ips_protoexp *protoexp */,
void *vptidrecvc
/* actually a:
struct ips_tid_recv_desc *tidrecvc */,
struct ips_message_header *p_hdr),
void (*ips_protoexp_do_tf_seqerr)
(void *vpprotoexp
/* actually a:
struct ips_protoexp *protoexp */,
void *vptidrecvc
/* actually a:
struct ips_tid_recv_desc *tidrecvc */,
struct ips_message_header *p_hdr));
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get_flowvalid)
(uint64_t val, uint32_t *pfv);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get_enabled)
(uint64_t val, uint32_t *penabled);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get_keep_after_seqerr)
(uint64_t val, uint32_t *pkase);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get_keep_on_generr)
(uint64_t val, uint32_t *pkoge);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get_keep_payload_on_generr)
(uint64_t val, uint32_t *pkpoge);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get_seqmismatch)
(uint64_t val, uint32_t *psmm);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(tidflow_get_genmismatch)
(uint64_t val, uint32_t *pgmm);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(forward_packet_to_subcontext)
(struct ips_writehdrq *writeq,
struct ips_recvhdrq_event *rcv_ev,
uint32_t subcontext,
psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(subcontext_ureg_get)
(ptl_t *ptl,
struct ips_subcontext_ureg **uregp,
psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(set_pio_size)
(uint32_t, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(set_effective_mtu)
(uint32_t, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(set_tf_valid)
(uint32_t, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_default_pkey)
(void);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(spio_init)
(const psmi_context_t *context,
struct ptl *ptl, void **ctrl);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(spio_fini)
(void **ctrl, psmi_hal_hw_context);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(spio_transfer_frame)
(struct ips_proto *proto,
struct ips_flow *flow, struct psm_hal_pbc *pbc,
uint32_t *payload, uint32_t length,
uint32_t isCtrlMsg, uint32_t cksum_valid,
uint32_t cksum, psmi_hal_hw_context
#ifdef PSM_CUDA
, uint32_t is_cuda_payload
#endif
);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(spio_process_events)
(const struct ptl *ptl);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_bthqp)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_context)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE uint64_t PSMI_HAL_CAT_INL_SYM(get_gid_lo)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE uint64_t PSMI_HAL_CAT_INL_SYM(get_gid_hi)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_hfi_type)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_jkey)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_lid)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_pio_size)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_port_num)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_rx_egr_tid_cnt)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_rx_hdr_q_cnt)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_rx_hdr_q_ent_size)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_sdma_req_size)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_sdma_ring_size)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_subctxt)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_subctxt_cnt)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_tid_exp_cnt)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_unit_id)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_fd)
(psmi_hal_hw_context ctxt);
static PSMI_HAL_INLINE int PSMI_HAL_CAT_INL_SYM(get_pio_stall_cnt)
(psmi_hal_hw_context,
uint64_t **);