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: More fixes for efa-direct #10811

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
37 changes: 32 additions & 5 deletions prov/efa/src/efa_cntr.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,40 @@ int efa_cntr_open(struct fid_domain *domain, struct fi_cntr_attr *attr,
{
int ret;
struct efa_cntr *cntr;

cntr = calloc(1, sizeof(*cntr));
if (!cntr)
return -FI_ENOMEM;

dlist_init(&cntr->ibv_cq_poll_list);
cntr->need_to_scan_ep_list = false;

ret = ofi_cntr_init(&efa_prov, domain, attr, &cntr->util_cntr,
efa_cntr_progress, context);

if (ret)
goto free;

*cntr_fid = &cntr->util_cntr.cntr_fid;
cntr->util_cntr.cntr_fid.ops = &efa_cntr_ops;
cntr->util_cntr.cntr_fid.fid.ops = &efa_cntr_fi_ops;

return FI_SUCCESS;

free:
free(cntr);
return ret;
}


int efa_rdm_cntr_open(struct fid_domain *domain, struct fi_cntr_attr *attr,
struct fid_cntr **cntr_fid, void *context)
{
int ret;
struct efa_cntr *cntr;
struct efa_domain *efa_domain;
struct fi_cntr_attr shm_cntr_attr = {0};
struct fi_peer_cntr_context peer_cntr_context = {0};
ofi_cntr_progress_func cntr_progress_func;

cntr = calloc(1, sizeof(*cntr));
if (!cntr)
Expand All @@ -213,11 +243,8 @@ int efa_cntr_open(struct fid_domain *domain, struct fi_cntr_attr *attr,
efa_domain = container_of(domain, struct efa_domain,
util_domain.domain_fid);

cntr_progress_func = efa_domain->info->ep_attr->type == FI_EP_RDM
? efa_rdm_cntr_progress
: efa_cntr_progress;
ret = ofi_cntr_init(&efa_prov, domain, attr, &cntr->util_cntr,
cntr_progress_func, context);
efa_rdm_cntr_progress, context);

if (ret)
goto free;
Expand Down
3 changes: 3 additions & 0 deletions prov/efa/src/efa_cntr.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ struct efa_cntr {
int efa_cntr_open(struct fid_domain *domain, struct fi_cntr_attr *attr,
struct fid_cntr **cntr_fid, void *context);

int efa_rdm_cntr_open(struct fid_domain *domain, struct fi_cntr_attr *attr,
struct fid_cntr **cntr_fid, void *context);

void efa_cntr_report_tx_completion(struct util_ep *ep, uint64_t flags);

void efa_cntr_report_rx_completion(struct util_ep *ep, uint64_t flags);
Expand Down
2 changes: 1 addition & 1 deletion prov/efa/src/efa_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static struct fi_ops_domain efa_domain_ops_rdm = {
.cq_open = efa_rdm_cq_open,
.endpoint = efa_rdm_ep_open,
.scalable_ep = fi_no_scalable_ep,
.cntr_open = efa_cntr_open,
.cntr_open = efa_rdm_cntr_open,
.poll_open = fi_poll_create,
.stx_ctx = fi_no_stx_context,
.srx_ctx = fi_no_srx_context,
Expand Down
6 changes: 0 additions & 6 deletions prov/efa/src/efa_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,6 @@ static int efa_ep_bind(struct fid *fid, struct fid *bfid, uint64_t flags)

switch (bfid->fclass) {
case FI_CLASS_CQ:
if (flags & FI_SELECTIVE_COMPLETION) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we have this in the first place? Because dgram doesn't support FI_SELECTIVE_COMPLETION?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the efa_ep PR was merged before the FI_CONTEXT2 change, so I didn't remove it.

EFA_WARN(FI_LOG_EP_CTRL,
"Endpoint cannot be bound with selective completion.\n");
return -FI_EBADFLAGS;
}

/* Must bind a CQ to either RECV or SEND completions */
if (!(flags & (FI_RECV | FI_TRANSMIT)))
return -FI_EBADFLAGS;
Expand Down