VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
- pd->handle = resp->pd_handle;
+ pd->handle = resp->pd_handle;
+ pd->context = context;
return 0;
}
mr->handle = resp.mr_handle;
mr->lkey = resp.lkey;
mr->rkey = resp.rkey;
+ mr->context = pd->context;
return 0;
}
VALGRIND_MAKE_MEM_DEFINED(resp, sizeof resp_size);
- cq->handle = resp->cq_handle;
- cq->cqe = resp->cqe;
+ cq->handle = resp->cq_handle;
+ cq->cqe = resp->cqe;
+ cq->context = context;
return 0;
}
VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
- cq->handle = resp->cq_handle;
- cq->cqe = resp->cqe;
+ cq->handle = resp->cq_handle;
+ cq->cqe = resp->cqe;
+ cq->context = context;
return 0;
}
VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
- srq->handle = resp->srq_handle;
+ srq->handle = resp->srq_handle;
+ srq->context = pd->context;
if (abi_ver > 5) {
attr->attr.max_wr = resp->max_wr;
qp->handle = resp->qp_handle;
qp->qp_num = resp->qpn;
+ qp->context = pd->context;
if (abi_ver > 3) {
attr->cap.max_recv_sge = resp->max_recv_sge;
VALGRIND_MAKE_MEM_DEFINED(&resp, sizeof resp);
- ah->handle = resp.handle;
+ ah->handle = resp.handle;
+ ah->context = pd->context;
return 0;
}
struct ibv_pd *ibv_alloc_pd(struct ibv_context *context)
{
- struct ibv_pd *pd;
-
- pd = context->ops.alloc_pd(context);
- if (pd)
- pd->context = context;
-
- return pd;
+ return context->ops.alloc_pd(context);
}
int ibv_dealloc_pd(struct ibv_pd *pd)
mr = pd->context->ops.reg_mr(pd, addr, length, access);
if (mr) {
- mr->context = pd->context;
mr->pd = pd;
}
comp_vector);
if (cq) {
- cq->context = context;
cq->cq_context = cq_context;
cq->comp_events_completed = 0;
cq->async_events_completed = 0;
srq = pd->context->ops.create_srq(pd, srq_init_attr);
if (srq) {
- srq->context = pd->context;
srq->srq_context = srq_init_attr->srq_context;
srq->pd = pd;
srq->events_completed = 0;
struct ibv_qp *qp = pd->context->ops.create_qp(pd, qp_init_attr);
if (qp) {
- qp->context = pd->context;
qp->qp_context = qp_init_attr->qp_context;
qp->pd = pd;
qp->send_cq = qp_init_attr->send_cq;
{
struct ibv_ah *ah = pd->context->ops.create_ah(pd, attr);
- if (ah) {
- ah->context = pd->context;
+ if (ah)
ah->pd = pd;
- }
return ah;
}