void * cq_context;\r
int cqe;\r
atomic_t usecnt; /* count number of work queues */\r
- struct ib_cq_ex x;\r
};\r
\r
struct ib_srq {\r
void (*event_handler)(ib_event_rec_t *);\r
void *srq_context;\r
atomic_t usecnt;\r
- struct ib_srq_ex x;\r
};\r
\r
struct ib_qp {\r
void *qp_context;\r
u32 qp_num;\r
enum ib_qp_type qp_type;\r
- struct ib_qp_ex x;\r
};\r
\r
struct ib_mr {\r
int fw_if_open;
};
-/* extension for ib_cq */
-struct ib_cq_ex
-{
- void * ctx; /* IBAL CQ context */
-};
-
-/* extension for ib_qp */
-struct ib_qp_ex
-{
- void * ctx; /* IBAL QP context */
-};
-
-/* extension for ib_srq */
-struct ib_srq_ex
-{
- void * ctx; /* IBAL SRQ context */
-};
-
/* extension for ib_event */
struct ib_event_ex
{
// allocate cq \r
p_ib_cq = ibv_create_cq(p_ibdev, \r
cq_comp_handler, event_handler,\r
- p_hca, *p_size, p_uctx, p_umv_buf );\r
+ (void*)cq_context, *p_size, p_uctx, p_umv_buf );\r
if (IS_ERR(p_ib_cq)) {\r
err = PTR_ERR(p_ib_cq);\r
HCA_PRINT (TRACE_LEVEL_ERROR ,HCA_DBG_CQ, ("ibv_create_cq failed (%d)\n", err));\r
goto err_create_cq;\r
}\r
\r
- // fill the object\r
- p_ib_cq->x.ctx = (void*)cq_context;\r
- \r
// return the result\r
*p_size = p_ib_cq->cqe;\r
\r
struct ib_qp_init_attr qp_init_attr;\r
struct ib_ucontext *p_uctx = NULL;\r
struct ib_pd *p_ib_pd = (struct ib_pd *)h_pd;\r
- struct ib_device *p_ib_dev = p_ib_pd->device;\r
- mlnx_hca_t *p_hca = ibdev2hca(p_ib_dev);\r
struct ibv_create_qp *p_req = NULL;\r
\r
HCA_ENTER(HCA_DBG_QP);\r
// prepare the parameters\r
RtlZeroMemory(&qp_init_attr, sizeof(qp_init_attr));\r
qp_init_attr.event_handler = event_handler;\r
- qp_init_attr.qp_context = p_hca;\r
+ qp_init_attr.qp_context = (void*)qp_uctx;\r
qp_init_attr.send_cq = (struct ib_cq *)p_create_attr->h_sq_cq;\r
qp_init_attr.recv_cq = (struct ib_cq *)p_create_attr->h_rq_cq;\r
qp_init_attr.srq = (struct ib_srq *)p_create_attr->h_srq;\r
goto err_create_qp;\r
}\r
\r
- // fill the object\r
- p_ib_qp->x.ctx = (void*)qp_uctx;\r
-\r
// Query QP to obtain requested attributes\r
if (p_qp_attr) {\r
status = mlnx_query_qp((ib_qp_handle_t)p_ib_qp, p_qp_attr, p_umv_buf);\r
struct ib_srq_init_attr srq_init_attr;\r
struct ib_ucontext *p_uctx = NULL;\r
struct ib_pd *p_ib_pd = (struct ib_pd *)h_pd;\r
- struct ib_device *p_ib_dev = p_ib_pd->device;\r
- mlnx_hca_t *p_hca = ibdev2hca(p_ib_dev);\r
\r
HCA_ENTER(HCA_DBG_SRQ);\r
\r
// prepare the parameters\r
RtlZeroMemory(&srq_init_attr, sizeof(srq_init_attr));\r
srq_init_attr.event_handler = event_handler;\r
- srq_init_attr.srq_context = p_hca;\r
+ srq_init_attr.srq_context = (void*)srq_context;\r
srq_init_attr.attr.max_wr = p_srq_attr->max_wr;\r
srq_init_attr.attr.max_sge = p_srq_attr->max_sge;\r
srq_init_attr.attr.srq_limit = p_srq_attr->srq_limit;\r
status = errno_to_iberr(err);\r
goto err_create_srq;\r
}\r
- p_ib_srq->x.ctx = (void*)srq_context;\r
\r
// return the result\r
if (ph_srq) *ph_srq = (ib_srq_handle_t)p_ib_srq;\r
int err;\r
ib_api_status_t status;\r
struct ib_srq *ib_srq_p;\r
- struct mthca_srq *srq_p;\r
struct ib_srq_init_attr srq_init_attr;\r
struct ib_ucontext *p_context = NULL;\r
struct ib_pd *ib_pd_p = (struct ib_pd *)h_pd;\r
struct ib_device *ib_dev = ib_pd_p->device;\r
- mlnx_hob_t *hob_p = HOB_FROM_IBDEV(ib_dev);\r
\r
HCA_ENTER(HCA_DBG_SRQ);\r
\r
// prepare the parameters\r
RtlZeroMemory(&srq_init_attr, sizeof(srq_init_attr));\r
srq_init_attr.event_handler = event_handler;\r
- srq_init_attr.srq_context = hob_p;\r
+ srq_init_attr.srq_context = (void*)srq_context;\r
srq_init_attr.attr = *p_srq_attr;\r
\r
// allocate srq \r
goto err_create_srq;\r
}\r
\r
- // fill the object\r
- srq_p = (struct mthca_srq *)ib_srq_p;\r
- srq_p->srq_context = (void*)srq_context;\r
- \r
// return the result\r
- if (ph_srq) *ph_srq = (ib_srq_handle_t)srq_p;\r
+ if (ph_srq) *ph_srq = (ib_srq_handle_t)ib_srq_p;\r
\r
status = IB_SUCCESS;\r
\r
struct ib_ucontext *p_context = NULL;\r
struct ib_pd *ib_pd_p = (struct ib_pd *)h_pd;\r
struct ib_device *ib_dev = ib_pd_p->device;\r
- mlnx_hob_t *hob_p = HOB_FROM_IBDEV(ib_dev);\r
\r
HCA_ENTER(HCA_DBG_QP);\r
\r
RtlZeroMemory(&qp_init_attr, sizeof(qp_init_attr));\r
qp_init_attr.qp_type = p_create_attr->qp_type;\r
qp_init_attr.event_handler = event_handler;\r
- qp_init_attr.qp_context = hob_p;\r
+ qp_init_attr.qp_context = (void*)qp_context;\r
qp_init_attr.recv_cq = (struct ib_cq *)p_create_attr->h_rq_cq;\r
qp_init_attr.send_cq = (struct ib_cq *)p_create_attr->h_sq_cq;\r
qp_init_attr.srq = (struct ib_srq *)p_create_attr->h_srq;\r
\r
// fill the object\r
qp_p = (struct mthca_qp *)ib_qp_p;\r
- qp_p->qp_context = (void*)qp_context;\r
qp_p->qp_init_attr = qp_init_attr;\r
\r
// Query QP to obtain requested attributes\r
int err;\r
ib_api_status_t status;\r
struct ib_cq *ib_cq_p;\r
- struct mthca_cq *cq_p;\r
mlnx_hob_t *hob_p;\r
struct ib_device *ib_dev;\r
struct ib_ucontext *p_context;\r
// allocate cq \r
ib_cq_p = ibv_create_cq(ib_dev, \r
cq_comp_handler, event_handler,\r
- hob_p, *p_size, p_context, p_umv_buf );\r
+ (void*)cq_context, *p_size, p_context, p_umv_buf );\r
if (IS_ERR(ib_cq_p)) {\r
err = PTR_ERR(ib_cq_p);\r
HCA_PRINT (TRACE_LEVEL_ERROR ,HCA_DBG_CQ, ("ibv_create_cq failed (%d)\n", err));\r
goto err_create_cq;\r
}\r
\r
- // fill the object\r
- cq_p = (struct mthca_cq *)ib_cq_p;\r
- cq_p->cq_context = (void*)cq_context;\r
- \r
// return the result\r
// *p_size = *p_size; // return the same value\r
*p_size = ib_cq_p->cqe;\r
\r
- if (ph_cq) *ph_cq = (ib_cq_handle_t)cq_p;\r
+ if (ph_cq) *ph_cq = (ib_cq_handle_t)ib_cq_p;\r
\r
status = IB_SUCCESS;\r
\r
++cq->arm_sn;\r
}\r
\r
- cq->ibcq.comp_handler(cq->cq_context);\r
+ cq->ibcq.comp_handler(cq->ibcq.cq_context);\r
}\r
\r
void mthca_cq_event(struct mthca_dev *dev, u32 cqn,\r
\r
struct mthca_cq {\r
struct ib_cq ibcq;\r
- void *cq_context; // leo: for IBAL shim\r
spinlock_t lock;\r
atomic_t refcount;\r
int cqn;\r
\r
wait_queue_head_t wait;\r
KMUTEX mutex;\r
- void *srq_context; \r
};\r
\r
struct mthca_wq {\r
\r
struct mthca_qp {\r
struct ib_qp ibqp;\r
- void *qp_context; // leo: for IBAL shim\r
//TODO: added just because absense of ibv_query_qp\r
// thereafter it may be worth to be replaced by struct ib_qp_attr qp_attr;\r
struct ib_qp_init_attr qp_init_attr; // leo: for query_qp\r