Skip to content

Commit

Permalink
Merge pull request #6340 from rwespetal/efa-hmem-fix-for-1.11.x
Browse files Browse the repository at this point in the history
[v1.11.x] prov/efa: Fix FI_HMEM capability claims
  • Loading branch information
rwespetal authored Oct 10, 2020
2 parents acc4131 + 32e1313 commit 2833076
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions prov/efa/src/rxr/rxr_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,16 @@ static int rxr_info_to_rxr(uint32_t version, const struct fi_info *core_info,
info->domain_attr->cq_cnt = core_info->domain_attr->cq_cnt;
info->domain_attr->mr_key_size = core_info->domain_attr->mr_key_size;

/*
* Do not advertise FI_HMEM capabilities when the core can not support
* it or when the application passes NULL hints (given this is a primary
* cap). The logic for device-specific checks pertaining to HMEM comes
* further along this path.
*/
if ((core_info && !(core_info->caps & FI_HMEM)) || !hints) {
info->caps &= ~FI_HMEM;
}

/*
* Handle user-provided hints and adapt the info object passed back up
* based on EFA-specific constraints.
Expand Down Expand Up @@ -421,6 +431,12 @@ static int rxr_info_to_rxr(uint32_t version, const struct fi_info *core_info,

info->domain_attr->mr_mode |= FI_MR_HMEM;

} else {
/*
* FI_HMEM is a primary capability. Providers should
* only enable it if requested by applications.
*/
info->caps &= ~FI_HMEM;
}
#endif
/*
Expand Down

0 comments on commit 2833076

Please sign in to comment.