Skip to content

Commit c3e22c6

Browse files
committed
btl/ofi: Remove cache hack for EFA
This was an optimization around a bug in the EFA provider. The EFA provider shouldn't be caching explicit registrations anyway, so avoiding the double cache is silly (and breaks when EFA fixes the explicit registration cache bug). Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent d9cccba commit c3e22c6

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

opal/mca/btl/ofi/btl_ofi.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
* Copyright (c) 2015-2018 Los Alamos National Security, LLC. All rights
1414
* reserved.
1515
* Copyright (c) 2018-2019 Intel, Inc. All rights reserved.
16-
* Copyright (c) 2020 Amazon.com, Inc. or its affiliates.
17-
* All Rights reserved.
16+
* Copyright (c) 2020-2025 Amazon.com, Inc. or its affiliates. All Rights reserved.
1817
* Copyright (c) 2022 Triad National Security, LLC. All rights
1918
* reserved.
2019
* $COPYRIGHT$
@@ -140,9 +139,6 @@ struct mca_btl_ofi_module_t {
140139

141140
/** registration cache */
142141
mca_rcache_base_module_t *rcache;
143-
/* If the underlying OFI provider has its own cache, we want to bypass
144-
* rcache registration */
145-
bool bypass_cache;
146142
};
147143
typedef struct mca_btl_ofi_module_t mca_btl_ofi_module_t;
148144

opal/mca/btl/ofi/btl_ofi_component.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* reserved.
1515
* Copyright (c) 2018-2019 Intel, Inc. All rights reserved.
1616
*
17-
* Copyright (c) 2018-2021 Amazon.com, Inc. or its affiliates. All Rights reserved.
17+
* Copyright (c) 2018-2025 Amazon.com, Inc. or its affiliates. All Rights reserved.
1818
* Copyright (c) 2020-2023 Triad National Security, LLC. All rights
1919
* reserved.
2020
* $COPYRIGHT$
@@ -657,7 +657,6 @@ static int mca_btl_ofi_init_device(struct fi_info *info)
657657
module->outstanding_rdma = 0;
658658
module->use_virt_addr = false;
659659
module->use_fi_mr_bind = false;
660-
module->bypass_cache = false;
661660

662661
#if defined(FI_HMEM)
663662
if (ofi_info->caps & FI_HMEM) {
@@ -674,13 +673,6 @@ static int mca_btl_ofi_init_device(struct fi_info *info)
674673
module->use_fi_mr_bind = true;
675674
}
676675

677-
/* Currently there is no API to query whether the libfabric provider
678-
* uses an underlying registration cache. For now, just check for known
679-
* providers that use registration caching. */
680-
if (!strncasecmp(info->fabric_attr->prov_name, "efa", 3)) {
681-
module->bypass_cache = true;
682-
}
683-
684676
/* create endpoint list */
685677
OBJ_CONSTRUCT(&module->endpoints, opal_list_t);
686678
OBJ_CONSTRUCT(&module->module_lock, opal_mutex_t);

opal/mca/btl/ofi/btl_ofi_module.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* reserved.
1515
* Copyright (c) 2018 Intel, Inc, All rights reserved
1616
*
17-
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
17+
* Copyright (c) 2018-2025 Amazon.com, Inc. or its affiliates. All Rights reserved.
1818
* Copyright (c) 2020 Google, LLC. All rights reserved.
1919
* Copyright (c) 2022-2024 Triad National Security, LLC. All rights
2020
* reserved.
@@ -198,9 +198,6 @@ mca_btl_ofi_register_mem(struct mca_btl_base_module_t *btl,
198198
int access_flags = flags & MCA_BTL_REG_FLAG_ACCESS_ANY;
199199
int rc;
200200
uint32_t cache_flags = 0;
201-
if (ofi_module->bypass_cache) {
202-
cache_flags |= MCA_RCACHE_FLAGS_CACHE_BYPASS;
203-
}
204201

205202
rc = ofi_module->rcache->rcache_register(ofi_module->rcache, base, size, cache_flags, access_flags,
206203
(mca_rcache_base_registration_t **) &reg);

0 commit comments

Comments
 (0)