From 2c364ea54e4c8f8b86411411b70cf6d2b61c9412 Mon Sep 17 00:00:00 2001 From: Jianxin Xiong Date: Tue, 30 Jul 2024 16:34:46 -0700 Subject: [PATCH] core: Deprecate old MR modes FI_MR_BASIC / FI_MR_SCALABLE / FI_MR_UNSPEC / FI_LOCAL_MR have been deprecated since verison 1.5. However, no mechanism was in place to discourage their usage. Add compiler directives to generate warning messages if these defintions are used. Providers use internal version of these values to maintain application compatibility w/o generating warning messages. Signed-off-by: Jianxin Xiong --- include/ofi.h | 5 +++ include/ofi_mr.h | 6 +-- include/rdma/fabric.h | 12 +++--- man/fi_domain.3.md | 6 +-- man/fi_getinfo.3.md | 2 +- man/fi_mr.3.md | 2 +- man/fi_verbs.7.md | 2 +- prov/efa/src/efa_prov_info.c | 2 +- prov/mrail/src/mrail_attr.c | 2 +- prov/mrail/src/mrail_init.c | 2 +- prov/opx/configure.m4 | 6 +-- prov/opx/include/rdma/opx/fi_opx_domain.h | 2 +- prov/opx/src/fi_opx_domain.c | 2 +- prov/opx/src/fi_opx_init.c | 4 +- prov/opx/src/fi_opx_mr.c | 16 ++++---- prov/opx/src/opx_hmem_cache.c | 2 +- prov/psm2/src/psmx2.h | 2 +- prov/psm2/src/psmx2_attr.c | 6 +-- prov/psm2/src/psmx2_domain.c | 2 +- prov/psm2/src/psmx2_mr.c | 10 ++--- prov/psm3/src/psmx3.h | 2 +- prov/psm3/src/psmx3_attr.c | 6 +-- prov/psm3/src/psmx3_domain.c | 2 +- prov/psm3/src/psmx3_mr.c | 10 ++--- prov/rxd/src/rxd_attr.c | 2 +- prov/rxd/src/rxd_init.c | 10 ++--- prov/rxm/src/rxm.h | 4 +- prov/rxm/src/rxm_attr.c | 4 +- prov/rxm/src/rxm_init.c | 14 +++---- prov/shm/src/smr_attr.c | 2 +- prov/sm2/src/sm2_attr.c | 2 +- prov/sockets/src/sock_attr.c | 2 +- prov/sockets/src/sock_ep.c | 10 ++--- prov/tcp/src/xnet_attr.c | 4 +- prov/ucx/src/ucx_init.c | 2 +- prov/udp/src/udpx_attr.c | 2 +- prov/usnic/src/usdf_dgram.h | 2 +- prov/usnic/src/usdf_domain.c | 10 ++--- prov/usnic/src/usdf_ep_dgram.c | 2 +- prov/usnic/src/usdf_fabric.c | 2 +- prov/util/src/util_attr.c | 46 +++++++++++------------ prov/util/src/util_mr_map.c | 4 +- prov/verbs/src/verbs_info.c | 2 +- src/abi_1_0.c | 2 +- src/fi_tostr.c | 6 +-- util/info.c | 3 +- 46 files changed, 126 insertions(+), 124 deletions(-) diff --git a/include/ofi.h b/include/ofi.h index 7e1565b6c3a..674f3b13928 100644 --- a/include/ofi.h +++ b/include/ofi.h @@ -70,6 +70,11 @@ extern "C" { * These are used internally to avoid compiler warnings. */ +#define OFI_MR_UNSPEC 0 +#define OFI_MR_BASIC (1 << 0) +#define OFI_MR_SCALABLE (1 << 1) + +#define OFI_LOCAL_MR (1ULL << 55) #define OFI_REG_MR (1ULL << 59) static inline int diff --git a/include/ofi_mr.h b/include/ofi_mr.h index a357121beaf..a28e1c75225 100644 --- a/include/ofi_mr.h +++ b/include/ofi_mr.h @@ -79,11 +79,11 @@ static inline int ofi_mr_local(const struct fi_info *info) if (info->domain_attr->mr_mode & FI_MR_LOCAL) return 1; - if (info->domain_attr->mr_mode & ~(FI_MR_BASIC | FI_MR_SCALABLE)) + if (info->domain_attr->mr_mode & ~(OFI_MR_BASIC | OFI_MR_SCALABLE)) return 0; check_local_mr: - return (info->mode & FI_LOCAL_MR) ? 1 : 0; + return (info->mode & OFI_LOCAL_MR) ? 1 : 0; } #define OFI_MR_MODE_RMA_TARGET (FI_MR_RAW | FI_MR_VIRT_ADDR | \ @@ -101,7 +101,7 @@ static inline uint64_t ofi_mr_get_prov_mode(uint32_t version, (user_info->domain_attr && !(user_info->domain_attr->mr_mode & FI_MR_LOCAL))) { return (prov_info->domain_attr->mr_mode & FI_MR_LOCAL) ? - prov_info->mode | FI_LOCAL_MR : prov_info->mode; + prov_info->mode | OFI_LOCAL_MR : prov_info->mode; } else { return prov_info->mode; } diff --git a/include/rdma/fabric.h b/include/rdma/fabric.h index 65c0d1bd412..bbd73acabe0 100644 --- a/include/rdma/fabric.h +++ b/include/rdma/fabric.h @@ -228,12 +228,10 @@ enum fi_av_type { FI_AV_TABLE }; -/* Named enum for backwards compatibility */ -enum fi_mr_mode { - FI_MR_UNSPEC, - FI_MR_BASIC, /* (1 << 0) */ - FI_MR_SCALABLE, /* (1 << 1) */ -}; +#define FI_MR_UNSPEC _Pragma("GCC warning \"'FI_MR_UNSPEC' is deprecated\"") (0) +#define FI_MR_BASIC _Pragma("GCC warning \"'FI_MR_BASIC' is deprecated\"") (1 << 0) +#define FI_MR_SCALABLE _Pragma("GCC warning \"'FI_MR_SCALABLE' is deprecated\"") (1 << 1) + #define FI_MR_LOCAL (1 << 2) #define FI_MR_RAW (1 << 3) #define FI_MR_VIRT_ADDR (1 << 4) @@ -369,7 +367,7 @@ static inline uint8_t fi_tc_dscp_get(uint32_t tclass) #define FI_MSG_PREFIX (1ULL << 58) #define FI_ASYNC_IOV (1ULL << 57) #define FI_RX_CQ_DATA (1ULL << 56) -#define FI_LOCAL_MR (1ULL << 55) +#define FI_LOCAL_MR _Pragma("GCC warning \"'FI_LOCAL_MR' is deprecated\"") (1ULL << 55) /* #define FI_NOTIFY_FLAGS_ONLY (1ULL << 54) */ /* #define FI_RESTRICTED_COMP (1ULL << 53) */ #define FI_CONTEXT2 (1ULL << 52) diff --git a/man/fi_domain.3.md b/man/fi_domain.3.md index f761b54d3b4..ca95a7bc735 100644 --- a/man/fi_domain.3.md +++ b/man/fi_domain.3.md @@ -575,7 +575,7 @@ The following values may be specified. : Indicates that the memory regions associated with completion counters must be explicitly enabled after being bound to any counter. -*FI_MR_UNSPEC* +*FI_MR_UNSPEC* (deprecated) : Defined for compatibility -- library versions 1.4 and earlier. Setting mr_mode to 0 indicates that FI_MR_BASIC or FI_MR_SCALABLE are requested and supported. @@ -584,14 +584,14 @@ The following values may be specified. : Registered memory regions are referenced by peers using the virtual address of the registered memory region, rather than a 0-based offset. -*FI_MR_BASIC* +*FI_MR_BASIC* (deprecated) : Defined for compatibility -- library versions 1.4 and earlier. Only basic memory registration operations are requested or supported. This mode is equivalent to the FI_MR_VIRT_ADDR, FI_MR_ALLOCATED, and FI_MR_PROV_KEY flags being set in later library versions. This flag may not be used in conjunction with other mr_mode bits. -*FI_MR_SCALABLE* +*FI_MR_SCALABLE* (deprecated) : Defined for compatibility -- library versions 1.4 and earlier. Only scalable memory registration operations are requested or supported. Scalable registration uses offset based diff --git a/man/fi_getinfo.3.md b/man/fi_getinfo.3.md index 0d5857c22dd..347123415f1 100644 --- a/man/fi_getinfo.3.md +++ b/man/fi_getinfo.3.md @@ -526,7 +526,7 @@ supported set of modes will be returned in the info structure(s). The requirements for using struct fi_context2 are identical as defined for FI_CONTEXT above. -*FI_LOCAL_MR* +*FI_LOCAL_MR* (deprecated) : The provider is optimized around having applications register memory for locally accessed data buffers. Data buffers used in send and receive operations and as the source buffer for RMA and atomic diff --git a/man/fi_mr.3.md b/man/fi_mr.3.md index f0052e382e1..3a8e1fcd554 100644 --- a/man/fi_mr.3.md +++ b/man/fi_mr.3.md @@ -352,7 +352,7 @@ The following apply to memory registration. desc parameter is NULL, any required local memory registration will be handled by the provider. -*Basic Memory Registration* +*Basic Memory Registration* (deprecated) : Basic memory registration was deprecated in libfabric version 1.5, but is supported for backwards compatibility. Basic memory registration is indicated by setting mr_mode equal to FI_MR_BASIC. diff --git a/man/fi_verbs.7.md b/man/fi_verbs.7.md index 9ed3e33dc1c..0d42c06e63b 100644 --- a/man/fi_verbs.7.md +++ b/man/fi_verbs.7.md @@ -58,7 +58,7 @@ Verbs provider requires applications to support the following modes: #### FI_EP_MSG endpoint type - * FI_LOCAL_MR / FI_MR_LOCAL mr mode. + * FI_MR_LOCAL mr mode. * FI_RX_CQ_DATA for applications that want to use RMA. Applications must take responsibility of posting receives for any incoming CQ data. diff --git a/prov/efa/src/efa_prov_info.c b/prov/efa/src/efa_prov_info.c index d8f4b4e5977..bddc965d53a 100644 --- a/prov/efa/src/efa_prov_info.c +++ b/prov/efa/src/efa_prov_info.c @@ -73,7 +73,7 @@ const struct fi_domain_attr efa_domain_attr = { .control_progress = FI_PROGRESS_AUTO, .data_progress = FI_PROGRESS_AUTO, .resource_mgmt = FI_RM_DISABLED, - .mr_mode = OFI_MR_BASIC_MAP | FI_MR_LOCAL | FI_MR_BASIC, + .mr_mode = OFI_MR_BASIC_MAP | FI_MR_LOCAL | OFI_MR_BASIC, .mr_key_size = sizeof_field(struct ibv_sge, lkey), .cq_data_size = 0, .tx_ctx_cnt = 1024, diff --git a/prov/mrail/src/mrail_attr.c b/prov/mrail/src/mrail_attr.c index e8fda11fe2b..a0f0c9df8b0 100644 --- a/prov/mrail/src/mrail_attr.c +++ b/prov/mrail/src/mrail_attr.c @@ -71,7 +71,7 @@ struct fi_domain_attr mrail_domain_attr = { .data_progress = FI_PROGRESS_AUTO, .resource_mgmt = FI_RM_ENABLED, .av_type = FI_AV_UNSPEC, - .mr_mode = FI_MR_BASIC | FI_MR_SCALABLE | FI_MR_RAW, + .mr_mode = OFI_MR_BASIC | OFI_MR_SCALABLE | FI_MR_RAW, .mr_key_size = SIZE_MAX, .cq_data_size = SIZE_MAX, .cq_cnt = SIZE_MAX, diff --git a/prov/mrail/src/mrail_init.c b/prov/mrail/src/mrail_init.c index 94c4b1acb1f..0072afdab1d 100644 --- a/prov/mrail/src/mrail_init.c +++ b/prov/mrail/src/mrail_init.c @@ -159,7 +159,7 @@ static struct fi_info *mrail_create_core_hints(const struct fi_info *hints) core_hints->mode &= MRAIL_PASSTHRU_MODES; if (core_hints->domain_attr) { - if (core_hints->domain_attr->mr_mode == FI_MR_BASIC) + if (core_hints->domain_attr->mr_mode == OFI_MR_BASIC) core_hints->domain_attr->mr_mode = OFI_MR_BASIC_MAP; removed_mr_mode = core_hints->domain_attr->mr_mode & ~MRAIL_PASSTHRU_MR_MODES; diff --git a/prov/opx/configure.m4 b/prov/opx/configure.m4 index 2f9fa5882a1..952c7553420 100644 --- a/prov/opx/configure.m4 +++ b/prov/opx/configure.m4 @@ -74,9 +74,9 @@ AC_DEFUN([FI_OPX_CONFIGURE],[ AC_DEFINE_UNQUOTED(OPX_AV, [$OPX_AV_MODE], [fabric direct address vector]) AS_CASE([x$OPX_MR], - [xscalable], [OPX_MR_MODE=FI_MR_SCALABLE], - [xbasic], [OPX_MR_MODE=FI_MR_BASIC], - [OPX_MR_MODE=FI_MR_SCALABLE]) + [xscalable], [OPX_MR_MODE=OFI_MR_SCALABLE], + [xbasic], [OPX_MR_MODE=OFI_MR_BASIC], + [OPX_MR_MODE=OFI_MR_SCALABLE]) AC_SUBST(opx_mr, [$OPX_MR_MODE]) AC_DEFINE_UNQUOTED(OPX_MR, [$OPX_MR_MODE], [fabric direct memory region]) diff --git a/prov/opx/include/rdma/opx/fi_opx_domain.h b/prov/opx/include/rdma/opx/fi_opx_domain.h index 9e902097df2..a5e90c23bd7 100644 --- a/prov/opx/include/rdma/opx/fi_opx_domain.h +++ b/prov/opx/include/rdma/opx/fi_opx_domain.h @@ -109,7 +109,7 @@ struct fi_opx_domain { enum fi_threading threading; enum fi_resource_mgmt resource_mgmt; - enum fi_mr_mode mr_mode; + int mr_mode; enum fi_progress data_progress; uuid_t unique_job_key; diff --git a/prov/opx/src/fi_opx_domain.c b/prov/opx/src/fi_opx_domain.c index 51ab32a9578..6a0f7cbd291 100644 --- a/prov/opx/src/fi_opx_domain.c +++ b/prov/opx/src/fi_opx_domain.c @@ -254,7 +254,7 @@ int fi_opx_check_domain_attr(struct fi_domain_attr *attr) goto err; } - if (attr->mr_mode == FI_MR_UNSPEC) { + if (attr->mr_mode == OFI_MR_UNSPEC) { attr->mr_mode = FI_OPX_BASE_MR_MODE; } diff --git a/prov/opx/src/fi_opx_init.c b/prov/opx/src/fi_opx_init.c index c1a2e7cced7..8e005c83a4b 100644 --- a/prov/opx/src/fi_opx_init.c +++ b/prov/opx/src/fi_opx_init.c @@ -675,8 +675,8 @@ static void do_static_assert_tests() "sizeof(fi_opx_hmem_info) >> 3 != OPX_HMEM_SIZE_QWS") ; OPX_COMPILE_TIME_ASSERT(OPX_HFI1_TID_PAGESIZE == 4096, "OPX_HFI1_TID_PAGESIZE must be 4K!"); - OPX_COMPILE_TIME_ASSERT(OPX_MR != FI_MR_UNSPEC, - "OPX_MR should be set to FI_MR_SCALABLE or FI_MR_BASIC, not FI_MR_UNSPEC"); + OPX_COMPILE_TIME_ASSERT(OPX_MR != OFI_MR_UNSPEC, + "OPX_MR should be set to 'FI_MR_SCALABLE' or 'FI_MR_BASIC', not 'FI_MR_UNSPEC'"); } #pragma GCC diagnostic pop diff --git a/prov/opx/src/fi_opx_mr.c b/prov/opx/src/fi_opx_mr.c index 5613f4e6e17..40a0aeda2ca 100644 --- a/prov/opx/src/fi_opx_mr.c +++ b/prov/opx/src/fi_opx_mr.c @@ -50,7 +50,7 @@ static int fi_opx_close_mr(fid_t fid) HASH_DEL(opx_domain->mr_hashmap, opx_mr); int ret = 0; - if (opx_domain->mr_mode & FI_MR_SCALABLE) { + if (opx_domain->mr_mode & OFI_MR_SCALABLE) { ret = fi_opx_ref_dec(&opx_domain->ref_cnt, "domain"); if (ret) { FI_WARN(fi_opx_global.prov, FI_LOG_MR, @@ -129,7 +129,7 @@ static inline int fi_opx_mr_reg_internal(struct fid *fid, opx_domain = (struct fi_opx_domain *) container_of(fid, struct fid_domain, fid); - if (opx_domain->mr_mode & FI_MR_SCALABLE) { + if (opx_domain->mr_mode & OFI_MR_SCALABLE) { if (requested_key >= opx_domain->num_mr_keys) { /* requested key is too large */ errno = FI_EKEYREJECTED; @@ -182,7 +182,7 @@ static inline int fi_opx_mr_reg_internal(struct fid *fid, } opx_mr->attr.requested_key = opx_mr->mr_fid.key; - if (opx_mr->domain->mr_mode & FI_MR_SCALABLE) { + if (opx_mr->domain->mr_mode & OFI_MR_SCALABLE) { fi_opx_ref_inc(&opx_mr->domain->ref_cnt, "domain"); } HASH_ADD(hh, opx_domain->mr_hashmap, @@ -224,7 +224,7 @@ static inline int fi_opx_mr_reg_internal(struct fid *fid, opx_mr->mr_fid.fid.fclass = FI_CLASS_MR; opx_mr->mr_fid.fid.context = context; opx_mr->mr_fid.fid.ops = &fi_opx_fi_ops; - if (opx_domain->mr_mode & FI_MR_SCALABLE) { + if (opx_domain->mr_mode & OFI_MR_SCALABLE) { opx_mr->mr_fid.key = requested_key; } @@ -236,7 +236,7 @@ static inline int fi_opx_mr_reg_internal(struct fid *fid, opx_mr->flags = flags; opx_mr->domain = opx_domain; - if (opx_domain->mr_mode & FI_MR_SCALABLE) { + if (opx_domain->mr_mode & OFI_MR_SCALABLE) { fi_opx_ref_inc(&opx_domain->ref_cnt, "domain"); } HASH_ADD(hh, opx_domain->mr_hashmap, @@ -315,13 +315,13 @@ int fi_opx_init_mr_ops(struct fid_domain *domain, struct fi_info *info) struct fi_opx_domain *opx_domain = container_of(domain, struct fi_opx_domain, domain_fid); - if (info->domain_attr->mr_mode == FI_MR_UNSPEC) goto err; + if (info->domain_attr->mr_mode == OFI_MR_UNSPEC) goto err; opx_domain->domain_fid.mr = &fi_opx_mr_ops; opx_domain->mr_mode = info->domain_attr->mr_mode; - if (opx_domain->mr_mode & FI_MR_SCALABLE) { + if (opx_domain->mr_mode & OFI_MR_SCALABLE) { opx_domain->num_mr_keys = UINT64_MAX; } return 0; @@ -335,7 +335,7 @@ int fi_opx_finalize_mr_ops(struct fid_domain *domain) struct fi_opx_domain *opx_domain = container_of(domain, struct fi_opx_domain, domain_fid); - if (opx_domain->mr_mode & FI_MR_SCALABLE) { + if (opx_domain->mr_mode & OFI_MR_SCALABLE) { opx_domain->num_mr_keys = 0; } return 0; diff --git a/prov/opx/src/opx_hmem_cache.c b/prov/opx/src/opx_hmem_cache.c index b4b856ec58f..0f9d40b6766 100644 --- a/prov/opx/src/opx_hmem_cache.c +++ b/prov/opx/src/opx_hmem_cache.c @@ -565,7 +565,7 @@ void opx_hmem_cache_delete_region(struct ofi_mr_cache *cache, } opx_mr->hmem_dev_reg_handle = 0UL; - if (opx_mr->domain->mr_mode & FI_MR_SCALABLE) { + if (opx_mr->domain->mr_mode & OFI_MR_SCALABLE) { int ret = fi_opx_ref_dec(&opx_mr->domain->ref_cnt, "domain"); if (ret) { FI_WARN(fi_opx_global.prov, FI_LOG_MR, diff --git a/prov/psm2/src/psmx2.h b/prov/psm2/src/psmx2.h index cea411aaabf..396f04ef801 100644 --- a/prov/psm2/src/psmx2.h +++ b/prov/psm2/src/psmx2.h @@ -543,7 +543,7 @@ struct psmx2_fid_domain { uint64_t caps; psm2_uuid_t uuid; - enum fi_mr_mode mr_mode; + int mr_mode; ofi_spin_t mr_lock; uint64_t mr_reserved_key; RbtHandle mr_map; diff --git a/prov/psm2/src/psmx2_attr.c b/prov/psm2/src/psmx2_attr.c index 02f1a33d854..f7a1f5496d6 100644 --- a/prov/psm2/src/psmx2_attr.c +++ b/prov/psm2/src/psmx2_attr.c @@ -89,7 +89,7 @@ static struct fi_domain_attr psmx2_domain_attr = { .data_progress = FI_PROGRESS_AUTO, .resource_mgmt = FI_RM_ENABLED, .av_type = FI_AV_UNSPEC, - .mr_mode = FI_MR_SCALABLE | FI_MR_BASIC, + .mr_mode = OFI_MR_SCALABLE | OFI_MR_BASIC, .mr_key_size = sizeof(uint64_t), .cq_data_size = 0, /* 4, 8 */ .cq_cnt = 65535, @@ -420,8 +420,8 @@ void psmx2_alter_prov_info(uint32_t api_version, info->domain_attr->data_progress = FI_PROGRESS_MANUAL; - if (info->domain_attr->mr_mode == (FI_MR_BASIC | FI_MR_SCALABLE)) - info->domain_attr->mr_mode = FI_MR_SCALABLE; + if (info->domain_attr->mr_mode == (OFI_MR_BASIC | OFI_MR_SCALABLE)) + info->domain_attr->mr_mode = OFI_MR_SCALABLE; /* * Avoid automatically adding secondary caps that may negatively diff --git a/prov/psm2/src/psmx2_domain.c b/prov/psm2/src/psmx2_domain.c index 189250c02d2..0f02acd7523 100644 --- a/prov/psm2/src/psmx2_domain.c +++ b/prov/psm2/src/psmx2_domain.c @@ -350,7 +350,7 @@ int psmx2_domain_open(struct fid_fabric *fabric, struct fi_info *info, struct psmx2_fid_fabric *fabric_priv; struct psmx2_fid_domain *domain_priv; struct psmx2_ep_name *src_addr = info->src_addr; - int mr_mode = (info->domain_attr->mr_mode & FI_MR_BASIC) ? FI_MR_BASIC : 0; + int mr_mode = (info->domain_attr->mr_mode & OFI_MR_BASIC) ? OFI_MR_BASIC : 0; int err, tmp; FI_INFO(&psmx2_prov, FI_LOG_DOMAIN, "\n"); diff --git a/prov/psm2/src/psmx2_mr.c b/prov/psm2/src/psmx2_mr.c index 750721a399b..9e347bd8e72 100644 --- a/prov/psm2/src/psmx2_mr.c +++ b/prov/psm2/src/psmx2_mr.c @@ -73,7 +73,7 @@ static int psmx2_mr_reserve_key(struct psmx2_fid_domain *domain, domain->mr_lock_fn(&domain->mr_lock, 1); - if (domain->mr_mode == FI_MR_BASIC) { + if (domain->mr_mode == OFI_MR_BASIC) { key = domain->mr_reserved_key; try_count = 10000; /* large enough */ } else { @@ -84,7 +84,7 @@ static int psmx2_mr_reserve_key(struct psmx2_fid_domain *domain, for (i=0; imr_map, (void *)key)) { if (!rbtInsert(domain->mr_map, (void *)key, mr)) { - if (domain->mr_mode == FI_MR_BASIC) + if (domain->mr_mode == OFI_MR_BASIC) domain->mr_reserved_key = key + 1; *assigned_key = key; err = 0; @@ -314,7 +314,7 @@ STATIC int psmx2_mr_reg(struct fid *fid, const void *buf, size_t len, mr_priv->iov_count = 1; mr_priv->iov[0].iov_base = (void *)buf; mr_priv->iov[0].iov_len = len; - mr_priv->offset = (domain_priv->mr_mode == FI_MR_BASIC) ? 0 : + mr_priv->offset = (domain_priv->mr_mode == OFI_MR_BASIC) ? 0 : ((uint64_t)mr_priv->iov[0].iov_base - offset); *mr = &mr_priv->mr; @@ -369,7 +369,7 @@ STATIC int psmx2_mr_regv(struct fid *fid, for (i=0; iiov[i] = iov[i]; psmx2_mr_normalize_iov(mr_priv->iov, &mr_priv->iov_count); - mr_priv->offset = (domain_priv->mr_mode == FI_MR_BASIC) ? 0 : + mr_priv->offset = (domain_priv->mr_mode == OFI_MR_BASIC) ? 0 : ((uint64_t)mr_priv->iov[0].iov_base - offset); *mr = &mr_priv->mr; @@ -422,7 +422,7 @@ STATIC int psmx2_mr_regattr(struct fid *fid, const struct fi_mr_attr *attr, for (i=0; iiov_count; i++) mr_priv->iov[i] = attr->mr_iov[i]; psmx2_mr_normalize_iov(mr_priv->iov, &mr_priv->iov_count); - mr_priv->offset = (domain_priv->mr_mode == FI_MR_BASIC) ? 0 : + mr_priv->offset = (domain_priv->mr_mode == OFI_MR_BASIC) ? 0 : ((uint64_t)mr_priv->iov[0].iov_base - attr->offset); *mr = &mr_priv->mr; diff --git a/prov/psm3/src/psmx3.h b/prov/psm3/src/psmx3.h index 93f58a7ebf0..6edfa308338 100644 --- a/prov/psm3/src/psmx3.h +++ b/prov/psm3/src/psmx3.h @@ -557,7 +557,7 @@ struct psmx3_fid_domain { uint64_t mode; uint64_t caps; - enum fi_mr_mode mr_mode; + int mr_mode; ofi_spin_t mr_lock; uint64_t mr_reserved_key; RbtHandle mr_map; diff --git a/prov/psm3/src/psmx3_attr.c b/prov/psm3/src/psmx3_attr.c index 938e44719aa..402253fba59 100644 --- a/prov/psm3/src/psmx3_attr.c +++ b/prov/psm3/src/psmx3_attr.c @@ -89,7 +89,7 @@ static struct fi_domain_attr psmx3_domain_attr = { .data_progress = FI_PROGRESS_AUTO, .resource_mgmt = FI_RM_ENABLED, .av_type = FI_AV_UNSPEC, - .mr_mode = FI_MR_SCALABLE | FI_MR_BASIC, + .mr_mode = OFI_MR_SCALABLE | OFI_MR_BASIC, .mr_key_size = sizeof(uint64_t), .cq_data_size = 0, /* 4, 8 */ .cq_cnt = 65535, @@ -743,8 +743,8 @@ void psmx3_alter_prov_info(uint32_t api_version, info->domain_attr->data_progress = FI_PROGRESS_MANUAL; - if (info->domain_attr->mr_mode == (FI_MR_BASIC | FI_MR_SCALABLE)) - info->domain_attr->mr_mode = FI_MR_SCALABLE; + if (info->domain_attr->mr_mode == (OFI_MR_BASIC | OFI_MR_SCALABLE)) + info->domain_attr->mr_mode = OFI_MR_SCALABLE; /* * Avoid automatically adding secondary caps that may negatively diff --git a/prov/psm3/src/psmx3_domain.c b/prov/psm3/src/psmx3_domain.c index 74e9de2d9c4..59ef33636bd 100644 --- a/prov/psm3/src/psmx3_domain.c +++ b/prov/psm3/src/psmx3_domain.c @@ -301,7 +301,7 @@ int psmx3_domain_open(struct fid_fabric *fabric, struct fi_info *info, struct psmx3_fid_fabric *fabric_priv; struct psmx3_fid_domain *domain_priv; struct psmx3_ep_name *src_addr = info->src_addr; - int mr_mode = (info->domain_attr->mr_mode & FI_MR_BASIC) ? FI_MR_BASIC : 0; + int mr_mode = (info->domain_attr->mr_mode & OFI_MR_BASIC) ? OFI_MR_BASIC : 0; int err; PSMX3_INFO(&psmx3_prov, FI_LOG_DOMAIN, "\n"); diff --git a/prov/psm3/src/psmx3_mr.c b/prov/psm3/src/psmx3_mr.c index cc6533062ee..6bc1bf079fe 100644 --- a/prov/psm3/src/psmx3_mr.c +++ b/prov/psm3/src/psmx3_mr.c @@ -73,7 +73,7 @@ static int psmx3_mr_reserve_key(struct psmx3_fid_domain *domain, domain->mr_lock_fn(&domain->mr_lock, 1); - if (domain->mr_mode == FI_MR_BASIC) { + if (domain->mr_mode == OFI_MR_BASIC) { key = domain->mr_reserved_key; try_count = 10000; /* large enough */ } else { @@ -84,7 +84,7 @@ static int psmx3_mr_reserve_key(struct psmx3_fid_domain *domain, for (i=0; imr_map, (void *)key)) { if (!rbtInsert(domain->mr_map, (void *)key, mr)) { - if (domain->mr_mode == FI_MR_BASIC) + if (domain->mr_mode == OFI_MR_BASIC) domain->mr_reserved_key = key + 1; *assigned_key = key; err = 0; @@ -314,7 +314,7 @@ STATIC int psmx3_mr_reg(struct fid *fid, const void *buf, size_t len, mr_priv->iov_count = 1; mr_priv->iov[0].iov_base = (void *)buf; mr_priv->iov[0].iov_len = len; - mr_priv->offset = (domain_priv->mr_mode == FI_MR_BASIC) ? 0 : + mr_priv->offset = (domain_priv->mr_mode == OFI_MR_BASIC) ? 0 : ((uint64_t)mr_priv->iov[0].iov_base - offset); *mr = &mr_priv->mr; @@ -369,7 +369,7 @@ STATIC int psmx3_mr_regv(struct fid *fid, for (i=0; iiov[i] = iov[i]; psmx3_mr_normalize_iov(mr_priv->iov, &mr_priv->iov_count); - mr_priv->offset = (domain_priv->mr_mode == FI_MR_BASIC) ? 0 : + mr_priv->offset = (domain_priv->mr_mode == OFI_MR_BASIC) ? 0 : ((uint64_t)mr_priv->iov[0].iov_base - offset); *mr = &mr_priv->mr; @@ -422,7 +422,7 @@ STATIC int psmx3_mr_regattr(struct fid *fid, const struct fi_mr_attr *attr, for (i=0; iiov_count; i++) mr_priv->iov[i] = attr->mr_iov[i]; psmx3_mr_normalize_iov(mr_priv->iov, &mr_priv->iov_count); - mr_priv->offset = (domain_priv->mr_mode == FI_MR_BASIC) ? 0 : + mr_priv->offset = (domain_priv->mr_mode == OFI_MR_BASIC) ? 0 : ((uint64_t)mr_priv->iov[0].iov_base - attr->offset); *mr = &mr_priv->mr; diff --git a/prov/rxd/src/rxd_attr.c b/prov/rxd/src/rxd_attr.c index d06515bec98..0dff339a339 100644 --- a/prov/rxd/src/rxd_attr.c +++ b/prov/rxd/src/rxd_attr.c @@ -84,7 +84,7 @@ struct fi_domain_attr rxd_domain_attr = { .data_progress = FI_PROGRESS_MANUAL, .resource_mgmt = FI_RM_ENABLED, .av_type = FI_AV_UNSPEC, - .mr_mode = FI_MR_BASIC | FI_MR_SCALABLE, + .mr_mode = OFI_MR_BASIC | OFI_MR_SCALABLE, .cq_data_size = sizeof_field(struct rxd_data_hdr, cq_data), .mr_key_size = sizeof(uint64_t), .cq_cnt = 128, diff --git a/prov/rxd/src/rxd_init.c b/prov/rxd/src/rxd_init.c index 6bdae1423c2..6ff17f40d56 100644 --- a/prov/rxd/src/rxd_init.c +++ b/prov/rxd/src/rxd_init.c @@ -62,14 +62,14 @@ void rxd_info_to_core_mr_modes(uint32_t version, const struct fi_info *hints, { /* We handle FI_MR_BASIC and FI_MR_SCALABLE irrespective of version */ if (hints && hints->domain_attr && - (hints->domain_attr->mr_mode & (FI_MR_SCALABLE | FI_MR_BASIC))) { - core_info->mode = FI_LOCAL_MR; + (hints->domain_attr->mr_mode & (OFI_MR_SCALABLE | OFI_MR_BASIC))) { + core_info->mode = OFI_LOCAL_MR; core_info->domain_attr->mr_mode = hints->domain_attr->mr_mode; } else if (FI_VERSION_LT(version, FI_VERSION(1, 5))) { - core_info->mode |= FI_LOCAL_MR; + core_info->mode |= OFI_LOCAL_MR; /* Specify FI_MR_UNSPEC (instead of FI_MR_BASIC) so that * providers that support only FI_MR_SCALABLE aren't dropped */ - core_info->domain_attr->mr_mode = FI_MR_UNSPEC; + core_info->domain_attr->mr_mode = OFI_MR_UNSPEC; } else { core_info->domain_attr->mr_mode |= FI_MR_LOCAL; core_info->domain_attr->mr_mode |= OFI_MR_BASIC_MAP; @@ -81,7 +81,7 @@ int rxd_info_to_core(uint32_t version, const struct fi_info *rxd_info_in, { rxd_info_to_core_mr_modes(version, rxd_info_in, core_info); core_info->caps = FI_MSG; - core_info->mode = FI_LOCAL_MR | FI_CONTEXT | FI_MSG_PREFIX; + core_info->mode = OFI_LOCAL_MR | FI_CONTEXT | FI_MSG_PREFIX; core_info->ep_attr->type = FI_EP_DGRAM; return 0; diff --git a/prov/rxm/src/rxm.h b/prov/rxm/src/rxm.h index bf53299ce1f..16074babeac 100644 --- a/prov/rxm/src/rxm.h +++ b/prov/rxm/src/rxm.h @@ -139,10 +139,10 @@ extern size_t rxm_packet_size; FI_DELIVERY_COMPLETE | FI_COMPLETION) #define RXM_RX_OP_FLAGS (FI_MULTI_RECV | FI_COMPLETION) -#define RXM_MR_VIRT_ADDR(info) ((info->domain_attr->mr_mode == FI_MR_BASIC) ||\ +#define RXM_MR_VIRT_ADDR(info) ((info->domain_attr->mr_mode == OFI_MR_BASIC) ||\ info->domain_attr->mr_mode & FI_MR_VIRT_ADDR) -#define RXM_MR_PROV_KEY(info) ((info->domain_attr->mr_mode == FI_MR_BASIC) ||\ +#define RXM_MR_PROV_KEY(info) ((info->domain_attr->mr_mode == OFI_MR_BASIC) ||\ info->domain_attr->mr_mode & FI_MR_PROV_KEY) #define RXM_UPDATE_STATE(subsystem, buf, new_state) \ diff --git a/prov/rxm/src/rxm_attr.c b/prov/rxm/src/rxm_attr.c index 7d20bd84ec0..defa7771188 100644 --- a/prov/rxm/src/rxm_attr.c +++ b/prov/rxm/src/rxm_attr.c @@ -119,7 +119,7 @@ static struct fi_domain_attr rxm_domain_attr = { * doesn't fail at RxM level. If an app requires FI_MR_BASIC, it * would be passed down to core provider. */ - .mr_mode = FI_MR_BASIC | FI_MR_SCALABLE, + .mr_mode = OFI_MR_BASIC | OFI_MR_SCALABLE, .cq_data_size = sizeof_field(struct ofi_op_hdr, data), .cq_cnt = (1 << 16), .ep_cnt = (1 << 15), @@ -189,7 +189,7 @@ static struct fi_domain_attr rxm_domain_thru_attr = { * doesn't fail at RxM level. If an app requires FI_MR_BASIC, it * would be passed down to core provider. */ - .mr_mode = FI_MR_BASIC | FI_MR_SCALABLE, + .mr_mode = OFI_MR_BASIC | OFI_MR_SCALABLE, .cq_data_size = sizeof(uint64_t), .cq_cnt = (1 << 16), .ep_cnt = (1 << 15), diff --git a/prov/rxm/src/rxm_init.c b/prov/rxm/src/rxm_init.c index 5e11e5f5e08..78610bc5f04 100644 --- a/prov/rxm/src/rxm_init.c +++ b/prov/rxm/src/rxm_init.c @@ -84,12 +84,12 @@ void rxm_info_to_core_mr_modes(uint32_t version, const struct fi_info *hints, struct fi_info *core_info) { if (hints && hints->domain_attr && - (hints->domain_attr->mr_mode & (FI_MR_SCALABLE | FI_MR_BASIC))) { - core_info->mode |= FI_LOCAL_MR; + (hints->domain_attr->mr_mode & (OFI_MR_SCALABLE | OFI_MR_BASIC))) { + core_info->mode |= OFI_LOCAL_MR; core_info->domain_attr->mr_mode = hints->domain_attr->mr_mode; } else if (FI_VERSION_LT(version, FI_VERSION(1, 5))) { - core_info->mode |= FI_LOCAL_MR; - core_info->domain_attr->mr_mode = FI_MR_UNSPEC; + core_info->mode |= OFI_LOCAL_MR; + core_info->domain_attr->mr_mode = OFI_MR_UNSPEC; } else { core_info->domain_attr->mr_mode |= FI_MR_LOCAL; if (!hints || !hints->domain_attr || @@ -474,9 +474,9 @@ static void rxm_alter_info(const struct fi_info *hints, struct fi_info *info) } if (!ofi_mr_local(hints)) { - cur->mode &= ~FI_LOCAL_MR; - cur->tx_attr->mode &= ~FI_LOCAL_MR; - cur->rx_attr->mode &= ~FI_LOCAL_MR; + cur->mode &= ~OFI_LOCAL_MR; + cur->tx_attr->mode &= ~OFI_LOCAL_MR; + cur->rx_attr->mode &= ~OFI_LOCAL_MR; cur->domain_attr->mr_mode &= ~FI_MR_LOCAL; } diff --git a/prov/shm/src/smr_attr.c b/prov/shm/src/smr_attr.c index 60d61d0020c..3e58d9c25c5 100644 --- a/prov/shm/src/smr_attr.c +++ b/prov/shm/src/smr_attr.c @@ -98,7 +98,7 @@ struct fi_domain_attr smr_domain_attr = { .data_progress = FI_PROGRESS_MANUAL, .resource_mgmt = FI_RM_ENABLED, .av_type = FI_AV_UNSPEC, - .mr_mode = FI_MR_BASIC | FI_MR_SCALABLE, + .mr_mode = OFI_MR_BASIC | OFI_MR_SCALABLE, .mr_key_size = sizeof_field(struct fi_rma_iov, key), .cq_data_size = sizeof_field(struct smr_msg_hdr, data), .cq_cnt = (1 << 10), diff --git a/prov/sm2/src/sm2_attr.c b/prov/sm2/src/sm2_attr.c index 81f6a0c9045..1423ffacdb7 100644 --- a/prov/sm2/src/sm2_attr.c +++ b/prov/sm2/src/sm2_attr.c @@ -102,7 +102,7 @@ struct fi_domain_attr sm2_domain_attr = { .data_progress = FI_PROGRESS_MANUAL, .resource_mgmt = FI_RM_ENABLED, .av_type = FI_AV_UNSPEC, - .mr_mode = FI_MR_BASIC | FI_MR_SCALABLE, + .mr_mode = OFI_MR_BASIC | OFI_MR_SCALABLE, .mr_key_size = sizeof_field(struct fi_rma_iov, key), .cq_data_size = sizeof_field(struct sm2_xfer_hdr, cq_data), .cq_cnt = (1 << 10), diff --git a/prov/sockets/src/sock_attr.c b/prov/sockets/src/sock_attr.c index e560f50ca15..367dded80f6 100644 --- a/prov/sockets/src/sock_attr.c +++ b/prov/sockets/src/sock_attr.c @@ -188,7 +188,7 @@ struct fi_domain_attr sock_domain_attr = { .data_progress = FI_PROGRESS_AUTO, .resource_mgmt = FI_RM_ENABLED, /* Provider supports basic memory registration mode */ - .mr_mode = FI_MR_BASIC | FI_MR_SCALABLE, + .mr_mode = OFI_MR_BASIC | OFI_MR_SCALABLE, .mr_key_size = sizeof(uint64_t), .cq_data_size = sizeof(uint64_t), .cq_cnt = SOCK_EP_MAX_CQ_CNT, diff --git a/prov/sockets/src/sock_ep.c b/prov/sockets/src/sock_ep.c index 76119673061..02466124c7e 100644 --- a/prov/sockets/src/sock_ep.c +++ b/prov/sockets/src/sock_ep.c @@ -1429,7 +1429,7 @@ static void sock_set_domain_attr(uint32_t api_version, void *src_addr, *attr = sock_domain_attr; if (FI_VERSION_LT(api_version, FI_VERSION(1, 5))) - attr->mr_mode = FI_MR_SCALABLE; + attr->mr_mode = OFI_MR_SCALABLE; goto out; } @@ -1449,11 +1449,11 @@ static void sock_set_domain_attr(uint32_t api_version, void *src_addr, if (attr->data_progress == FI_PROGRESS_UNSPEC) attr->data_progress = sock_domain_attr.data_progress; if (FI_VERSION_LT(api_version, FI_VERSION(1, 5))) { - if (attr->mr_mode == FI_MR_UNSPEC) - attr->mr_mode = FI_MR_SCALABLE; + if (attr->mr_mode == OFI_MR_UNSPEC) + attr->mr_mode = OFI_MR_SCALABLE; } else { - if ((attr->mr_mode != FI_MR_BASIC) && - (attr->mr_mode != FI_MR_SCALABLE)) + if ((attr->mr_mode != OFI_MR_BASIC) && + (attr->mr_mode != OFI_MR_SCALABLE)) attr->mr_mode = 0; } diff --git a/prov/tcp/src/xnet_attr.c b/prov/tcp/src/xnet_attr.c index 2ae79529cc5..1e47f031c1b 100644 --- a/prov/tcp/src/xnet_attr.c +++ b/prov/tcp/src/xnet_attr.c @@ -151,7 +151,7 @@ static struct fi_domain_attr xnet_domain_attr = { .control_progress = FI_PROGRESS_AUTO, .data_progress = FI_PROGRESS_AUTO, .resource_mgmt = FI_RM_ENABLED, - .mr_mode = FI_MR_SCALABLE | FI_MR_BASIC, + .mr_mode = OFI_MR_SCALABLE | OFI_MR_BASIC, .mr_key_size = sizeof(uint64_t), .av_type = FI_AV_UNSPEC, .cq_data_size = sizeof(uint64_t), @@ -172,7 +172,7 @@ static struct fi_domain_attr xnet_rdm_domain_attr = { .control_progress = FI_PROGRESS_AUTO, .data_progress = FI_PROGRESS_AUTO, .resource_mgmt = FI_RM_ENABLED, - .mr_mode = FI_MR_SCALABLE | FI_MR_BASIC, + .mr_mode = OFI_MR_SCALABLE | OFI_MR_BASIC, .mr_key_size = sizeof(uint64_t), .av_type = FI_AV_UNSPEC, .cq_data_size = sizeof(uint64_t), diff --git a/prov/ucx/src/ucx_init.c b/prov/ucx/src/ucx_init.c index ec585318e65..2f18b3b361a 100644 --- a/prov/ucx/src/ucx_init.c +++ b/prov/ucx/src/ucx_init.c @@ -93,7 +93,7 @@ static struct fi_domain_attr ucx_domain_attrs = { .data_progress = FI_PROGRESS_MANUAL, .resource_mgmt = FI_RM_ENABLED, .av_type = FI_AV_UNSPEC, - .mr_mode = OFI_MR_BASIC_MAP | FI_MR_BASIC | FI_MR_RAW, + .mr_mode = OFI_MR_BASIC_MAP | OFI_MR_BASIC | FI_MR_RAW, .mr_key_size = FI_UCX_MAX_KEY_SIZE, .tx_ctx_cnt = 1, .rx_ctx_cnt = 1, diff --git a/prov/udp/src/udpx_attr.c b/prov/udp/src/udpx_attr.c index c6ad7df46fe..7737efe86fc 100644 --- a/prov/udp/src/udpx_attr.c +++ b/prov/udp/src/udpx_attr.c @@ -66,7 +66,7 @@ struct fi_domain_attr udpx_domain_attr = { .data_progress = FI_PROGRESS_AUTO, .resource_mgmt = FI_RM_ENABLED, .av_type = FI_AV_UNSPEC, - .mr_mode = FI_MR_BASIC | FI_MR_SCALABLE, + .mr_mode = OFI_MR_BASIC | OFI_MR_SCALABLE, .mr_key_size = sizeof(uint64_t), .cq_cnt = 256, .ep_cnt = 256, diff --git a/prov/usnic/src/usdf_dgram.h b/prov/usnic/src/usdf_dgram.h index cebc6d635ad..11d7311dbb7 100644 --- a/prov/usnic/src/usdf_dgram.h +++ b/prov/usnic/src/usdf_dgram.h @@ -41,7 +41,7 @@ #define USDF_DGRAM_CAPS (FI_MSG | FI_SOURCE | FI_SEND | FI_RECV) -#define USDF_DGRAM_SUPP_MODE (FI_LOCAL_MR | FI_MSG_PREFIX) +#define USDF_DGRAM_SUPP_MODE (OFI_LOCAL_MR | FI_MSG_PREFIX) #define USDF_DGRAM_MSG_ORDER (0) #define USDF_DGRAM_INJECT_SIZE \ diff --git a/prov/usnic/src/usdf_domain.c b/prov/usnic/src/usdf_domain.c index 4e477eb2ed0..39df4afb39f 100644 --- a/prov/usnic/src/usdf_domain.c +++ b/prov/usnic/src/usdf_domain.c @@ -171,7 +171,7 @@ usdf_domain_open(struct fid_fabric *fabric, struct fi_info *info, if (ofi_check_mr_mode( &usdf_ops, fabric->api_version, - FI_MR_BASIC | FI_MR_ALLOCATED | FI_MR_LOCAL, info)) { + OFI_MR_BASIC | FI_MR_ALLOCATED | FI_MR_LOCAL, info)) { /* the caller ignored our fi_getinfo results */ USDF_WARN_SYS(DOMAIN, "MR mode (%d) not supported\n", info->domain_attr->mr_mode); @@ -379,7 +379,7 @@ int usdf_catch_dom_attr(uint32_t version, const struct fi_info *hints, * this function. This means it is safe to return * 1.4 default mr_mode. */ - dom_attr->mr_mode = FI_MR_BASIC; + dom_attr->mr_mode = OFI_MR_BASIC; /* FI_REMOTE_COMM is introduced in 1.5. So don't return it. */ dom_attr->caps &= ~FI_REMOTE_COMM; @@ -390,7 +390,7 @@ int usdf_catch_dom_attr(uint32_t version, const struct fi_info *hints, return -FI_EBADFLAGS; } } else { - dom_attr->mr_mode &= ~(FI_MR_BASIC | FI_MR_SCALABLE); + dom_attr->mr_mode &= ~(OFI_MR_BASIC | OFI_MR_SCALABLE); } return FI_SUCCESS; @@ -401,7 +401,7 @@ int usdf_catch_tx_attr(uint32_t version, const struct fi_tx_attr *tx_attr) { /* In version < 1.5, FI_LOCAL_MR is required. */ if (FI_VERSION_LT(version, FI_VERSION(1, 5))) { - if ((tx_attr->mode & FI_LOCAL_MR) == 0) + if ((tx_attr->mode & OFI_LOCAL_MR) == 0) return -FI_ENODATA; } @@ -413,7 +413,7 @@ int usdf_catch_rx_attr(uint32_t version, const struct fi_rx_attr *rx_attr) { /* In version < 1.5, FI_LOCAL_MR is required. */ if (FI_VERSION_LT(version, FI_VERSION(1, 5))) { - if ((rx_attr->mode & FI_LOCAL_MR) == 0) + if ((rx_attr->mode & OFI_LOCAL_MR) == 0) return -FI_ENODATA; } diff --git a/prov/usnic/src/usdf_ep_dgram.c b/prov/usnic/src/usdf_ep_dgram.c index 11bce832223..42fb189544c 100644 --- a/prov/usnic/src/usdf_ep_dgram.c +++ b/prov/usnic/src/usdf_ep_dgram.c @@ -432,7 +432,7 @@ static const struct fi_domain_attr dgram_dflt_domain_attr = { .control_progress = FI_PROGRESS_AUTO, .data_progress = FI_PROGRESS_MANUAL, .resource_mgmt = FI_RM_DISABLED, - .mr_mode = FI_MR_ALLOCATED | FI_MR_LOCAL | FI_MR_BASIC, + .mr_mode = FI_MR_ALLOCATED | FI_MR_LOCAL | OFI_MR_BASIC, .cntr_cnt = USDF_DGRAM_CNTR_CNT, .mr_iov_limit = USDF_DGRAM_MR_IOV_LIMIT, .mr_cnt = USDF_DGRAM_MR_CNT, diff --git a/prov/usnic/src/usdf_fabric.c b/prov/usnic/src/usdf_fabric.c index 65b2e5daaa2..d495bb2d5ca 100644 --- a/prov/usnic/src/usdf_fabric.c +++ b/prov/usnic/src/usdf_fabric.c @@ -330,7 +330,7 @@ static int validate_modebits(uint32_t version, const struct fi_info *hints, /* Before version 1.5, FI_LOCAL_MR is a requirement. */ if (FI_VERSION_LT(version, FI_VERSION(1, 5))) { - if ((mode & FI_LOCAL_MR) == 0) + if ((mode & OFI_LOCAL_MR) == 0) return -FI_ENODATA; } diff --git a/prov/util/src/util_attr.c b/prov/util/src/util_attr.c index 646c5b49903..634af1e5e82 100644 --- a/prov/util/src/util_attr.c +++ b/prov/util/src/util_attr.c @@ -510,7 +510,7 @@ static int ofi_cap_mr_mode(uint64_t info_caps, int mr_mode) mr_mode &= ~OFI_MR_MODE_RMA_TARGET; } - return mr_mode & ~(FI_MR_BASIC | FI_MR_SCALABLE); + return mr_mode & ~(OFI_MR_BASIC | OFI_MR_SCALABLE); } /* @@ -524,38 +524,38 @@ int ofi_check_mr_mode(const struct fi_provider *prov, uint32_t api_version, int ret = -FI_ENODATA; if ((prov_mode & FI_MR_LOCAL) && - !((user_info->mode & FI_LOCAL_MR) || (user_mode & FI_MR_LOCAL))) + !((user_info->mode & OFI_LOCAL_MR) || (user_mode & FI_MR_LOCAL))) goto out; if (FI_VERSION_LT(api_version, FI_VERSION(1, 5))) { switch (user_mode) { - case FI_MR_UNSPEC: - if (!(prov_mode & (FI_MR_SCALABLE | FI_MR_BASIC))) + case OFI_MR_UNSPEC: + if (!(prov_mode & (OFI_MR_SCALABLE | OFI_MR_BASIC))) goto out; break; - case FI_MR_BASIC: - if (!(prov_mode & FI_MR_BASIC)) + case OFI_MR_BASIC: + if (!(prov_mode & OFI_MR_BASIC)) goto out; break; - case FI_MR_SCALABLE: - if (!(prov_mode & FI_MR_SCALABLE)) + case OFI_MR_SCALABLE: + if (!(prov_mode & OFI_MR_SCALABLE)) goto out; break; default: goto out; } } else { - if (user_mode & FI_MR_BASIC) { - if ((user_mode & ~FI_MR_BASIC) || - !(prov_mode & FI_MR_BASIC)) + if (user_mode & OFI_MR_BASIC) { + if ((user_mode & ~OFI_MR_BASIC) || + !(prov_mode & OFI_MR_BASIC)) goto out; - } else if (user_mode & FI_MR_SCALABLE) { - if ((user_mode & ~FI_MR_SCALABLE) || - !(prov_mode & FI_MR_SCALABLE)) + } else if (user_mode & OFI_MR_SCALABLE) { + if ((user_mode & ~OFI_MR_SCALABLE) || + !(prov_mode & OFI_MR_SCALABLE)) goto out; } else { prov_mode = ofi_cap_mr_mode(user_info->caps, prov_mode); - if (user_mode != FI_MR_UNSPEC && + if (user_mode != OFI_MR_UNSPEC && (user_mode & prov_mode) != prov_mode) goto out; } @@ -1185,13 +1185,13 @@ static void fi_alter_domain_attr(struct fi_domain_attr *attr, int hints_mr_mode; hints_mr_mode = hints ? hints->mr_mode : 0; - if (hints_mr_mode & (FI_MR_BASIC | FI_MR_SCALABLE)) { + if (hints_mr_mode & (OFI_MR_BASIC | OFI_MR_SCALABLE)) { attr->mr_mode = hints_mr_mode; } else if (FI_VERSION_LT(api_version, FI_VERSION(1, 5))) { - attr->mr_mode = (attr->mr_mode && attr->mr_mode != FI_MR_SCALABLE) ? - FI_MR_BASIC : FI_MR_SCALABLE; + attr->mr_mode = (attr->mr_mode && attr->mr_mode != OFI_MR_SCALABLE) ? + OFI_MR_BASIC : OFI_MR_SCALABLE; } else { - attr->mr_mode &= ~(FI_MR_BASIC | FI_MR_SCALABLE); + attr->mr_mode &= ~(OFI_MR_BASIC | OFI_MR_SCALABLE); if (hints && ((hints_mr_mode & attr->mr_mode) != attr->mr_mode)) { @@ -1295,8 +1295,8 @@ static uint64_t ofi_get_info_caps(const struct fi_info *prov_info, user_mode = user_info->domain_attr->mr_mode; if ((FI_VERSION_LT(api_version, FI_VERSION(1,5)) && - (user_mode == FI_MR_UNSPEC)) || - (user_mode == FI_MR_BASIC) || + (user_mode == OFI_MR_UNSPEC)) || + (user_mode == OFI_MR_BASIC) || ((user_mode & prov_mode & OFI_MR_MODE_RMA_TARGET) == (prov_mode & OFI_MR_MODE_RMA_TARGET))) return caps; @@ -1321,8 +1321,8 @@ void ofi_alter_info(struct fi_info *info, const struct fi_info *hints, if ((info->domain_attr->mr_mode & FI_MR_LOCAL) && (FI_VERSION_LT(api_version, FI_VERSION(1, 5)) || (hints && hints->domain_attr && - (hints->domain_attr->mr_mode & (FI_MR_BASIC | FI_MR_SCALABLE))))) - info->mode |= FI_LOCAL_MR; + (hints->domain_attr->mr_mode & (OFI_MR_BASIC | OFI_MR_SCALABLE))))) + info->mode |= OFI_LOCAL_MR; if (hints) info->handle = hints->handle; diff --git a/prov/util/src/util_mr_map.c b/prov/util/src/util_mr_map.c index 535189ea71b..f08e350b4db 100644 --- a/prov/util/src/util_mr_map.c +++ b/prov/util/src/util_mr_map.c @@ -199,10 +199,10 @@ int ofi_mr_map_init(const struct fi_provider *prov, int mode, return -FI_ENOMEM; switch (mode) { - case FI_MR_BASIC: + case OFI_MR_BASIC: map->mode = OFI_MR_BASIC_MAP; break; - case FI_MR_SCALABLE: + case OFI_MR_SCALABLE: map->mode = 0; break; default: diff --git a/prov/verbs/src/verbs_info.c b/prov/verbs/src/verbs_info.c index a07bf3aee25..79b1b4c80d4 100644 --- a/prov/verbs/src/verbs_info.c +++ b/prov/verbs/src/verbs_info.c @@ -82,7 +82,7 @@ const struct fi_domain_attr verbs_domain_attr = { .control_progress = FI_PROGRESS_AUTO, .data_progress = FI_PROGRESS_AUTO, .resource_mgmt = FI_RM_ENABLED, - .mr_mode = OFI_MR_BASIC_MAP | FI_MR_LOCAL | FI_MR_BASIC, + .mr_mode = OFI_MR_BASIC_MAP | FI_MR_LOCAL | OFI_MR_BASIC, .mr_key_size = sizeof_field(struct ibv_sge, lkey), .cq_data_size = sizeof_field(struct ibv_send_wr, imm_data), .tx_ctx_cnt = 1024, diff --git a/src/abi_1_0.c b/src/abi_1_0.c index 5656380f55b..3b5b24756f7 100644 --- a/src/abi_1_0.c +++ b/src/abi_1_0.c @@ -61,7 +61,7 @@ struct fi_domain_attr_1_0 { enum fi_progress data_progress; enum fi_resource_mgmt resource_mgmt; enum fi_av_type av_type; - enum fi_mr_mode mr_mode; + int mr_mode; size_t mr_key_size; size_t cq_data_size; size_t cq_cnt; diff --git a/src/fi_tostr.c b/src/fi_tostr.c index 9a3797f2ad7..dde251c326c 100644 --- a/src/fi_tostr.c +++ b/src/fi_tostr.c @@ -268,7 +268,7 @@ static void ofi_tostr_mode(char *buf, size_t len, uint64_t mode) IFFLAGSTRN(mode, FI_MSG_PREFIX, len); IFFLAGSTRN(mode, FI_ASYNC_IOV, len); IFFLAGSTRN(mode, FI_RX_CQ_DATA, len); - IFFLAGSTRN(mode, FI_LOCAL_MR, len); + IFFLAGSTRN2(mode, OFI_LOCAL_MR, FI_LOCAL_MR, len); IFFLAGSTRN(mode, FI_CONTEXT2, len); ofi_remove_comma(buf); @@ -431,8 +431,8 @@ static void ofi_tostr_av_type(char *buf, size_t len, enum fi_av_type type) static void ofi_tostr_mr_mode(char *buf, size_t len, int mr_mode) { - IFFLAGSTRN(mr_mode, FI_MR_BASIC, len); - IFFLAGSTRN(mr_mode, FI_MR_SCALABLE, len); + IFFLAGSTRN2(mr_mode, OFI_MR_BASIC, FI_MR_BASIC, len); + IFFLAGSTRN2(mr_mode, OFI_MR_SCALABLE, FI_MR_SCALABLE, len); IFFLAGSTRN(mr_mode, FI_MR_LOCAL, len); IFFLAGSTRN(mr_mode, FI_MR_RAW, len); IFFLAGSTRN(mr_mode, FI_MR_VIRT_ADDR, len); diff --git a/util/info.c b/util/info.c index 698b340c38f..2e8937125bd 100644 --- a/util/info.c +++ b/util/info.c @@ -161,7 +161,6 @@ static int str2mode(char *inputstr, uint64_t *value) ORCASE(FI_MSG_PREFIX); ORCASE(FI_ASYNC_IOV); ORCASE(FI_RX_CQ_DATA); - ORCASE(FI_LOCAL_MR); ORCASE(FI_CONTEXT2); fprintf(stderr, "error: Unrecognized mode: %s\n", inputstr); @@ -346,7 +345,7 @@ int main(int argc, char **argv) hints->mode = ~0; hints->domain_attr->mode = ~0; - hints->domain_attr->mr_mode = ~(FI_MR_BASIC | FI_MR_SCALABLE); + hints->domain_attr->mr_mode = ~3; /* deprecated: (FI_MR_BASIC | FI_MR_SCALABLE) */ while ((op = getopt_long(argc, argv, "s:n:P:c:m:t:a:p:d:f:eg:i:lhv", longopts, &option_index)) != -1) {