struct ibv_create_cq *p_req;\r
struct ibv_create_cq_resp *p_resp = NULL;\r
\r
- if ( p_umv_buf && p_umv_buf->command) {\r
+ if ( p_uctx && p_umv_buf && p_umv_buf->p_inout_buf ) {\r
// prepare user parameters\r
p_req = (struct ibv_create_cq*)(void*)p_umv_buf->p_inout_buf;\r
p_resp = (struct ibv_create_cq_resp*)(void*)\r
\r
struct ib_qp *ibv_create_qp(struct ib_pd *pd,\r
struct ib_qp_init_attr *qp_init_attr,\r
- struct ib_ucontext *context, ci_umv_buf_t* const p_umv_buf)\r
+ struct ib_ucontext *p_uctx, ci_umv_buf_t* const p_umv_buf)\r
{\r
int err;\r
struct ib_qp *p_ib_qp;\r
\r
HCA_ENTER(HCA_DBG_QP);\r
\r
- if ( p_umv_buf ) {\r
+ if ( p_uctx && p_umv_buf && p_umv_buf->command ) {\r
// prepare user parameters\r
p_req = (struct ibv_create_qp*)(void*)p_umv_buf->p_inout_buf;\r
p_resp = (struct ibv_create_qp_resp*)(void*)p_umv_buf->p_inout_buf;\r
p_ib_qp->send_cq = qp_init_attr->send_cq;\r
p_ib_qp->recv_cq = qp_init_attr->recv_cq;\r
p_ib_qp->srq = qp_init_attr->srq;\r
- p_ib_qp->p_uctx = context;\r
+ p_ib_qp->p_uctx = p_uctx;\r
p_ib_qp->event_handler = qp_init_attr->event_handler;\r
p_ib_qp->qp_context = qp_init_attr->qp_context;\r
p_ib_qp->qp_type = qp_init_attr->qp_type;\r
atomic_inc(&qp_init_attr->recv_cq->usecnt);\r
if (qp_init_attr->srq)\r
atomic_inc(&qp_init_attr->srq->usecnt);\r
- if (context)\r
- atomic_inc(&context->x.usecnt);\r
+ if (p_uctx)\r
+ atomic_inc(&p_uctx->x.usecnt);\r
HCA_PRINT(TRACE_LEVEL_INFORMATION ,HCA_DBG_QP ,("pdn %d, usecnt %d, pd_handle %p, ctx %p \n", \r
((struct mlx4_ib_pd*)pd)->pdn, pd->usecnt, pd, pd->p_uctx));\r
\r
) );\r
\r
// fill results for user\r
- if (context && p_umv_buf && p_umv_buf->p_inout_buf) {\r
+ if (p_uctx && p_umv_buf && p_umv_buf->p_inout_buf) {\r
struct mlx4_ib_qp *p_mib_qp = (struct mlx4_ib_qp *)p_ib_qp;\r
p_resp->qp_handle = (__u64)(ULONG_PTR)p_ib_qp;\r
p_resp->qpn = p_mib_qp->mqp.qpn;\r
\r
struct ib_srq *ibv_create_srq(struct ib_pd *pd,\r
struct ib_srq_init_attr *srq_init_attr,\r
- struct ib_ucontext *context, ci_umv_buf_t* const p_umv_buf)\r
+ struct ib_ucontext *p_uctx, ci_umv_buf_t* const p_umv_buf)\r
{\r
int err;\r
struct ib_srq *p_ib_srq;\r
struct ibv_create_srq *p_req = NULL;\r
struct ibv_create_srq_resp *p_resp= NULL;\r
\r
- if ( p_umv_buf && p_umv_buf->command) {\r
+ if ( p_uctx && p_umv_buf && p_umv_buf->p_inout_buf) {\r
// prepare user parameters\r
p_req = (struct ibv_create_srq*)(void*)p_umv_buf->p_inout_buf;\r
p_resp = (struct ibv_create_srq_resp*)(void*)p_umv_buf->p_inout_buf;\r
// fill results\r
p_ib_srq->device = pd->device;\r
p_ib_srq->pd = pd;\r
- p_ib_srq->p_uctx = context;\r
+ p_ib_srq->p_uctx = p_uctx;\r
p_ib_srq->event_handler = srq_init_attr->event_handler;\r
p_ib_srq->srq_context = srq_init_attr->srq_context;\r
atomic_inc(&pd->usecnt);\r
atomic_set(&p_ib_srq->usecnt, 0);\r
- if (context)\r
- atomic_inc(&context->x.usecnt);\r
+ if (p_uctx)\r
+ atomic_inc(&p_uctx->x.usecnt);\r
HCA_PRINT(TRACE_LEVEL_INFORMATION ,HCA_DBG_QP ,("PD%d use cnt %d, pd_handle %p, ctx %p \n", \r
((struct mlx4_ib_pd*)pd)->pdn, pd->usecnt, pd, pd->p_uctx));\r
\r
pd->p_uctx, p_ib_srq, ((struct mlx4_ib_srq*)p_ib_srq)->msrq.srqn ) );\r
\r
// fill results for user\r
- if (context && p_umv_buf && p_umv_buf->p_inout_buf) {\r
+ if (p_uctx && p_umv_buf && p_umv_buf->p_inout_buf) {\r
struct mlx4_ib_srq* p_mib_srq = (struct mlx4_ib_srq*)p_ib_srq;\r
p_resp->srq_handle = (__u64)(ULONG_PTR)p_ib_srq;\r
p_resp->max_wr = p_mib_srq->msrq.max - 1;\r