Skip to content

Commit

Permalink
prov/efa: Remove util_av_fi_addr from efa_conn
Browse files Browse the repository at this point in the history
71dd1a1 deprecates FI_AV_MAP support for the EFA provider.  With this
deprecation, we no longer need to maintain util_av_fi_addr and fi_addr
in the efa_conn struct b/c they will always be equal.

Signed-off-by: Seth Zegelstein <szegel@amazon.com>
  • Loading branch information
a-szegel committed Jan 14, 2025
1 parent 815a166 commit a93beca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
15 changes: 7 additions & 8 deletions prov/efa/src/efa_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ struct efa_conn *efa_conn_alloc(struct efa_av *av, struct efa_ep_addr *raw_addr,
struct util_av_entry *util_av_entry = NULL;
struct efa_av_entry *efa_av_entry = NULL;
struct efa_conn *conn;
fi_addr_t util_av_fi_addr;
fi_addr_t fi_addr;
int err;

if (flags & FI_SYNC_ERR)
Expand All @@ -456,24 +456,23 @@ struct efa_conn *efa_conn_alloc(struct efa_av *av, struct efa_ep_addr *raw_addr,
return NULL;
}

err = ofi_av_insert_addr(&av->util_av, raw_addr, &util_av_fi_addr);
err = ofi_av_insert_addr(&av->util_av, raw_addr, &fi_addr);
if (err) {
EFA_WARN(FI_LOG_AV, "ofi_av_insert_addr failed! Error message: %s\n",
fi_strerror(err));
return NULL;
}

util_av_entry = ofi_bufpool_get_ibuf(av->util_av.av_entry_pool,
util_av_fi_addr);
fi_addr);
efa_av_entry = (struct efa_av_entry *)util_av_entry->data;
assert(efa_is_same_addr(raw_addr, (struct efa_ep_addr *)efa_av_entry->ep_addr));

conn = &efa_av_entry->conn;
memset(conn, 0, sizeof(*conn));
conn->ep_addr = (struct efa_ep_addr *)efa_av_entry->ep_addr;
assert(av->type == FI_AV_TABLE);
conn->fi_addr = util_av_fi_addr;
conn->util_av_fi_addr = util_av_fi_addr;
conn->fi_addr = fi_addr;

conn->ah = efa_ah_alloc(av, raw_addr->raw);
if (!conn->ah)
Expand Down Expand Up @@ -502,7 +501,7 @@ struct efa_conn *efa_conn_alloc(struct efa_av *av, struct efa_ep_addr *raw_addr,
efa_ah_release(av, conn->ah);

conn->ep_addr = NULL;
err = ofi_av_remove_addr(&av->util_av, util_av_fi_addr);
err = ofi_av_remove_addr(&av->util_av, fi_addr);
if (err)
EFA_WARN(FI_LOG_AV, "While processing previous failure, ofi_av_remove_addr failed! err=%d\n",
err);
Expand Down Expand Up @@ -552,11 +551,11 @@ void efa_conn_release(struct efa_av *av, struct efa_conn *conn)

efa_ah_release(av, conn->ah);

util_av_entry = ofi_bufpool_get_ibuf(av->util_av.av_entry_pool, conn->util_av_fi_addr);
util_av_entry = ofi_bufpool_get_ibuf(av->util_av.av_entry_pool, conn->fi_addr);
assert(util_av_entry);
efa_av_entry = (struct efa_av_entry *)util_av_entry->data;

err = ofi_av_remove_addr(&av->util_av, conn->util_av_fi_addr);
err = ofi_av_remove_addr(&av->util_av, conn->fi_addr);
if (err) {
EFA_WARN(FI_LOG_AV, "ofi_av_remove_addr failed! err=%d\n", err);
}
Expand Down
1 change: 0 additions & 1 deletion prov/efa/src/efa_av.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct efa_conn {
struct efa_ah *ah;
struct efa_ep_addr *ep_addr;
fi_addr_t fi_addr;
fi_addr_t util_av_fi_addr;
struct efa_rdm_peer rdm_peer;
};

Expand Down

0 comments on commit a93beca

Please sign in to comment.