diff --git a/include/maestro/i_ofi.h b/include/maestro/i_ofi.h index 70e055baab17245e7b841057c5aa3f86b8e98db8..adc48a6fad34d87d2687bfce76d7a6843684b281 100644 --- a/include/maestro/i_ofi.h +++ b/include/maestro/i_ofi.h @@ -134,6 +134,14 @@ mstro_status mstro_ofi__remember_ctx(struct mstro_endpoint *ep, mstro_ofi_msg_context ctx); +/** registers @arg buf with len for fi @arg access + * @arg mr and local_buf_mr_desc are the output memory registeration and local descriptor */ +mstro_status +mstro_ofi__mreg_attr(enum fi_hmem_iface iface, uint64_t device, + struct fi_domain_attr *domain_attr,struct fid_domain *domain, uint64_t access, + void* buf, size_t len, + struct fid_mr **mr, void **local_buf_mr_desc); + /** check if @arg mr_mode indicates that @arg mr needs to be bound to @arg ep and enabled before being usable. If so: do it * * FIXME: should not be external, but rdma transport code needs it currently diff --git a/maestro/ofi.c b/maestro/ofi.c index 6700d0a5b1f1ce48dc8bf85b900b9a10d5e67b94..7e9d130179517553bd32a3690708d4a67518bf93 100644 --- a/maestro/ofi.c +++ b/maestro/ofi.c @@ -884,11 +884,11 @@ mstro_mr_key_get(struct fi_info* fi, struct fid_mr* mr, } -static inline + mstro_status mstro_ofi__mreg_attr(enum fi_hmem_iface iface, uint64_t device, - struct fi_domain_attr *domain_attr, - struct fid_domain *domain, void* buf, size_t len, + struct fi_domain_attr *domain_attr,struct fid_domain *domain, uint64_t access, + void* buf, size_t len, struct fid_mr **mr, void **local_buf_mr_desc) { @@ -904,7 +904,7 @@ mstro_ofi__mreg_attr(enum fi_hmem_iface iface, uint64_t device, iov.iov_base = buf; mr_attr.mr_iov = &iov; mr_attr.iov_count = 1; - mr_attr.access = FI_READ; + mr_attr.access = access; mr_attr.offset = 0; mr_attr.requested_key = requested_key; mr_attr.context= NULL; @@ -1026,7 +1026,7 @@ mstro_ofi__maybe_register_as_read_target_buffer( status = MSTRO_OK; if(do_register) { - status = mstro_ofi__mreg_attr(iface, device, domain_attr,domain,buf,len,mr,local_buf_mr_desc); + status = mstro_ofi__mreg_attr(iface, device, domain_attr,domain,FI_READ,buf,len,mr,local_buf_mr_desc); } if(do_bind) {