Lines Matching full:mr

28 static int mana_ib_gd_create_mr(struct mana_ib_dev *dev, struct mana_ib_mr *mr,  in mana_ib_gd_create_mr()  argument
58 ibdev_dbg(&dev->ib_dev, "Failed to create mr %d, %u", err, in mana_ib_gd_create_mr()
66 mr->ibmr.lkey = resp.lkey; in mana_ib_gd_create_mr()
67 mr->ibmr.rkey = resp.rkey; in mana_ib_gd_create_mr()
68 mr->mr_handle = resp.mr_handle; in mana_ib_gd_create_mr()
87 dev_err(gc->dev, "Failed to destroy MR: %d, 0x%x\n", err, in mana_ib_gd_destroy_mr()
105 struct mana_ib_mr *mr; in mana_ib_reg_user_mr() local
119 mr = kzalloc(sizeof(*mr), GFP_KERNEL); in mana_ib_reg_user_mr()
120 if (!mr) in mana_ib_reg_user_mr()
123 mr->umem = ib_umem_get(ibdev, start, length, access_flags); in mana_ib_reg_user_mr()
124 if (IS_ERR(mr->umem)) { in mana_ib_reg_user_mr()
125 err = PTR_ERR(mr->umem); in mana_ib_reg_user_mr()
127 "Failed to get umem for register user-mr, %d\n", err); in mana_ib_reg_user_mr()
131 err = mana_ib_create_dma_region(dev, mr->umem, &dma_region_handle, iova); in mana_ib_reg_user_mr()
133 ibdev_dbg(ibdev, "Failed create dma region for user-mr, %d\n", in mana_ib_reg_user_mr()
139 "created dma region for user-mr 0x%llx\n", in mana_ib_reg_user_mr()
149 err = mana_ib_gd_create_mr(dev, mr, &mr_params); in mana_ib_reg_user_mr()
154 * There is no need to keep track of dma_region_handle after MR is in mana_ib_reg_user_mr()
156 * as part of the lifecycle of this MR. in mana_ib_reg_user_mr()
159 return &mr->ibmr; in mana_ib_reg_user_mr()
165 ib_umem_release(mr->umem); in mana_ib_reg_user_mr()
168 kfree(mr); in mana_ib_reg_user_mr()
174 struct mana_ib_mr *mr = container_of(ibmr, struct mana_ib_mr, ibmr); in mana_ib_dereg_mr() local
181 err = mana_ib_gd_destroy_mr(dev, mr->mr_handle); in mana_ib_dereg_mr()
185 if (mr->umem) in mana_ib_dereg_mr()
186 ib_umem_release(mr->umem); in mana_ib_dereg_mr()
188 kfree(mr); in mana_ib_dereg_mr()