Lines Matching refs:context
305 struct mthca_ucontext *context; in mthca_alloc_ucontext() local
319 context = kmalloc(sizeof *context, GFP_KERNEL); in mthca_alloc_ucontext()
320 if (!context) in mthca_alloc_ucontext()
323 err = mthca_uar_alloc(to_mdev(ibdev), &context->uar); in mthca_alloc_ucontext()
325 kfree(context); in mthca_alloc_ucontext()
329 context->db_tab = mthca_init_user_db_tab(to_mdev(ibdev)); in mthca_alloc_ucontext()
330 if (IS_ERR(context->db_tab)) { in mthca_alloc_ucontext()
331 err = PTR_ERR(context->db_tab); in mthca_alloc_ucontext()
332 mthca_uar_free(to_mdev(ibdev), &context->uar); in mthca_alloc_ucontext()
333 kfree(context); in mthca_alloc_ucontext()
338 mthca_cleanup_user_db_tab(to_mdev(ibdev), &context->uar, context->db_tab); in mthca_alloc_ucontext()
339 mthca_uar_free(to_mdev(ibdev), &context->uar); in mthca_alloc_ucontext()
340 kfree(context); in mthca_alloc_ucontext()
344 context->reg_mr_warned = 0; in mthca_alloc_ucontext()
346 return &context->ibucontext; in mthca_alloc_ucontext()
349 static int mthca_dealloc_ucontext(struct ib_ucontext *context) in mthca_dealloc_ucontext() argument
351 mthca_cleanup_user_db_tab(to_mdev(context->device), &to_mucontext(context)->uar, in mthca_dealloc_ucontext()
352 to_mucontext(context)->db_tab); in mthca_dealloc_ucontext()
353 mthca_uar_free(to_mdev(context->device), &to_mucontext(context)->uar); in mthca_dealloc_ucontext()
354 kfree(to_mucontext(context)); in mthca_dealloc_ucontext()
359 static int mthca_mmap_uar(struct ib_ucontext *context, in mthca_mmap_uar() argument
368 to_mucontext(context)->uar.pfn, in mthca_mmap_uar()
376 struct ib_ucontext *context, in mthca_alloc_pd() argument
386 err = mthca_pd_alloc(to_mdev(ibdev), !context, pd); in mthca_alloc_pd()
392 if (context) { in mthca_alloc_pd()
443 struct mthca_ucontext *context = NULL; in mthca_create_srq() local
455 context = to_mucontext(pd->uobject->context); in mthca_create_srq()
462 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_srq()
463 context->db_tab, ucmd.db_index, in mthca_create_srq()
477 mthca_unmap_user_db(to_mdev(pd->device), &context->uar, in mthca_create_srq()
478 context->db_tab, ucmd.db_index); in mthca_create_srq()
483 if (context && ib_copy_to_udata(udata, &srq->srqn, sizeof (__u32))) { in mthca_create_srq()
499 struct mthca_ucontext *context; in mthca_destroy_srq() local
502 context = to_mucontext(srq->uobject->context); in mthca_destroy_srq()
504 mthca_unmap_user_db(to_mdev(srq->device), &context->uar, in mthca_destroy_srq()
505 context->db_tab, to_msrq(srq)->db_index); in mthca_destroy_srq()
530 struct mthca_ucontext *context; in mthca_create_qp() local
537 context = to_mucontext(pd->uobject->context); in mthca_create_qp()
544 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_qp()
545 context->db_tab, in mthca_create_qp()
552 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_qp()
553 context->db_tab, in mthca_create_qp()
557 &context->uar, in mthca_create_qp()
558 context->db_tab, in mthca_create_qp()
576 context = to_mucontext(pd->uobject->context); in mthca_create_qp()
579 &context->uar, in mthca_create_qp()
580 context->db_tab, in mthca_create_qp()
583 &context->uar, in mthca_create_qp()
584 context->db_tab, in mthca_create_qp()
635 &to_mucontext(qp->uobject->context)->uar, in mthca_destroy_qp()
636 to_mucontext(qp->uobject->context)->db_tab, in mthca_destroy_qp()
639 &to_mucontext(qp->uobject->context)->uar, in mthca_destroy_qp()
640 to_mucontext(qp->uobject->context)->db_tab, in mthca_destroy_qp()
650 struct ib_ucontext *context, in mthca_create_cq() argument
665 if (context) { in mthca_create_cq()
669 err = mthca_map_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
670 to_mucontext(context)->db_tab, in mthca_create_cq()
675 err = mthca_map_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
676 to_mucontext(context)->db_tab, in mthca_create_cq()
688 if (context) { in mthca_create_cq()
698 context ? to_mucontext(context) : NULL, in mthca_create_cq()
699 context ? ucmd.pdn : to_mdev(ibdev)->driver_pd.pd_num, in mthca_create_cq()
704 if (context && ib_copy_to_udata(udata, &cq->cqn, sizeof (__u32))) { in mthca_create_cq()
718 if (context) in mthca_create_cq()
719 mthca_unmap_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
720 to_mucontext(context)->db_tab, ucmd.arm_db_index); in mthca_create_cq()
723 if (context) in mthca_create_cq()
724 mthca_unmap_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
725 to_mucontext(context)->db_tab, ucmd.set_db_index); in mthca_create_cq()
855 &to_mucontext(cq->uobject->context)->uar, in mthca_destroy_cq()
856 to_mucontext(cq->uobject->context)->db_tab, in mthca_destroy_cq()
859 &to_mucontext(cq->uobject->context)->uar, in mthca_destroy_cq()
860 to_mucontext(cq->uobject->context)->db_tab, in mthca_destroy_cq()
998 if (!to_mucontext(pd->uobject->context)->reg_mr_warned) { in mthca_reg_user_mr()
1003 ++to_mucontext(pd->uobject->context)->reg_mr_warned; in mthca_reg_user_mr()
1012 mr->umem = ib_umem_get(pd->uobject->context, start, length, acc, in mthca_reg_user_mr()