Debian Codegraph @

prov/mrail/src/mrail_rma.c

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 /*
2 * Copyright (c) 2018-2019 Intel Corporation, Inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33 #include "mrail.h"cxx . . $ `<file>/prov/mrail/src/mrail.h`/
34
35 static void mrail_subreq_to_railcxx . . $ mrail_subreq_to_rail(757204bb84ab830f).(struct mrail_subreqcxx . . $ mrail_subreq# *subreq, uint32_tcxx . . $ uint32_t# rail,
36 struct ioveccxx . . $ iovec# *out_iovs, void **out_descs,
37 struct fi_rma_iovcxx . . $ fi_rma_iov# *out_rma_iovs)
38 {
39 const struct mrail_mrcxx . . $ mrail_mr# *mrail_mr;
40 struct mrail_addr_keycxx . . $ mrail_addr_key# *mr_map;
41 size_t i;
42
43 for (i = 0; i < subreq->iov_countcxx . . $ mrail_subreq#iov_count.; ++i) {
44 mrail_mr = subreq->descscxx . . $ mrail_subreq#descs.[i];
45 //TODO: add base address from mrail_mr
46 out_iovs[i].iov_lencxx . . $ iovec#iov_len. = subreq->iovcxx . . $ mrail_subreq#iov.[i].iov_lencxx . . $ iovec#iov_len.;
47 out_iovs[i].iov_basecxx . . $ iovec#iov_base. =
48 (void*)((uintptr_tcxx . . $ uintptr_t#)subreq->iovcxx . . $ mrail_subreq#iov.[i].iov_basecxx . . $ iovec#iov_base.);
49
50 out_descs[i] = (mrail_mr ?
51 fi_mr_desccxx . . $ fi_mr_desc(69b384c372d95d57).(mrail_mr->railscxx . . $ mrail_mr#rails.[rail].mrcxx . . $ mrail_mr#$anonymous_type_4#mr.) : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
52 }
53
54 for (i = 0; i < subreq->rma_iov_countcxx . . $ mrail_subreq#rma_iov_count.; ++i) {
•55 mr_map = (struct mrail_addr_keycxx . . $ mrail_addr_key# *)(uintptr_tcxx . . $ uintptr_t#)subreq->rma_iovcxx . . $ mrail_subreq#rma_iov.[i].keycxx . . $ fi_rma_iov#key.;
56 //TODO: add base address from mrail_addr_key
57 out_rma_iovs[i].addrcxx . . $ fi_rma_iov#addr. = subreq->rma_iovcxx . . $ mrail_subreq#rma_iov.[i].addrcxx . . $ fi_rma_iov#addr.;
58 out_rma_iovs[i].lencxx . . $ fi_rma_iov#len. = subreq->rma_iovcxx . . $ mrail_subreq#rma_iov.[i].lencxx . . $ fi_rma_iov#len.;
59 out_rma_iovs[i].keycxx . . $ fi_rma_iov#key. = mr_map[rail].keycxx . . $ mrail_addr_key#key.;
60 }
61 }
62
63 static ssize_tcxx . . $ ssize_t# mrail_post_subreqcxx . . $ mrail_post_subreq(ecb1eaa66eba1978).(uint32_tcxx . . $ uint32_t# rail,
64 struct mrail_subreqcxx . . $ mrail_subreq# *subreq)
65 {
66 ssize_tcxx . . $ ssize_t# ret;
67 struct ioveccxx . . $ iovec# rail_iov[MRAIL_IOV_LIMITcxx . . $ `prov/mrail/src/mrail.h:151:9`!];
68 void *rail_descs[MRAIL_IOV_LIMITcxx . . $ `prov/mrail/src/mrail.h:151:9`!];
69 struct fi_rma_iovcxx . . $ fi_rma_iov# rail_rma_iov[MRAIL_IOV_LIMITcxx . . $ `prov/mrail/src/mrail.h:151:9`!];
70 struct fi_msg_rmacxx . . $ fi_msg_rma# msg;
71
72 struct mrail_reqcxx . . $ mrail_req# *req = subreq->parentcxx . . $ mrail_subreq#parent.;
73 struct mrail_epcxx . . $ mrail_ep# *mrail_ep = req->mrail_epcxx . . $ mrail_req#mrail_ep.;
74
75 uint64_tcxx . . $ uint64_t# flags = req->flagscxx . . $ mrail_req#flags.;
76
77 mrail_subreq_to_railcxx . . $ mrail_subreq_to_rail(757204bb84ab830f).(subreq, rail, rail_iov, rail_descs, rail_rma_iov);
78
79 msg.msg_iovcxx . . $ fi_msg_rma#msg_iov. = rail_iov;
80 msg.desccxx . . $ fi_msg_rma#desc. = rail_descs;
81 msg.iov_countcxx . . $ fi_msg_rma#iov_count. = subreq->iov_countcxx . . $ mrail_subreq#iov_count.;
82 msg.addrcxx . . $ fi_msg_rma#addr. = req->peer_infocxx . . $ mrail_req#peer_info.->addrcxx . . $ mrail_peer_info#addr.;
83 msg.rma_iovcxx . . $ fi_msg_rma#rma_iov. = rail_rma_iov;
84 msg.rma_iov_countcxx . . $ fi_msg_rma#rma_iov_count. = subreq->rma_iov_countcxx . . $ mrail_subreq#rma_iov_count.;
85 msg.contextcxx . . $ fi_msg_rma#context. = &subreq->contextcxx . . $ mrail_subreq#context.;
86
87 if (req->op_typecxx . . $ mrail_req#op_type. == FI_READcxx . . $ `include/rdma/fabric.h:133:9`!) {
88 ret = fi_readmsgcxx . . $ fi_readmsg(f7ea92bc96ca1c66).(mrail_ep->railscxx . . $ mrail_ep#rails.[rail].epcxx . . $ mrail_ep#$anonymous_type_3#ep., &msg, flags);
89 } else {
90 /* Immediate data is sent with the last subreq only */
91 if (flags & FI_REMOTE_CQ_DATAcxx . . $ `include/rdma/fabric.h:142:9`!) {
92 if (req->pending_subreqcxx . . $ mrail_req#pending_subreq. > 0) {
93 flags &= ~FI_REMOTE_CQ_DATAcxx . . $ `include/rdma/fabric.h:142:9`!;
94 } else {
95 msg.datacxx . . $ fi_msg_rma#data. = req->datacxx . . $ mrail_req#data.;
96 }
97 }
98 ret = fi_writemsgcxx . . $ fi_writemsg(f7ea92bc96ca1c66).(mrail_ep->railscxx . . $ mrail_ep#rails.[rail].epcxx . . $ mrail_ep#$anonymous_type_3#ep., &msg, flags);
99 }
100
101 return ret;
102 }
103
104 static ssize_tcxx . . $ ssize_t# mrail_post_reqcxx . . $ mrail_post_req(7c6a79d1768402ba).(struct mrail_reqcxx . . $ mrail_req# *req)
105 {
106 size_t i;
107 uint32_tcxx . . $ uint32_t# rail;
108 ssize_tcxx . . $ ssize_t# ret = 0;
109
110 while (req->pending_subreqcxx . . $ mrail_req#pending_subreq. >= 0) {
111 /* Try all rails before giving up */
112 for (i = 0; i < req->mrail_epcxx . . $ mrail_req#mrail_ep.->num_epscxx . . $ mrail_ep#num_eps.; ++i) {
113 rail = mrail_get_tx_rail_rrcxx . . $ mrail_get_tx_rail_rr(7298456579c75cc4).(req->mrail_epcxx . . $ mrail_req#mrail_ep.);
114
115 ret = mrail_post_subreqcxx . . $ mrail_post_subreq(ecb1eaa66eba1978).(rail,
116 &req->subreqscxx . . $ mrail_req#subreqs.[req->pending_subreqcxx . . $ mrail_req#pending_subreq.]);
117 if (ret != -FI_EAGAINcxx . . $ `include/rdma/fi_errno.h:57:9`!) {
118 break;
119 } else {
120 /* One of the rails is busy. Try progressing. */
121 mrail_poll_cqcxx . . $ mrail_poll_cq(aab7059dbf44f958).(req->mrail_epcxx . . $ mrail_req#mrail_ep.->util_epcxx . . $ mrail_ep#util_ep..tx_cqcxx . . $ util_ep#tx_cq.);
122 }
123 }
124
125 if (ret != 0) {
126 if (ret == -FI_EAGAINcxx . . $ `include/rdma/fi_errno.h:57:9`!) {
127 break;
128 }
129 /* TODO: Handle errors besides FI_EAGAIN */
130 assertcxx . . $ `/usr/include/assert.h:50:10`!(0);
131 }
132 req->pending_subreqcxx . . $ mrail_req#pending_subreq.--;
133 }
134
135 return ret;
136 }
137
138 static inline
139 struct mrail_reqcxx . . $ mrail_req# *mrail_dequeue_deferred_reqcxx . . $ mrail_dequeue_deferred_req(e037b61ba4cb98d5).(struct mrail_epcxx . . $ mrail_ep# *mrail_ep)
140 {
141 struct mrail_reqcxx . . $ mrail_req# *req;
142
143 ofi_genlock_lockcxx . . $ ofi_genlock_lock(6abe1cc6714d5eec).(&mrail_ep->util_epcxx . . $ mrail_ep#util_ep..lockcxx . . $ util_ep#lock.);
144 slist_remove_head_containercxx . . $ `include/ofi_list.h:452:9`!(&mrail_ep->deferred_reqs, struct mrail_req,
145 req, entry);
146 ofi_genlock_unlockcxx . . $ ofi_genlock_unlock(6abe1cc6714d5eec).(&mrail_ep->util_epcxx . . $ mrail_ep#util_ep..lockcxx . . $ util_ep#lock.);
147
148 return req;
149 }
150
151 static inline void mrail_requeue_deferred_reqcxx . . $ mrail_requeue_deferred_req(b73dfdc06107e04c).(struct mrail_epcxx . . $ mrail_ep# *mrail_ep,
152 struct mrail_reqcxx . . $ mrail_req# *req)
153 {
154 ofi_genlock_lockcxx . . $ ofi_genlock_lock(6abe1cc6714d5eec).(&mrail_ep->util_epcxx . . $ mrail_ep#util_ep..lockcxx . . $ util_ep#lock.);
155 slist_insert_headcxx . . $ slist_insert_head(b507132a4e10f92f).(&req->entrycxx . . $ mrail_req#entry., &mrail_ep->deferred_reqscxx . . $ mrail_ep#deferred_reqs.);
156 ofi_genlock_unlockcxx . . $ ofi_genlock_unlock(6abe1cc6714d5eec).(&mrail_ep->util_epcxx . . $ mrail_ep#util_ep..lockcxx . . $ util_ep#lock.);
157 }
158
159 static inline void mrail_queue_deferred_reqcxx . . $ mrail_queue_deferred_req(b73dfdc06107e04c).(struct mrail_epcxx . . $ mrail_ep# *mrail_ep,
160 struct mrail_reqcxx . . $ mrail_req# *req)
161 {
162 ofi_genlock_lockcxx . . $ ofi_genlock_lock(6abe1cc6714d5eec).(&mrail_ep->util_epcxx . . $ mrail_ep#util_ep..lockcxx . . $ util_ep#lock.);
163 slist_insert_tailcxx . . $ slist_insert_tail(b507132a4e10f92f).(&req->entrycxx . . $ mrail_req#entry., &mrail_ep->deferred_reqscxx . . $ mrail_ep#deferred_reqs.);
164 ofi_genlock_unlockcxx . . $ ofi_genlock_unlock(6abe1cc6714d5eec).(&mrail_ep->util_epcxx . . $ mrail_ep#util_ep..lockcxx . . $ util_ep#lock.);
165 }
166
167 void mrail_progress_deferred_reqscxx . . $ mrail_progress_deferred_reqs(aef930c54b7b554e).(struct mrail_epcxx . . $ mrail_ep# *mrail_ep)
168 {
169 struct mrail_reqcxx . . $ mrail_req# *req;
170 ssize_tcxx . . $ ssize_t# ret;
171
172 req = mrail_dequeue_deferred_reqcxx . . $ mrail_dequeue_deferred_req(e037b61ba4cb98d5).(mrail_ep);
173 while (req) {
174 ret = mrail_post_reqcxx . . $ mrail_post_req(7c6a79d1768402ba).(req);
175 if (ret) {
176 mrail_requeue_deferred_reqcxx . . $ mrail_requeue_deferred_req(b73dfdc06107e04c).(mrail_ep, req);
177 break;
178 }
179 req = mrail_dequeue_deferred_reqcxx . . $ mrail_dequeue_deferred_req(e037b61ba4cb98d5).(mrail_ep);
180 }
181 }
182
183 static ssize_tcxx . . $ ssize_t# mrail_prepare_rma_subreqscxx . . $ mrail_prepare_rma_subreqs(534a13dec2eada3d).(struct mrail_epcxx . . $ mrail_ep# *mrail_ep,
184 const struct fi_msg_rmacxx . . $ fi_msg_rma# *msg, struct mrail_reqcxx . . $ mrail_req# *req)
185 {
186 ssize_tcxx . . $ ssize_t# ret;
187 struct mrail_subreqcxx . . $ mrail_subreq# *subreq;
188 size_t subreq_count;
189 size_t total_len;
190 size_t chunk_len;
191 size_t subreq_len;
192 size_t iov_index;
193 size_t iov_offset;
194 size_t rma_iov_index;
195 size_t rma_iov_offset;
196 int i;
197
198 /* For now, stripe across all rails.
199 * This could be determined by a dynamic scheduler instead.
200 */
201 subreq_count = mrail_ep->num_epscxx . . $ mrail_ep#num_eps.;
202
203 total_len = ofi_total_iov_lencxx . . $ ofi_total_iov_len(e3dc932e040c1406).(msg->msg_iovcxx . . $ fi_msg_rma#msg_iov., msg->iov_countcxx . . $ fi_msg_rma#iov_count.);
204 chunk_len = total_len / subreq_count;
205
206 /* The first chunk is the longest */
207 subreq_len = chunk_len + (total_len % subreq_count);
208 iov_index = 0;
209 iov_offset = 0;
210 rma_iov_index = 0;
211 rma_iov_offset = 0;
212
213 /* The array is filled in reverse order -- i.e. first subreq at
214 * last position in the array. Filling the array in this order saves
215 * us from having to use two variables, to track the total number of
216 * subreqs, and to know which one to try posting next.
217 * Instead, a single variable (req->pending_subreq) is used to keep
218 * track of which subreq to post next, starting at the end of the
219 * array.
220 */
221 for (i = (subreq_count - 1); i >= 0; --i) {
222 subreq = &req->subreqscxx . . $ mrail_req#subreqs.[i];
223
224 subreq->parentcxx . . $ mrail_subreq#parent. = req;
225
226 ret = ofi_copy_iov_desccxx . . $ ofi_copy_iov_desc(29db80ee8e66996).(subreq->iovcxx . . $ mrail_subreq#iov., subreq->descscxx . . $ mrail_subreq#descs.,
227 &subreq->iov_countcxx . . $ mrail_subreq#iov_count.,
228 (struct ioveccxx . . $ iovec# *)msg->msg_iovcxx . . $ fi_msg_rma#msg_iov., msg->desccxx . . $ fi_msg_rma#desc.,
229 msg->iov_countcxx . . $ fi_msg_rma#iov_count., &iov_index, &iov_offset,
230 subreq_len);
231 if (ret) {
232 goto out;
233 }
234
235 ret = ofi_copy_rma_iovcxx . . $ ofi_copy_rma_iov(9b8e3ff8a67e7cdc).(subreq->rma_iovcxx . . $ mrail_subreq#rma_iov., &subreq->rma_iov_countcxx . . $ mrail_subreq#rma_iov_count.,
236 (struct fi_rma_iovcxx . . $ fi_rma_iov# *)msg->rma_iovcxx . . $ fi_msg_rma#rma_iov.,
237 msg->rma_iov_countcxx . . $ fi_msg_rma#rma_iov_count., &rma_iov_index,
238 &rma_iov_offset, subreq_len);
239 if (ret) {
240 goto out;
241 }
242
243 /* All the other chunks have the same length */
244 subreq_len = chunk_len;
245 }
246
247 ofi_atomic_initialize32cxx . . $ ofi_atomic_initialize32(98c39d18b449ed43).(&req->expected_subcompscxx . . $ mrail_req#expected_subcomps., subreq_count);
248
249 /* pending_subreq is the index of the next subreq to post.
250 * The array was filled in reverse order in mrail_prepare_rma_subreqs()
251 */
252 req->pending_subreqcxx . . $ mrail_req#pending_subreq. = subreq_count - 1;
253
254 out:
255 return ret;
256 }
257
258 static ssize_tcxx . . $ ssize_t# mrail_init_rma_reqcxx . . $ mrail_init_rma_req(e9f6be10c158bfcf).(struct mrail_epcxx . . $ mrail_ep# *mrail_ep,
259 struct mrail_reqcxx . . $ mrail_req# *req, const struct fi_msg_rmacxx . . $ fi_msg_rma# *msg,
260 uint64_tcxx . . $ uint64_t# flags, int op_type)
261 {
262 ssize_tcxx . . $ ssize_t# ret;
263
264 req->op_typecxx . . $ mrail_req#op_type. = op_type;
265 req->flagscxx . . $ mrail_req#flags. = flags;
266 req->datacxx . . $ mrail_req#data. = msg->datacxx . . $ fi_msg_rma#data.;
267 req->mrail_epcxx . . $ mrail_req#mrail_ep. = mrail_ep;
268 req->peer_infocxx . . $ mrail_req#peer_info. = ofi_av_get_addrcxx . . $ ofi_av_get_addr(bced605723be6e97).(mrail_ep->util_epcxx . . $ mrail_ep#util_ep..avcxx . . $ util_ep#av.,
269 (int) msg->addrcxx . . $ fi_msg_rma#addr.);
270 req->compcxx . . $ mrail_req#comp..op_contextcxx . . $ fi_cq_tagged_entry#op_context. = msg->contextcxx . . $ fi_msg_rma#context.;
271 req->compcxx . . $ mrail_req#comp..flagscxx . . $ fi_cq_tagged_entry#flags. = flags;
272
273 ret = mrail_prepare_rma_subreqscxx . . $ mrail_prepare_rma_subreqs(534a13dec2eada3d).(mrail_ep, msg, req);
274 if (ret) {
275 FI_WARNcxx . . $ `include/rdma/providers/fi_log.h:94:9`!(&mrail_prov, FI_LOG_EP_DATA,
276 "Unable to prepare rma subreqs: %s\n",
277 fi_strerror(-ret));
278 }
279 return ret;
280 }
281
282 static ssize_tcxx . . $ ssize_t# mrail_ep_post_rmacxx . . $ mrail_ep_post_rma(43b0eb27ba6907f5).(struct fid_epcxx . . $ fid_ep# *ep_fid,
283 const struct fi_msg_rmacxx . . $ fi_msg_rma# *msg, uint64_tcxx . . $ uint64_t# flags, int op_type)
284 {
285 ssize_tcxx . . $ ssize_t# ret;
286 struct mrail_epcxx . . $ mrail_ep# *mrail_ep;
287 struct mrail_reqcxx . . $ mrail_req# *req;
288
289 mrail_ep = container_ofcxx . . $ `include/ofi.h:195:9`!(ep_fid, struct mrail_ep, util_ep.ep_fid.fid);
290
291 req = mrail_alloc_reqcxx . . $ mrail_alloc_req(e037b61ba4cb98d5).(mrail_ep);
292 if (!req) {
293 return -FI_ENOMEMcxx . . $ `include/rdma/fi_errno.h:58:9`!;
294 }
295
296 ret = mrail_init_rma_reqcxx . . $ mrail_init_rma_req(e9f6be10c158bfcf).(mrail_ep, req, msg, flags, op_type);
297 if (ret) {
298 mrail_free_reqcxx . . $ mrail_free_req(b73dfdc06107e04c).(mrail_ep, req);
299 return ret;
300 }
301
302 mrail_queue_deferred_reqcxx . . $ mrail_queue_deferred_req(b73dfdc06107e04c).(mrail_ep, req);
303
304 /* Initiate progress here. See mrail_ep_progress() for any remaining
305 * reqs.
306 */
307 mrail_progress_deferred_reqscxx . . $ mrail_progress_deferred_reqs(aef930c54b7b554e).(mrail_ep);
308
309 return 0;
310 }
311
312 static ssize_tcxx . . $ ssize_t# mrail_ep_readmsgcxx . . $ mrail_ep_readmsg(f7ea92bc96ca1c66).(struct fid_epcxx . . $ fid_ep# *ep_fid,
313 const struct fi_msg_rmacxx . . $ fi_msg_rma# *msg, uint64_tcxx . . $ uint64_t# flags)
314 {
315 return mrail_ep_post_rmacxx . . $ mrail_ep_post_rma(43b0eb27ba6907f5).(ep_fid, msg, flags, FI_READcxx . . $ `include/rdma/fabric.h:133:9`!);
316 }
317
318 /* TODO: separate the different operations to optimize performance */
319 static ssize_tcxx . . $ ssize_t# mrail_ep_readcxx . . $ mrail_ep_read(50d3b64f05344e2).(struct fid_epcxx . . $ fid_ep# *ep_fid, void *buf, size_t len,
320 void *desc, fi_addr_tcxx . . $ fi_addr_t# src_addr, uint64_tcxx . . $ uint64_t# addr,
321 uint64_tcxx . . $ uint64_t# key, void *context)
322 {
323 struct mrail_epcxx . . $ mrail_ep# *mrail_ep;
324 struct ioveccxx . . $ iovec# iovec = {
325 .iov_base = (void*)buf,
326 .iov_len = len
327 };
328 struct fi_rma_iovcxx . . $ fi_rma_iov# rma_iov= {
329 .addr = addr,
330 .len = len,
331 .key = key
332 };
333 struct fi_msg_rmacxx . . $ fi_msg_rma# msg = {
334 .msg_iov = &iovec,
335 .desc = &desc,
336 .iov_count = 1,
337 .addr = src_addr,
338 .rma_iov = &rma_iov,
339 .rma_iov_count = 1,
340 .context = context,
341 .data = 0
342 };
343
344 mrail_ep = container_ofcxx . . $ `include/ofi.h:195:9`!(ep_fid, struct mrail_ep, util_ep.ep_fid.fid);
345
346 return mrail_ep_readmsgcxx . . $ mrail_ep_readmsg(f7ea92bc96ca1c66).(ep_fid, &msg, mrail_ep->util_epcxx . . $ mrail_ep#util_ep..tx_op_flagscxx . . $ util_ep#tx_op_flags.);
347 }
348
349 static ssize_tcxx . . $ ssize_t# mrail_ep_writemsgcxx . . $ mrail_ep_writemsg(f7ea92bc96ca1c66).(struct fid_epcxx . . $ fid_ep# *ep_fid,
350 const struct fi_msg_rmacxx . . $ fi_msg_rma# *msg, uint64_tcxx . . $ uint64_t# flags)
351 {
352 return mrail_ep_post_rmacxx . . $ mrail_ep_post_rma(43b0eb27ba6907f5).(ep_fid, msg, flags, FI_WRITEcxx . . $ `include/rdma/fabric.h:134:9`!);
353 }
354
355 static ssize_tcxx . . $ ssize_t# mrail_ep_writecxx . . $ mrail_ep_write(c7db23e7c00d82dc).(struct fid_epcxx . . $ fid_ep# *ep_fid, const void *buf,
356 size_t len, void *desc, fi_addr_tcxx . . $ fi_addr_t# dest_addr, uint64_tcxx . . $ uint64_t# addr,
357 uint64_tcxx . . $ uint64_t# key, void *context)
358 {
359 struct mrail_epcxx . . $ mrail_ep# *mrail_ep;
360 struct ioveccxx . . $ iovec# iovec = {
361 .iov_base = (void*)buf,
362 .iov_len = len
363 };
364 struct fi_rma_iovcxx . . $ fi_rma_iov# rma_iov= {
365 .addr = addr,
366 .len = len,
367 .key = key
368 };
369 struct fi_msg_rmacxx . . $ fi_msg_rma# msg = {
370 .msg_iov = &iovec,
371 .desc = &desc,
372 .iov_count = 1,
373 .addr = dest_addr,
374 .rma_iov = &rma_iov,
375 .rma_iov_count = 1,
376 .context = context,
377 .data = 0
378 };
379
380 mrail_ep = container_ofcxx . . $ `include/ofi.h:195:9`!(ep_fid, struct mrail_ep, util_ep.ep_fid.fid);
381
382 return mrail_ep_writemsgcxx . . $ mrail_ep_writemsg(f7ea92bc96ca1c66).(ep_fid, &msg, mrail_ep->util_epcxx . . $ mrail_ep#util_ep..tx_op_flagscxx . . $ util_ep#tx_op_flags.);
383 }
384
385 static ssize_tcxx . . $ ssize_t# mrail_ep_inject_writecxx . . $ mrail_ep_inject_write(300e768364ed812c).(struct fid_epcxx . . $ fid_ep# *ep_fid, const void *buf,
386 size_t len, fi_addr_tcxx . . $ fi_addr_t# dest_addr, uint64_tcxx . . $ uint64_t# addr, uint64_tcxx . . $ uint64_t# key)
387 {
388 struct mrail_epcxx . . $ mrail_ep# *mrail_ep;
389 struct mrail_addr_keycxx . . $ mrail_addr_key# *mr_map;
390 uint32_tcxx . . $ uint32_t# rail;
391 ssize_tcxx . . $ ssize_t# ret;
392
393 mrail_ep = container_ofcxx . . $ `include/ofi.h:195:9`!(ep_fid, struct mrail_ep, util_ep.ep_fid.fid);
•394 mr_map = (struct mrail_addr_keycxx . . $ mrail_addr_key# *)(uintptr_tcxx . . $ uintptr_t#) key;
395
396 rail = mrail_get_tx_rail_rrcxx . . $ mrail_get_tx_rail_rr(7298456579c75cc4).(mrail_ep);
397 ret = fi_inject_writecxx . . $ fi_inject_write(300e768364ed812c).(mrail_ep->railscxx . . $ mrail_ep#rails.[rail].epcxx . . $ mrail_ep#$anonymous_type_3#ep., buf, len,
398 dest_addr, addr, mr_map[rail].keycxx . . $ mrail_addr_key#key.);
399 if (ret) {
400 FI_WARNcxx . . $ `include/rdma/providers/fi_log.h:94:9`!(&mrail_prov, FI_LOG_EP_DATA,
401 "Unable to post inject write on rail: %" PRIu32cxx . . $ `<external>/15933738808807975373/inttypes.h:104:10`! "\n",
402 rail);
403 return ret;
404 }
405 ofi_ep_cntr_inccxx . . $ ofi_ep_cntr_inc(927edc926712a6e3).(&mrail_ep->util_epcxx . . $ mrail_ep#util_ep., CNTR_WRcxx . . $ CNTR_WR.);
406
407 return 0;
408 }
409
410 struct fi_ops_rmacxx . . $ fi_ops_rma# mrail_ops_rmacxx . . $ mrail_ops_rma. = {
411 .size = sizeof (struct fi_ops_rmacxx . . $ fi_ops_rma#),
412 .read = mrail_ep_readcxx . . $ mrail_ep_read(50d3b64f05344e2).,
413 .readv = fi_no_rma_readvcxx . . $ fi_no_rma_readv(6ea4fb12e720b7b0).,
414 .readmsg = mrail_ep_readmsgcxx . . $ mrail_ep_readmsg(f7ea92bc96ca1c66).,
415 .write = mrail_ep_writecxx . . $ mrail_ep_write(c7db23e7c00d82dc).,
416 .writev = fi_no_rma_writevcxx . . $ fi_no_rma_writev(6ea4fb12e720b7b0).,
417 .writemsg = mrail_ep_writemsgcxx . . $ mrail_ep_writemsg(f7ea92bc96ca1c66).,
418 .inject = mrail_ep_inject_writecxx . . $ mrail_ep_inject_write(300e768364ed812c).,
419 .writedata = fi_no_rma_writedatacxx . . $ fi_no_rma_writedata(a30b063ec663f5f).,
420 .injectdata = fi_no_rma_injectdatacxx . . $ fi_no_rma_injectdata(9d2dffa06b0fd31e).,
421 };