Skip to content

Commit

Permalink
prov/efa: Remove peer lookup from efa_rdm_pke_sendv()
Browse files Browse the repository at this point in the history
Now that all handshake requests, and responses use a txe, we can rely on
all send packets having a txe and we no longer need to look up the peer
in the send path.  This is an optimization that will make all EFA sends
faster.

Signed-off-by: Seth Zegelstein <szegel@amazon.com>
  • Loading branch information
a-szegel committed Dec 30, 2023
1 parent 610ae88 commit f7d83de
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions prov/efa/src/rdm/efa_rdm_pke.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,17 +390,18 @@ ssize_t efa_rdm_pke_sendv(struct efa_rdm_pke **pkt_entry_vec,
struct efa_conn *conn;
struct efa_rdm_ep *ep;
struct efa_rdm_pke *pkt_entry;
struct efa_rdm_peer *peer;
struct efa_rdm_ope *txe;
struct ibv_sge sg_list[2]; /* efa device support up to 2 iov */
struct ibv_data_buf inline_data_list[2];
int ret, pkt_idx, iov_cnt;

assert(pkt_entry_cnt);
ep = pkt_entry_vec[0]->ep;
assert(ep);
peer = efa_rdm_ep_get_peer(ep, pkt_entry_vec[0]->addr);
assert(peer);
if (peer->flags & EFA_RDM_PEER_IN_BACKOFF)

txe = pkt_entry_vec[0]->ope;
assert(txe);
if (txe->peer->flags & EFA_RDM_PEER_IN_BACKOFF)
return -FI_EAGAIN;

conn = efa_av_addr_to_conn(ep->base_ep.av, pkt_entry_vec[0]->addr);
Expand All @@ -411,7 +412,7 @@ ssize_t efa_rdm_pke_sendv(struct efa_rdm_pke **pkt_entry_vec,
for (pkt_idx = 0; pkt_idx < pkt_entry_cnt; ++pkt_idx) {
pkt_entry = pkt_entry_vec[pkt_idx];
assert(pkt_entry->pkt_size);
assert(efa_rdm_ep_get_peer(ep, pkt_entry->addr) == peer);
assert(efa_rdm_ep_get_peer(ep, pkt_entry->addr) == txe->peer);

qp->ibv_qp_ex->wr_id = (uintptr_t)pkt_entry;
ibv_wr_send(qp->ibv_qp_ex);
Expand Down

0 comments on commit f7d83de

Please sign in to comment.