Skip to content

Commit

Permalink
prov/efa: Deprecate FI_AV_MAP
Browse files Browse the repository at this point in the history
FI_AV_MAP is deprecated in Libfabric 2.x. EFA provider was overriding AV
type to FI_AV_TABLE even before this change. This change removes all
references to FI_AV_MAP in the EFA provider. It will print a warning and
switch to FI_AV_TABLE if the application requests FI_AV_MAP.

Signed-off-by: Sai Sunku <sunkusa@amazon.com>
  • Loading branch information
sunkuamzn committed Jan 13, 2025
1 parent e6b3dc0 commit 71dd1a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 3 additions & 1 deletion man/fi_efa.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ The following features are supported:
message size of the MTU of the underlying hardware (approximately 8 KiB).

*Address vectors*
: The provider supports *FI_AV_TABLE* and *FI_AV_MAP* address vector types.
: The provider supports *FI_AV_TABLE*. *FI_AV_MAP* was deprecated in Libfabric 2.x.
Applications can still use *FI_AV_MAP* to create an address vector. But the EFA
provider implementation will print a warning and switch to *FI_AV_TABLE*.
*FI_EVENT* is unsupported.

*Completion events*
Expand Down
16 changes: 8 additions & 8 deletions prov/efa/src/efa_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ struct efa_conn *efa_av_addr_to_conn(struct efa_av *av, fi_addr_t fi_addr)
if (OFI_UNLIKELY(fi_addr == FI_ADDR_UNSPEC || fi_addr == FI_ADDR_NOTAVAIL))
return NULL;

if (av->type == FI_AV_MAP) {
return (struct efa_conn *)fi_addr;
}

assert(av->type == FI_AV_TABLE);
util_av_entry = ofi_bufpool_get_ibuf(av->util_av.av_entry_pool, fi_addr);
if (!util_av_entry)
Expand Down Expand Up @@ -475,8 +471,8 @@ struct efa_conn *efa_conn_alloc(struct efa_av *av, struct efa_ep_addr *raw_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_MAP || av->type == FI_AV_TABLE);
conn->fi_addr = (av->type == FI_AV_MAP) ? (uintptr_t)(void *)conn : util_av_fi_addr;
assert(av->type == FI_AV_TABLE);
conn->fi_addr = util_av_fi_addr;
conn->util_av_fi_addr = util_av_fi_addr;

conn->ah = efa_ah_alloc(av, raw_addr->raw);
Expand Down Expand Up @@ -691,7 +687,7 @@ static int efa_av_lookup(struct fid_av *av_fid, fi_addr_t fi_addr,
struct efa_av *av = container_of(av_fid, struct efa_av, util_av.av_fid);
struct efa_conn *conn = NULL;

if (av->type != FI_AV_MAP && av->type != FI_AV_TABLE)
if (av->type != FI_AV_TABLE)
return -FI_EINVAL;

if (fi_addr == FI_ADDR_NOTAVAIL)
Expand Down Expand Up @@ -744,7 +740,7 @@ static int efa_av_remove(struct fid_av *av_fid, fi_addr_t *fi_addr,
return -FI_EINVAL;

av = container_of(av_fid, struct efa_av, util_av.av_fid);
if (av->type != FI_AV_MAP && av->type != FI_AV_TABLE)
if (av->type != FI_AV_TABLE)
return -FI_EINVAL;

ofi_mutex_lock(&av->util_av.lock);
Expand Down Expand Up @@ -897,6 +893,10 @@ int efa_av_open(struct fid_domain *domain_fid, struct fi_av_attr *attr,
if (!av)
return -FI_ENOMEM;

if (attr->type == FI_AV_MAP) {
EFA_WARN(FI_LOG_AV, "FI_AV_MAP is deprecated in Libfabric 2.x. Please use FI_AV_TABLE. "
"EFA provider will now switch to using FI_AV_TABLE.\n");
}
attr->type = FI_AV_TABLE;

efa_domain = container_of(domain_fid, struct efa_domain, util_domain.domain_fid);
Expand Down
2 changes: 0 additions & 2 deletions prov/efa/src/efa_av.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ struct efa_ah {
struct efa_conn {
struct efa_ah *ah;
struct efa_ep_addr *ep_addr;
/* for FI_AV_TABLE, fi_addr is same as util_av_fi_addr,
* for FI_AV_MAP, fi_addr is pointer to efa_conn; */
fi_addr_t fi_addr;
fi_addr_t util_av_fi_addr;
struct efa_rdm_peer rdm_peer;
Expand Down

0 comments on commit 71dd1a1

Please sign in to comment.