Skip to content

Commit

Permalink
[v1.21.x]prov/efa: rename p2p_available to mr_p2p_available
Browse files Browse the repository at this point in the history
Rename to mr_p2p_available to indicate that we check the mr is not NULL.

Signed-off-by: Jessie Yang <[email protected]>
(cherry picked from commit 677bdeb)
  • Loading branch information
jiaxiyan committed Sep 18, 2024
1 parent f4de2ed commit 78c8f86
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions prov/efa/src/rdm/efa_rdm_pke_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ssize_t efa_rdm_pke_init_payload_from_ope(struct efa_rdm_pke *pke,
size_t data_size)
{
int tx_iov_index, ret;
bool p2p_available;
bool mr_p2p_available;
bool use_inline_buf;
size_t tx_iov_offset, copied;
struct efa_mr *iov_mr;
Expand All @@ -65,14 +65,14 @@ ssize_t efa_rdm_pke_init_payload_from_ope(struct efa_rdm_pke *pke,
assert(tx_iov_index < ope->iov_count);
assert(tx_iov_offset < ope->iov[tx_iov_index].iov_len);
iov_mr = ope->desc[tx_iov_index];
p2p_available = false;
mr_p2p_available = false;
use_inline_buf = false;

if (iov_mr) {
ret = efa_rdm_ep_use_p2p(pke->ep, iov_mr);
if (ret < 0)
return ret;
p2p_available = ret;
mr_p2p_available = ret;
} else if (!efa_mr_is_hmem(iov_mr) &&
payload_offset + data_size <= efa_rdm_ep_domain(pke->ep)->device->efa_attr.inline_buf_size) {
use_inline_buf = true;
Expand All @@ -88,7 +88,7 @@ ssize_t efa_rdm_pke_init_payload_from_ope(struct efa_rdm_pke *pke,
* a copy from the user buffer to the internal bounce buffer is needed.
*/
if (tx_iov_offset + data_size <= ope->iov[tx_iov_index].iov_len &&
(use_inline_buf || (p2p_available && !(ope->fi_flags & FI_INJECT)))) {
(use_inline_buf || (mr_p2p_available && !(ope->fi_flags & FI_INJECT)))) {
pke->payload = (char *)ope->iov[tx_iov_index].iov_base + tx_iov_offset;
pke->payload_size = data_size;
pke->payload_mr = ope->desc[tx_iov_index];
Expand Down Expand Up @@ -263,7 +263,7 @@ int efa_rdm_pke_copy_payload_to_cuda(struct efa_rdm_pke *pke,
struct efa_mr *desc;
struct efa_rdm_ep *ep;
size_t segment_offset;
bool p2p_available, local_read_available, gdrcopy_available, cuda_memcpy_available;
bool mr_p2p_available, local_read_available, gdrcopy_available, cuda_memcpy_available;
int ret, err;

desc = rxe->desc[0];
Expand All @@ -278,8 +278,8 @@ int efa_rdm_pke_copy_payload_to_cuda(struct efa_rdm_pke *pke,

segment_offset = efa_rdm_pke_get_segment_offset(pke),

p2p_available = ret;
local_read_available = p2p_available && efa_rdm_ep_support_rdma_read(ep);
mr_p2p_available = ret;
local_read_available = mr_p2p_available && efa_rdm_ep_support_rdma_read(ep);
cuda_memcpy_available = ep->cuda_api_permitted;
gdrcopy_available = desc->peer.flags & OFI_HMEM_DATA_DEV_REG_HANDLE;

Expand Down

0 comments on commit 78c8f86

Please sign in to comment.