Skip to content

Commit

Permalink
prov/peer: add provider parameter to peer_cq_init
Browse files Browse the repository at this point in the history
Adding struct fi_provider* as the first parameter to peer_cq_init()
makes it similar to ofi_cq_init().

Signed-off-by: Tomasz Gromadzki <[email protected]>
  • Loading branch information
grom72 committed Dec 2, 2022
1 parent 0295e33 commit 5c8dff5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions prov/peer/src/peer_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,13 @@ static struct fi_ops_cq peer_cq_ops = {
.strerror = fi_no_cq_strerror,
};

int peer_cq_init(struct fid_domain *domain, struct fi_cq_attr *attr,
struct fid_cq **cq_fid, struct fi_peer_cq_context *peer_context)
static int peer_cq_init(const struct fi_provider* provider,
struct fid_domain *domain, struct fi_cq_attr *attr,
struct fid_cq **cq_fid, struct fi_peer_cq_context *peer_context)
{
struct peer_cq *cq;
int ret;

const struct util_domain *util_domain;
const struct fi_provider* provider;

util_domain = container_of(domain, struct util_domain, domain_fid.fid);
provider = util_domain->fabric->prov;


if (!attr || !(attr->flags & FI_PEER)) {
FI_WARN(provider, FI_LOG_CORE, "FI_PEER flag required\n");
return -FI_EINVAL;
Expand Down Expand Up @@ -113,8 +107,14 @@ int peer_cq_init(struct fid_domain *domain, struct fi_cq_attr *attr,
int ofi_peer_cq_open(struct fid_domain *domain, struct fi_cq_attr *attr,
struct fid_cq **cq_fid, void *context)
{
struct fi_peer_cq_context *peer_context = context;
return peer_cq_init(domain, attr, cq_fid, peer_context);
struct util_domain *util_domain;
struct fi_peer_cq_context *peer_context;

util_domain = container_of(domain, struct util_domain, domain_fid.fid);
peer_context = context;

return peer_cq_init(util_domain->fabric->prov, domain, attr,
cq_fid, peer_context);
}

ssize_t ofi_peer_cq_write(struct fid_cq *cq_fid, void *context, uint64_t flags,
Expand Down

0 comments on commit 5c8dff5

Please sign in to comment.