Lines Matching refs:pd
379 struct mthca_pd *pd; in mthca_alloc_pd() local
382 pd = kmalloc(sizeof *pd, GFP_KERNEL); in mthca_alloc_pd()
383 if (!pd) in mthca_alloc_pd()
386 err = mthca_pd_alloc(to_mdev(ibdev), !context, pd); in mthca_alloc_pd()
388 kfree(pd); in mthca_alloc_pd()
393 if (ib_copy_to_udata(udata, &pd->pd_num, sizeof (__u32))) { in mthca_alloc_pd()
394 mthca_pd_free(to_mdev(ibdev), pd); in mthca_alloc_pd()
395 kfree(pd); in mthca_alloc_pd()
400 return &pd->ibpd; in mthca_alloc_pd()
403 static int mthca_dealloc_pd(struct ib_pd *pd) in mthca_dealloc_pd() argument
405 mthca_pd_free(to_mdev(pd->device), to_mpd(pd)); in mthca_dealloc_pd()
406 kfree(pd); in mthca_dealloc_pd()
411 static struct ib_ah *mthca_ah_create(struct ib_pd *pd, in mthca_ah_create() argument
421 err = mthca_create_ah(to_mdev(pd->device), to_mpd(pd), ah_attr, ah); in mthca_ah_create()
438 static struct ib_srq *mthca_create_srq(struct ib_pd *pd, in mthca_create_srq() argument
454 if (pd->uobject) { in mthca_create_srq()
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()
473 err = mthca_alloc_srq(to_mdev(pd->device), to_mpd(pd), in mthca_create_srq()
476 if (err && pd->uobject) in mthca_create_srq()
477 mthca_unmap_user_db(to_mdev(pd->device), &context->uar, in mthca_create_srq()
484 mthca_free_srq(to_mdev(pd->device), srq); in mthca_create_srq()
514 static struct ib_qp *mthca_create_qp(struct ib_pd *pd, in mthca_create_qp() argument
536 if (pd->uobject) { in mthca_create_qp()
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()
552 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_qp()
556 mthca_unmap_user_db(to_mdev(pd->device), in mthca_create_qp()
569 err = mthca_alloc_qp(to_mdev(pd->device), to_mpd(pd), in mthca_create_qp()
575 if (err && pd->uobject) { in mthca_create_qp()
576 context = to_mucontext(pd->uobject->context); in mthca_create_qp()
578 mthca_unmap_user_db(to_mdev(pd->device), in mthca_create_qp()
582 mthca_unmap_user_db(to_mdev(pd->device), in mthca_create_qp()
595 if (pd->uobject) in mthca_create_qp()
604 err = mthca_alloc_sqp(to_mdev(pd->device), to_mpd(pd), in mthca_create_qp()
878 static struct ib_mr *mthca_get_dma_mr(struct ib_pd *pd, int acc) in mthca_get_dma_mr() argument
887 err = mthca_mr_alloc_notrans(to_mdev(pd->device), in mthca_get_dma_mr()
888 to_mpd(pd)->pd_num, in mthca_get_dma_mr()
901 static struct ib_mr *mthca_reg_phys_mr(struct ib_pd *pd, in mthca_reg_phys_mr() argument
959 mthca_dbg(to_mdev(pd->device), "Registering memory at %llx (iova %llx) " in mthca_reg_phys_mr()
963 to_mpd(pd)->pd_num, in mthca_reg_phys_mr()
966 err = mthca_mr_alloc_phys(to_mdev(pd->device), in mthca_reg_phys_mr()
967 to_mpd(pd)->pd_num, in mthca_reg_phys_mr()
984 static struct ib_mr *mthca_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, in mthca_reg_user_mr() argument
987 struct mthca_dev *dev = to_mdev(pd->device); in mthca_reg_user_mr()
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()
1065 err = mthca_mr_alloc(dev, to_mpd(pd)->pd_num, shift, virt, length, in mthca_reg_user_mr()
1096 static struct ib_fmr *mthca_alloc_fmr(struct ib_pd *pd, int mr_access_flags, in mthca_alloc_fmr() argument
1107 err = mthca_fmr_alloc(to_mdev(pd->device), to_mpd(pd)->pd_num, in mthca_alloc_fmr()