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 5, 2022
1 parent dec078d commit 8b47f5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 0 additions & 2 deletions include/ofi_peer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#ifndef _OFI_PEER_H_
#define _OFI_PEER_H_

#include <rdma/fi_collective.h>

#include <ofi_util.h>

int ofi_peer_cq_open(struct fid_domain *domain, struct fi_cq_attr *attr,
Expand Down
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 8b47f5c

Please sign in to comment.