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

hmem,prov/efa: change neuron get_dmabuf_fd error code #10149

Merged
merged 1 commit into from
Jul 4, 2024
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
2 changes: 1 addition & 1 deletion prov/efa/src/efa_hmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static int efa_domain_hmem_info_init_neuron(struct efa_domain *efa_domain)
ibv_mr = ibv_reg_dmabuf_mr(
g_device_list[0].ibv_pd, offset,
len, (uint64_t)ptr, dmabuf_fd, ibv_access);
} else if (ret == -FI_ENOPROTOOPT) {
} else if (ret == -FI_EOPNOTSUPP) {
EFA_INFO(FI_LOG_MR,
"Unable to retrieve dmabuf fd of Neuron device buffer, "
"Fall back to ibv_reg_mr\n");
Expand Down
2 changes: 1 addition & 1 deletion prov/efa/src/efa_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ static struct ibv_mr *efa_mr_reg_ibv_mr(struct efa_mr *efa_mr, struct fi_mr_attr
mr_attr->mr_iov->iov_len,
(uint64_t)mr_attr->mr_iov->iov_base,
dmabuf_fd, access);
} else if (ret == -FI_ENOPROTOOPT) {
} else if (ret == -FI_EOPNOTSUPP) {
/* Protocol not availabe => fallback */
EFA_INFO(FI_LOG_MR,
"Unable to get dmabuf fd for Neuron device buffer, "
Expand Down
4 changes: 2 additions & 2 deletions src/hmem_neuron.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int neuron_get_dmabuf_fd(const void *addr, uint64_t size, int *fd,

/* nrt_get_dmabuf_fd symbol doesn't exist in Neuron Runtime */
if (!neuron_ops.nrt_get_dmabuf_fd) {
return -FI_ENOPROTOOPT;
return -FI_EOPNOTSUPP;
}

ret = neuron_ops.nrt_get_dmabuf_fd((uintptr_t)addr, size, fd);
Expand All @@ -245,7 +245,7 @@ int neuron_get_dmabuf_fd(const void *addr, uint64_t size, int *fd,
/* fallback to mem registration using ibv_reg_mr */
FI_INFO(&core_prov, FI_LOG_CORE,
"Failed to retrieve dmabuf_fd: %d\n", ret);
return -FI_ENOPROTOOPT;
return -FI_EOPNOTSUPP;
}
}

Expand Down
Loading