From d8102cf983645d2744121947e5d3eed189dd3828 Mon Sep 17 00:00:00 2001 From: Jessie Yang Date: Tue, 17 Sep 2024 16:34:22 -0700 Subject: [PATCH] [v1.21.x]prov/efa: always use p2p for system memory P2P is always available for host memory. Unregistered buffer will be regarded as host memory as EFA provider requires FI_MR_HMEM. Signed-off-by: Jessie Yang (cherry picked from commit b0af713a57821a7c29939049c8b59c4b9ba47b65) --- prov/efa/src/rdm/efa_rdm_ep.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/prov/efa/src/rdm/efa_rdm_ep.h b/prov/efa/src/rdm/efa_rdm_ep.h index 2b52d9ad467..f0fffde249b 100644 --- a/prov/efa/src/rdm/efa_rdm_ep.h +++ b/prov/efa/src/rdm/efa_rdm_ep.h @@ -310,13 +310,11 @@ bool efa_rdm_ep_should_write_rnr_completion(struct efa_rdm_ep *ep) static inline int efa_rdm_ep_use_p2p(struct efa_rdm_ep *efa_rdm_ep, struct efa_mr *efa_mr) { - if (!efa_mr) - return 0; - /* - * always send from host buffers if we have a descriptor + * P2P is always available for host memory (Unregistered buffer will be + * regarded as host memory as EFA provider requires FI_MR_HMEM) */ - if (efa_mr->peer.iface == FI_HMEM_SYSTEM) + if (!efa_mr || efa_mr->peer.iface == FI_HMEM_SYSTEM) return 1; if (efa_rdm_ep_domain(efa_rdm_ep)->hmem_info[efa_mr->peer.iface].p2p_supported_by_device)