Skip to content

Commit cd02154

Browse files
committed
prov/efa: Make efa_hmem_info a global variable
Currently efa_hmem_info is part of efa_domain and created for every efa domain. hmem_info init involves several operations like device memory allocation / free, and trial ibv reg mr, which is expensive and can potentially cause more memory usage. Make efa_hmem_info a global variable and call it only once per process. Signed-off-by: Jessie Yang <[email protected]>
1 parent 331b425 commit cd02154

16 files changed

+67
-145
lines changed

prov/efa/src/efa_domain.c

-7
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,6 @@ int efa_domain_open(struct fid_fabric *fabric_fid, struct fi_info *info,
297297
goto err_free;
298298
}
299299

300-
err = efa_domain_hmem_info_init_all(efa_domain);
301-
if (err) {
302-
ret = err;
303-
EFA_WARN(FI_LOG_DOMAIN, "Failed to check hmem support status. err: %d\n", ret);
304-
goto err_free;
305-
}
306-
307300
dlist_insert_tail(&efa_domain->list_entry, &g_efa_domain_list);
308301
return 0;
309302

prov/efa/src/efa_domain.h

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ struct efa_domain {
2222
struct ofi_mr_cache *cache;
2323
struct efa_qp **qp_table;
2424
size_t qp_table_sz_m1;
25-
struct efa_hmem_info hmem_info[OFI_HMEM_MAX];
2625
size_t mtu_size;
2726
size_t addrlen;
2827
bool mr_local;

prov/efa/src/efa_hmem.c

+26-34
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
#include "efa_hmem.h"
66
#include "rdm/efa_rdm_pkt_type.h"
77

8+
struct efa_hmem_info g_efa_hmem_info[OFI_HMEM_MAX];
9+
810
#if HAVE_CUDA || HAVE_NEURON
9-
static size_t efa_max_eager_msg_size_with_largest_header(struct efa_domain *efa_domain) {
11+
static size_t efa_max_eager_msg_size_with_largest_header() {
1012
int mtu_size;
1113

12-
mtu_size = efa_domain->device->rdm_info->ep_attr->max_msg_size;
14+
mtu_size = g_device_list[0].rdm_info->ep_attr->max_msg_size;
1315

1416
return mtu_size - efa_rdm_pkt_type_get_max_hdr_size();
1517
}
1618
#else
17-
static size_t efa_max_eager_msg_size_with_largest_header(struct efa_domain *efa_domain) {
19+
static size_t efa_max_eager_msg_size_with_largest_header() {
1820
return 0;
1921
}
2022
#endif
@@ -23,14 +25,13 @@ static size_t efa_max_eager_msg_size_with_largest_header(struct efa_domain *efa_
2325
* @brief Initialize the various protocol thresholds tracked in efa_hmem_info
2426
* according to the given FI_HMEM interface.
2527
*
26-
* @param[in,out] efa_domain Pointer to struct efa_domain
2728
* @param[in] iface The FI_HMEM interface to initialize
2829
*
2930
* @return 0
3031
*/
31-
static int efa_domain_hmem_info_init_protocol_thresholds(struct efa_domain *efa_domain, enum fi_hmem_iface iface)
32+
static int efa_domain_hmem_info_init_protocol_thresholds(enum fi_hmem_iface iface)
3233
{
33-
struct efa_hmem_info *info = &efa_domain->hmem_info[iface];
34+
struct efa_hmem_info *info = g_efa_hmem_info[iface];
3435
size_t tmp_value;
3536

3637
/* Fall back to FI_HMEM_SYSTEM initialization logic when p2p is
@@ -53,8 +54,8 @@ static int efa_domain_hmem_info_init_protocol_thresholds(struct efa_domain *efa_
5354
case FI_HMEM_CUDA:
5455
info->runt_size = EFA_DEFAULT_RUNT_SIZE;
5556
info->max_medium_msg_size = 0;
56-
info->min_read_msg_size = efa_max_eager_msg_size_with_largest_header(efa_domain) + 1;
57-
info->min_read_write_size = efa_max_eager_msg_size_with_largest_header(efa_domain) + 1;
57+
info->min_read_msg_size = efa_max_eager_msg_size_with_largest_header() + 1;
58+
info->min_read_write_size = efa_max_eager_msg_size_with_largest_header() + 1;
5859
fi_param_get_size_t(&efa_prov, "runt_size", &info->runt_size);
5960
fi_param_get_size_t(&efa_prov, "inter_min_read_message_size", &info->min_read_msg_size);
6061
fi_param_get_size_t(&efa_prov, "inter_min_read_write_size", &info->min_read_write_size);
@@ -68,8 +69,8 @@ static int efa_domain_hmem_info_init_protocol_thresholds(struct efa_domain *efa_
6869
case FI_HMEM_NEURON:
6970
info->runt_size = EFA_NEURON_RUNT_SIZE;
7071
info->max_medium_msg_size = 0;
71-
info->min_read_msg_size = efa_max_eager_msg_size_with_largest_header(efa_domain) + 1;
72-
info->min_read_write_size = efa_max_eager_msg_size_with_largest_header(efa_domain) + 1;
72+
info->min_read_msg_size = efa_max_eager_msg_size_with_largest_header() + 1;
73+
info->min_read_write_size = efa_max_eager_msg_size_with_largest_header() + 1;
7374
fi_param_get_size_t(&efa_prov, "runt_size", &info->runt_size);
7475
fi_param_get_size_t(&efa_prov, "inter_min_read_message_size", &info->min_read_msg_size);
7576
fi_param_get_size_t(&efa_prov, "inter_min_read_write_size", &info->min_read_write_size);
@@ -105,7 +106,7 @@ static int efa_domain_hmem_info_init_protocol_thresholds(struct efa_domain *efa_
105106
return 0;
106107
}
107108

108-
static inline void efa_domain_hmem_info_check_p2p_support_cuda(struct efa_hmem_info *info) {
109+
static inline void efa_hmem_info_check_p2p_support_cuda(struct efa_hmem_info *info) {
109110
#if HAVE_CUDA
110111
cudaError_t cuda_ret;
111112
void *ptr = NULL;
@@ -168,7 +169,7 @@ static inline void efa_domain_hmem_info_check_p2p_support_cuda(struct efa_hmem_i
168169
return;
169170
}
170171

171-
static inline void efa_domain_hmem_info_check_p2p_support_neuron(struct efa_hmem_info *info) {
172+
static inline void efa_hmem_info_check_p2p_support_neuron(struct efa_hmem_info *info) {
172173
#if HAVE_NEURON
173174
struct ibv_mr *ibv_mr = NULL;
174175
int ibv_access = IBV_ACCESS_LOCAL_WRITE;
@@ -239,13 +240,12 @@ static inline void efa_domain_hmem_info_check_p2p_support_neuron(struct efa_hmem
239240
/**
240241
* @brief Initialize the efa_hmem_info state for iface
241242
*
242-
* @param[in,out] efa_domain Pointer to struct efa_domain
243243
* @param[in] iface HMEM interface
244244
*/
245245
static void
246-
efa_domain_hmem_info_init_iface(struct efa_domain *efa_domain, enum fi_hmem_iface iface)
246+
efa_hmem_info_init_iface(enum fi_hmem_iface iface)
247247
{
248-
struct efa_hmem_info *info = &efa_domain->hmem_info[iface];
248+
struct efa_hmem_info *info = g_efa_hmem_info[iface];
249249

250250
if (!ofi_hmem_is_initialized(iface)) {
251251
EFA_INFO(FI_LOG_DOMAIN, "%s is not initialized\n",
@@ -262,17 +262,16 @@ efa_domain_hmem_info_init_iface(struct efa_domain *efa_domain, enum fi_hmem_ifac
262262
}
263263

264264
info->initialized = true;
265-
info->p2p_disabled_by_user = (iface == FI_HMEM_SYSTEM) ? false : ofi_hmem_p2p_disabled();
266265

267266
if (iface == FI_HMEM_SYNAPSEAI || iface == FI_HMEM_SYSTEM) {
268267
info->p2p_supported_by_device = true;
269-
} else if (info->p2p_disabled_by_user) {
268+
} else if (ofi_hmem_p2p_disabled()) {
270269
info->p2p_supported_by_device = false;
271270
} else {
272271
if (iface == FI_HMEM_CUDA)
273-
efa_domain_hmem_info_check_p2p_support_cuda(info);
272+
efa_hmem_info_check_p2p_support_cuda(info);
274273
if (iface == FI_HMEM_NEURON)
275-
efa_domain_hmem_info_check_p2p_support_neuron(info);
274+
efa_hmem_info_check_p2p_support_neuron(info);
276275
if (!info->p2p_supported_by_device)
277276
EFA_INFO(FI_LOG_DOMAIN, "%s P2P support is not available.\n", fi_tostr(&iface, FI_TYPE_HMEM_IFACE));
278277
}
@@ -283,20 +282,18 @@ efa_domain_hmem_info_init_iface(struct efa_domain *efa_domain, enum fi_hmem_ifac
283282
* memory, therefore p2p is not required.
284283
*/
285284
if (iface == FI_HMEM_CUDA &&
286-
FI_VERSION_GE(efa_domain->util_domain.fabric->fabric_fid.api_version, FI_VERSION(1, 18)))
285+
FI_VERSION_GE(g_device_list[0].rdm_info->fabric_attr.api_version, FI_VERSION(1, 18)))
287286
info->p2p_required_by_impl = !hmem_ops[iface].initialized;
288287
if (iface == FI_HMEM_SYSTEM)
289288
info->p2p_required_by_impl = false;
290289

291-
efa_domain_hmem_info_init_protocol_thresholds(efa_domain, iface);
290+
efa_domain_hmem_info_init_protocol_thresholds(iface);
292291
}
293292

294293
/**
295294
* @brief Validate an FI_OPT_FI_HMEM_P2P (FI_OPT_ENDPOINT) option for a
296295
* specified HMEM interface.
297-
* Also update hmem_info[iface]->p2p_disabled_by_user accordingly.
298296
*
299-
* @param[in,out] domain The efa_domain struct which contains an efa_hmem_info array
300297
* @param[in] iface The fi_hmem_iface enum of the FI_HMEM interface to validate
301298
* @param[in] p2p_opt The P2P option to validate
302299
*
@@ -305,9 +302,9 @@ efa_domain_hmem_info_init_iface(struct efa_domain *efa_domain, enum fi_hmem_ifac
305302
* -FI_ENODATA if the given HMEM interface was not initialized
306303
* -FI_EINVAL if p2p_opt is not a valid FI_OPT_FI_HMEM_P2P option
307304
*/
308-
int efa_domain_hmem_validate_p2p_opt(struct efa_domain *efa_domain, enum fi_hmem_iface iface, int p2p_opt)
305+
int efa_domain_hmem_validate_p2p_opt(enum fi_hmem_iface iface, int p2p_opt)
309306
{
310-
struct efa_hmem_info *info = &efa_domain->hmem_info[iface];
307+
struct efa_hmem_info *info = g_efa_hmem_info[iface];
311308

312309
if (OFI_UNLIKELY(!info->initialized))
313310
return -FI_ENODATA;
@@ -317,7 +314,6 @@ int efa_domain_hmem_validate_p2p_opt(struct efa_domain *efa_domain, enum fi_hmem
317314
if (OFI_UNLIKELY(ofi_hmem_p2p_disabled()) || !info->p2p_supported_by_device)
318315
return -FI_EOPNOTSUPP;
319316

320-
info->p2p_disabled_by_user = false;
321317
return 0;
322318
/*
323319
* According to fi_setopt() document:
@@ -334,43 +330,39 @@ int efa_domain_hmem_validate_p2p_opt(struct efa_domain *efa_domain, enum fi_hmem
334330
if (OFI_UNLIKELY(ofi_hmem_p2p_disabled()))
335331
return -FI_EOPNOTSUPP;
336332

337-
info->p2p_disabled_by_user = false;
338333
return 0;
339334

340335
case FI_HMEM_P2P_DISABLED:
341336
if (info->p2p_required_by_impl)
342337
return -FI_EOPNOTSUPP;
343338

344-
info->p2p_disabled_by_user = true;
345339
return 0;
346340
}
347341

348342
return -FI_EINVAL;
349343
}
350344

351345
/**
352-
* @brief Initialize the hmem_info structs for
346+
* @brief Initialize the g_efa_hmem_info structs for
353347
* all of the HMEM devices. The device hmem_info
354348
* struct will be used to determine which efa transfer
355349
* protocol should be selected.
356350
*
357-
* @param[in,out] efa_domain Pointer to struct efa_domain to be initialized
358-
*
359351
* @return 0 on success
360352
* negative libfabric error code on an unexpected error
361353
*/
362-
int efa_domain_hmem_info_init_all(struct efa_domain *efa_domain)
354+
int efa_hmem_info_initialize()
363355
{
364356
int ret = 0, i = 0;
365357

366358
if(g_device_cnt <= 0) {
367359
return -FI_ENODEV;
368360
}
369361

370-
memset(efa_domain->hmem_info, 0, OFI_HMEM_MAX * sizeof(struct efa_hmem_info));
362+
memset(g_efa_hmem_info, 0, OFI_HMEM_MAX * sizeof(struct efa_hmem_info));
371363

372364
EFA_HMEM_IFACE_FOREACH(i) {
373-
efa_domain_hmem_info_init_iface(efa_domain, efa_hmem_ifaces[i]);
365+
efa_hmem_info_init_iface(efa_hmem_ifaces[i]);
374366
}
375367

376368
return ret;

prov/efa/src/efa_hmem.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ static const enum fi_hmem_iface efa_hmem_ifaces[] = {
2323

2424
struct efa_hmem_info {
2525
bool initialized; /* do we support it at all */
26-
bool p2p_disabled_by_user; /* Did the user disable p2p via FI_OPT_FI_HMEM_P2P? */
2726
bool p2p_required_by_impl; /* Is p2p required for this interface? */
2827
bool p2p_supported_by_device; /* do we support p2p with this device */
2928

@@ -33,10 +32,12 @@ struct efa_hmem_info {
3332
size_t min_read_write_size;
3433
};
3534

35+
extern struct efa_hmem_info g_efa_hmem_info[OFI_HMEM_MAX];
36+
3637
struct efa_domain;
3738

38-
int efa_domain_hmem_validate_p2p_opt(struct efa_domain *efa_domain, enum fi_hmem_iface iface, int p2p_opt);
39-
int efa_domain_hmem_info_init_all(struct efa_domain *efa_domain);
39+
int efa_domain_hmem_validate_p2p_opt(enum fi_hmem_iface iface, int p2p_opt);
40+
int efa_hmem_info_initialize();
4041

4142
/**
4243
* @brief Copy data from a hmem device to a system buffer

prov/efa/src/efa_mr.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static int efa_mr_hmem_setup(struct efa_mr *efa_mr,
192192
}
193193

194194
if (efa_mr->domain->util_domain.info_domain_caps & FI_HMEM) {
195-
if (efa_mr->domain->hmem_info[attr->iface].initialized) {
195+
if (g_efa_hmem_info[attr->iface].initialized) {
196196
efa_mr->peer.iface = attr->iface;
197197
} else {
198198
EFA_WARN(FI_LOG_MR,
@@ -813,7 +813,7 @@ static int efa_mr_reg_impl(struct efa_mr *efa_mr, uint64_t flags, const void *at
813813
* For FI_HMEM_CUDA iface when p2p is unavailable, skip ibv_reg_mr() and
814814
* generate proprietary mr_fid key.
815815
*/
816-
if (mr_attr.iface == FI_HMEM_CUDA && !efa_mr->domain->hmem_info[FI_HMEM_CUDA].p2p_supported_by_device) {
816+
if (mr_attr.iface == FI_HMEM_CUDA && !g_efa_hmem_info[FI_HMEM_CUDA].p2p_supported_by_device) {
817817
efa_mr->mr_fid.key = efa_mr_cuda_non_p2p_keygen();
818818
} else {
819819
efa_mr->ibv_mr = efa_mr_reg_ibv_mr(efa_mr, &mr_attr, fi_ibv_access, flags);

prov/efa/src/efa_prov.c

+4
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ EFA_INI
164164
if (err)
165165
goto err_free;
166166

167+
err = efa_hmem_info_initialize();
168+
if (err)
169+
goto err_free;
170+
167171
dlist_init(&g_efa_domain_list);
168172

169173
return &efa_prov;

prov/efa/src/rdm/efa_rdm_ep.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ int efa_rdm_ep_use_p2p(struct efa_rdm_ep *efa_rdm_ep, struct efa_mr *efa_mr)
307307
if (!efa_mr || efa_mr->peer.iface == FI_HMEM_SYSTEM)
308308
return 1;
309309

310-
if (efa_rdm_ep_domain(efa_rdm_ep)->hmem_info[efa_mr->peer.iface].p2p_supported_by_device)
310+
if (g_efa_hmem_info[efa_mr->peer.iface].p2p_supported_by_device)
311311
return (efa_rdm_ep->hmem_p2p_opt != FI_HMEM_P2P_DISABLED);
312312

313313
if (efa_rdm_ep->hmem_p2p_opt == FI_HMEM_P2P_REQUIRED) {

prov/efa/src/rdm/efa_rdm_ep_fiops.c

+8-7
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,10 @@ void efa_rdm_ep_set_use_zcpy_rx(struct efa_rdm_ep *ep)
483483

484484
/* Zero-copy receive requires P2P support. Disable it if any initialized HMEM iface does not support P2P. */
485485
for (iface = FI_HMEM_SYSTEM; iface < OFI_HMEM_MAX; ++iface) {
486-
hmem_info = &ep->base_ep.domain->hmem_info[iface];
486+
hmem_info = g_efa_hmem_info[iface];
487487
if (hmem_info->initialized &&
488-
!hmem_info->p2p_disabled_by_user &&
488+
!ofi_hmem_p2p_disabled() &&
489+
ep->hmem_p2p_opt != FI_HMEM_P2P_DISABLED &&
489490
!hmem_info->p2p_supported_by_device) {
490491
EFA_INFO(FI_LOG_EP_CTRL,
491492
"%s does not support P2P, zero-copy receive "
@@ -615,9 +616,9 @@ int efa_rdm_ep_open(struct fid_domain *domain, struct fi_info *info,
615616
* tighter requirements for the default p2p opt
616617
*/
617618
EFA_HMEM_IFACE_FOREACH_NON_SYSTEM(i) {
618-
if (efa_rdm_ep->base_ep.domain->hmem_info[efa_hmem_ifaces[i]].initialized &&
619-
efa_rdm_ep->base_ep.domain->hmem_info[efa_hmem_ifaces[i]].p2p_supported_by_device) {
620-
efa_rdm_ep->hmem_p2p_opt = efa_rdm_ep->base_ep.domain->hmem_info[efa_hmem_ifaces[i]].p2p_required_by_impl
619+
if (g_efa_hmem_info[efa_hmem_ifaces[i]].initialized &&
620+
g_efa_hmem_info[efa_hmem_ifaces[i]].p2p_supported_by_device) {
621+
efa_rdm_ep->hmem_p2p_opt = g_efa_hmem_info[efa_hmem_ifaces[i]].p2p_required_by_impl
621622
? FI_HMEM_P2P_REQUIRED
622623
: FI_HMEM_P2P_PREFERRED;
623624
break;
@@ -1413,7 +1414,7 @@ static int efa_rdm_ep_set_fi_hmem_p2p_opt(struct efa_rdm_ep *efa_rdm_ep, int opt
14131414
* tighter restrictions on valid p2p options.
14141415
*/
14151416
EFA_HMEM_IFACE_FOREACH_NON_SYSTEM(i) {
1416-
err = efa_domain_hmem_validate_p2p_opt(efa_rdm_ep_domain(efa_rdm_ep), efa_hmem_ifaces[i], opt);
1417+
err = efa_domain_hmem_validate_p2p_opt(efa_hmem_ifaces[i], opt);
14171418
if (err == -FI_ENODATA)
14181419
continue;
14191420

@@ -1449,7 +1450,7 @@ static int efa_rdm_ep_set_cuda_api_permitted(struct efa_rdm_ep *ep, bool cuda_ap
14491450
/* CUDA memory can be supported by using either peer to peer or CUDA API. If neither is
14501451
* available, we cannot support CUDA memory
14511452
*/
1452-
if (!efa_rdm_ep_domain(ep)->hmem_info[FI_HMEM_CUDA].p2p_supported_by_device)
1453+
if (!g_efa_hmem_info[FI_HMEM_CUDA].p2p_supported_by_device)
14531454
return -FI_EOPNOTSUPP;
14541455

14551456
ep->cuda_api_permitted = false;

prov/efa/src/rdm/efa_rdm_msg.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,13 @@ int efa_rdm_msg_select_rtm(struct efa_rdm_ep *efa_rdm_ep, struct efa_rdm_ope *tx
6060
int tagged;
6161
int eager_rtm, medium_rtm, longcts_rtm, readbase_rtm, iface;
6262
size_t eager_rtm_max_data_size;
63-
struct efa_hmem_info *hmem_info;
6463
bool delivery_complete_requested;
6564

6665
assert(txe->op == ofi_op_msg || txe->op == ofi_op_tagged);
6766
tagged = (txe->op == ofi_op_tagged);
6867
assert(tagged == 0 || tagged == 1);
6968

7069
iface = txe->desc[0] ? ((struct efa_mr*) txe->desc[0])->peer.iface : FI_HMEM_SYSTEM;
71-
hmem_info = efa_rdm_ep_domain(efa_rdm_ep)->hmem_info;
7270

7371
if (txe->fi_flags & FI_INJECT || efa_both_support_zero_hdr_data_transfer(efa_rdm_ep, txe->peer))
7472
delivery_complete_requested = false;
@@ -89,15 +87,15 @@ int efa_rdm_msg_select_rtm(struct efa_rdm_ep *efa_rdm_ep, struct efa_rdm_ope *tx
8987
readbase_rtm = efa_rdm_peer_select_readbase_rtm(txe->peer, efa_rdm_ep, txe);
9088

9189
if (use_p2p &&
92-
txe->total_len >= hmem_info[iface].min_read_msg_size &&
90+
txe->total_len >= g_efa_hmem_info[iface].min_read_msg_size &&
9391
efa_rdm_interop_rdma_read(efa_rdm_ep, txe->peer) &&
9492
(txe->desc[0] || efa_is_cache_available(efa_rdm_ep_domain(efa_rdm_ep))))
9593
return readbase_rtm;
9694

9795
if (txe->total_len <= eager_rtm_max_data_size)
9896
return eager_rtm;
9997

100-
if (txe->total_len <= hmem_info[iface].max_medium_msg_size)
98+
if (txe->total_len <= g_efa_hmem_info[iface].max_medium_msg_size)
10199
return medium_rtm;
102100

103101
return longcts_rtm;

prov/efa/src/rdm/efa_rdm_peer.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -330,18 +330,16 @@ void efa_rdm_peer_proc_pending_items_in_robuf(struct efa_rdm_peer *peer, struct
330330
size_t efa_rdm_peer_get_runt_size(struct efa_rdm_peer *peer,
331331
struct efa_rdm_ep *ep, struct efa_rdm_ope *ope)
332332
{
333-
struct efa_hmem_info *hmem_info;
334333
size_t runt_size;
335334
size_t memory_alignment;
336335
int iface;
337336

338-
hmem_info = efa_rdm_ep_domain(ep)->hmem_info;
339337
iface = ope->desc[0] ? ((struct efa_mr*) ope->desc[0])->peer.iface : FI_HMEM_SYSTEM;
340338

341-
if (hmem_info[iface].runt_size < peer->num_runt_bytes_in_flight)
339+
if (g_efa_hmem_info[iface].runt_size < peer->num_runt_bytes_in_flight)
342340
return 0;
343341

344-
runt_size = MIN(hmem_info[iface].runt_size - peer->num_runt_bytes_in_flight, ope->total_len);
342+
runt_size = MIN(g_efa_hmem_info[iface].runt_size - peer->num_runt_bytes_in_flight, ope->total_len);
345343
memory_alignment = efa_rdm_ep_get_memory_alignment(ep, iface);
346344
/*
347345
* runt size must be aligned because:

prov/efa/src/rdm/efa_rdm_rma.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ ssize_t efa_rdm_rma_post_write(struct efa_rdm_ep *ep, struct efa_rdm_ope *txe)
400400
iface = txe->desc[0] ? ((struct efa_mr*) txe->desc[0])->peer.iface : FI_HMEM_SYSTEM;
401401

402402
if (use_p2p &&
403-
txe->total_len >= efa_rdm_ep_domain(ep)->hmem_info[iface].min_read_write_size &&
403+
txe->total_len >= g_efa_hmem_info[iface].min_read_write_size &&
404404
efa_rdm_interop_rdma_read(ep, txe->peer) &&
405405
(txe->desc[0] || efa_is_cache_available(efa_rdm_ep_domain(ep)))) {
406406
err = efa_rdm_ope_post_send(txe, EFA_RDM_LONGREAD_RTW_PKT);

0 commit comments

Comments
 (0)