Lines Matching refs:context

301 	struct mthca_ucontext           *context;  in mthca_alloc_ucontext()  local
315 context = kmalloc(sizeof *context, GFP_KERNEL); in mthca_alloc_ucontext()
316 if (!context) in mthca_alloc_ucontext()
319 err = mthca_uar_alloc(to_mdev(ibdev), &context->uar); in mthca_alloc_ucontext()
321 kfree(context); in mthca_alloc_ucontext()
325 context->db_tab = mthca_init_user_db_tab(to_mdev(ibdev)); in mthca_alloc_ucontext()
326 if (IS_ERR(context->db_tab)) { in mthca_alloc_ucontext()
327 err = PTR_ERR(context->db_tab); in mthca_alloc_ucontext()
328 mthca_uar_free(to_mdev(ibdev), &context->uar); in mthca_alloc_ucontext()
329 kfree(context); in mthca_alloc_ucontext()
334 mthca_cleanup_user_db_tab(to_mdev(ibdev), &context->uar, context->db_tab); in mthca_alloc_ucontext()
335 mthca_uar_free(to_mdev(ibdev), &context->uar); in mthca_alloc_ucontext()
336 kfree(context); in mthca_alloc_ucontext()
340 context->reg_mr_warned = 0; in mthca_alloc_ucontext()
342 return &context->ibucontext; in mthca_alloc_ucontext()
345 static int mthca_dealloc_ucontext(struct ib_ucontext *context) in mthca_dealloc_ucontext() argument
347 mthca_cleanup_user_db_tab(to_mdev(context->device), &to_mucontext(context)->uar, in mthca_dealloc_ucontext()
348 to_mucontext(context)->db_tab); in mthca_dealloc_ucontext()
349 mthca_uar_free(to_mdev(context->device), &to_mucontext(context)->uar); in mthca_dealloc_ucontext()
350 kfree(to_mucontext(context)); in mthca_dealloc_ucontext()
355 static int mthca_mmap_uar(struct ib_ucontext *context, in mthca_mmap_uar() argument
364 to_mucontext(context)->uar.pfn, in mthca_mmap_uar()
372 struct ib_ucontext *context, in mthca_alloc_pd() argument
382 err = mthca_pd_alloc(to_mdev(ibdev), !context, pd); in mthca_alloc_pd()
388 if (context) { in mthca_alloc_pd()
439 struct mthca_ucontext *context = NULL; in mthca_create_srq() local
451 context = to_mucontext(pd->uobject->context); in mthca_create_srq()
458 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_srq()
459 context->db_tab, ucmd.db_index, in mthca_create_srq()
473 mthca_unmap_user_db(to_mdev(pd->device), &context->uar, in mthca_create_srq()
474 context->db_tab, ucmd.db_index); in mthca_create_srq()
479 if (context && ib_copy_to_udata(udata, &srq->srqn, sizeof (__u32))) { in mthca_create_srq()
495 struct mthca_ucontext *context; in mthca_destroy_srq() local
498 context = to_mucontext(srq->uobject->context); in mthca_destroy_srq()
500 mthca_unmap_user_db(to_mdev(srq->device), &context->uar, in mthca_destroy_srq()
501 context->db_tab, to_msrq(srq)->db_index); in mthca_destroy_srq()
526 struct mthca_ucontext *context; in mthca_create_qp() local
533 context = to_mucontext(pd->uobject->context); in mthca_create_qp()
540 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_qp()
541 context->db_tab, in mthca_create_qp()
548 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_qp()
549 context->db_tab, in mthca_create_qp()
553 &context->uar, in mthca_create_qp()
554 context->db_tab, in mthca_create_qp()
572 context = to_mucontext(pd->uobject->context); in mthca_create_qp()
575 &context->uar, in mthca_create_qp()
576 context->db_tab, in mthca_create_qp()
579 &context->uar, in mthca_create_qp()
580 context->db_tab, in mthca_create_qp()
631 &to_mucontext(qp->uobject->context)->uar, in mthca_destroy_qp()
632 to_mucontext(qp->uobject->context)->db_tab, in mthca_destroy_qp()
635 &to_mucontext(qp->uobject->context)->uar, in mthca_destroy_qp()
636 to_mucontext(qp->uobject->context)->db_tab, in mthca_destroy_qp()
646 struct ib_ucontext *context, in mthca_create_cq() argument
657 if (context) { in mthca_create_cq()
661 err = mthca_map_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
662 to_mucontext(context)->db_tab, in mthca_create_cq()
667 err = mthca_map_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
668 to_mucontext(context)->db_tab, in mthca_create_cq()
680 if (context) { in mthca_create_cq()
690 context ? to_mucontext(context) : NULL, in mthca_create_cq()
691 context ? ucmd.pdn : to_mdev(ibdev)->driver_pd.pd_num, in mthca_create_cq()
696 if (context && ib_copy_to_udata(udata, &cq->cqn, sizeof (__u32))) { in mthca_create_cq()
710 if (context) in mthca_create_cq()
711 mthca_unmap_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
712 to_mucontext(context)->db_tab, ucmd.arm_db_index); in mthca_create_cq()
715 if (context) in mthca_create_cq()
716 mthca_unmap_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
717 to_mucontext(context)->db_tab, ucmd.set_db_index); in mthca_create_cq()
847 &to_mucontext(cq->uobject->context)->uar, in mthca_destroy_cq()
848 to_mucontext(cq->uobject->context)->db_tab, in mthca_destroy_cq()
851 &to_mucontext(cq->uobject->context)->uar, in mthca_destroy_cq()
852 to_mucontext(cq->uobject->context)->db_tab, in mthca_destroy_cq()
990 if (!to_mucontext(pd->uobject->context)->reg_mr_warned) { in mthca_reg_user_mr()
995 ++to_mucontext(pd->uobject->context)->reg_mr_warned; in mthca_reg_user_mr()
1004 mr->umem = ib_umem_get(pd->uobject->context, start, length, acc, in mthca_reg_user_mr()