Lines Matching refs:pd
375 struct mthca_pd *pd; in mthca_alloc_pd() local
378 pd = kmalloc(sizeof *pd, GFP_KERNEL); in mthca_alloc_pd()
379 if (!pd) in mthca_alloc_pd()
382 err = mthca_pd_alloc(to_mdev(ibdev), !context, pd); in mthca_alloc_pd()
384 kfree(pd); in mthca_alloc_pd()
389 if (ib_copy_to_udata(udata, &pd->pd_num, sizeof (__u32))) { in mthca_alloc_pd()
390 mthca_pd_free(to_mdev(ibdev), pd); in mthca_alloc_pd()
391 kfree(pd); in mthca_alloc_pd()
396 return &pd->ibpd; in mthca_alloc_pd()
399 static int mthca_dealloc_pd(struct ib_pd *pd) in mthca_dealloc_pd() argument
401 mthca_pd_free(to_mdev(pd->device), to_mpd(pd)); in mthca_dealloc_pd()
402 kfree(pd); in mthca_dealloc_pd()
407 static struct ib_ah *mthca_ah_create(struct ib_pd *pd, in mthca_ah_create() argument
417 err = mthca_create_ah(to_mdev(pd->device), to_mpd(pd), ah_attr, ah); in mthca_ah_create()
434 static struct ib_srq *mthca_create_srq(struct ib_pd *pd, in mthca_create_srq() argument
450 if (pd->uobject) { in mthca_create_srq()
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()
469 err = mthca_alloc_srq(to_mdev(pd->device), to_mpd(pd), in mthca_create_srq()
472 if (err && pd->uobject) in mthca_create_srq()
473 mthca_unmap_user_db(to_mdev(pd->device), &context->uar, in mthca_create_srq()
480 mthca_free_srq(to_mdev(pd->device), srq); in mthca_create_srq()
510 static struct ib_qp *mthca_create_qp(struct ib_pd *pd, in mthca_create_qp() argument
532 if (pd->uobject) { in mthca_create_qp()
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()
548 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_qp()
552 mthca_unmap_user_db(to_mdev(pd->device), in mthca_create_qp()
565 err = mthca_alloc_qp(to_mdev(pd->device), to_mpd(pd), in mthca_create_qp()
571 if (err && pd->uobject) { in mthca_create_qp()
572 context = to_mucontext(pd->uobject->context); in mthca_create_qp()
574 mthca_unmap_user_db(to_mdev(pd->device), in mthca_create_qp()
578 mthca_unmap_user_db(to_mdev(pd->device), in mthca_create_qp()
591 if (pd->uobject) in mthca_create_qp()
600 err = mthca_alloc_sqp(to_mdev(pd->device), to_mpd(pd), in mthca_create_qp()
870 static struct ib_mr *mthca_get_dma_mr(struct ib_pd *pd, int acc) in mthca_get_dma_mr() argument
879 err = mthca_mr_alloc_notrans(to_mdev(pd->device), in mthca_get_dma_mr()
880 to_mpd(pd)->pd_num, in mthca_get_dma_mr()
893 static struct ib_mr *mthca_reg_phys_mr(struct ib_pd *pd, in mthca_reg_phys_mr() argument
951 mthca_dbg(to_mdev(pd->device), "Registering memory at %llx (iova %llx) " in mthca_reg_phys_mr()
955 to_mpd(pd)->pd_num, in mthca_reg_phys_mr()
958 err = mthca_mr_alloc_phys(to_mdev(pd->device), in mthca_reg_phys_mr()
959 to_mpd(pd)->pd_num, in mthca_reg_phys_mr()
976 static struct ib_mr *mthca_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, in mthca_reg_user_mr() argument
979 struct mthca_dev *dev = to_mdev(pd->device); in mthca_reg_user_mr()
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()
1057 err = mthca_mr_alloc(dev, to_mpd(pd)->pd_num, shift, virt, length, in mthca_reg_user_mr()
1088 static struct ib_fmr *mthca_alloc_fmr(struct ib_pd *pd, int mr_access_flags, in mthca_alloc_fmr() argument
1099 err = mthca_fmr_alloc(to_mdev(pd->device), to_mpd(pd)->pd_num, in mthca_alloc_fmr()