Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prov/efa: Remove util_av_fi_addr from efa_conn #10701

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading