From fe3291209e509d323a98cb9e7f40eba1d6df95b8 Mon Sep 17 00:00:00 2001 From: Shi Jin Date: Thu, 14 Dec 2023 02:49:28 +0000 Subject: [PATCH] prov/efa: Don't do handshake for local read Currently, we always trigger a handshake to check the interoperatability on two sides for rdma read capabilities, before determining the protocol to use. However, if the read is from the self peer, we don't need such handshake and just need to check the rdma capability for local ep. Signed-off-by: Shi Jin --- prov/efa/src/rdm/efa_rdm_rma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prov/efa/src/rdm/efa_rdm_rma.c b/prov/efa/src/rdm/efa_rdm_rma.c index d10793e5c47..b2e4bcd68b8 100644 --- a/prov/efa/src/rdm/efa_rdm_rma.c +++ b/prov/efa/src/rdm/efa_rdm_rma.c @@ -173,8 +173,10 @@ ssize_t efa_rdm_rma_readmsg(struct fid_ep *ep, const struct fi_msg_rma *msg, uin /* * A handshake is required to choose the correct protocol (whether to use device read). + * For local read (read from self ep), such handshake is not needed because we only + * need to check the local ep's capabilities. */ - if (!(peer->flags & EFA_RDM_PEER_HANDSHAKE_RECEIVED)) { + if (!(peer->is_self) && !(peer->flags & EFA_RDM_PEER_HANDSHAKE_RECEIVED)) { err = efa_rdm_ep_trigger_handshake(efa_rdm_ep, txe->addr); err = err ? err : -FI_EAGAIN; goto out;