Lines Matching refs:smbdirect_mr

2056 	struct smbd_mr *smbdirect_mr;  in smbd_mr_recovery_work()  local
2059 list_for_each_entry(smbdirect_mr, &info->mr_list, list) { in smbd_mr_recovery_work()
2060 if (smbdirect_mr->state == MR_ERROR) { in smbd_mr_recovery_work()
2063 rc = ib_dereg_mr(smbdirect_mr->mr); in smbd_mr_recovery_work()
2072 smbdirect_mr->mr = ib_alloc_mr( in smbd_mr_recovery_work()
2075 if (IS_ERR(smbdirect_mr->mr)) { in smbd_mr_recovery_work()
2086 smbdirect_mr->state = MR_READY; in smbd_mr_recovery_work()
2125 struct smbd_mr *smbdirect_mr, *tmp; in allocate_mr_list() local
2136 smbdirect_mr = kzalloc(sizeof(*smbdirect_mr), GFP_KERNEL); in allocate_mr_list()
2137 if (!smbdirect_mr) in allocate_mr_list()
2139 smbdirect_mr->mr = ib_alloc_mr(info->pd, info->mr_type, in allocate_mr_list()
2141 if (IS_ERR(smbdirect_mr->mr)) { in allocate_mr_list()
2146 smbdirect_mr->sgt.sgl = kcalloc(info->max_frmr_depth, in allocate_mr_list()
2149 if (!smbdirect_mr->sgt.sgl) { in allocate_mr_list()
2151 ib_dereg_mr(smbdirect_mr->mr); in allocate_mr_list()
2154 smbdirect_mr->state = MR_READY; in allocate_mr_list()
2155 smbdirect_mr->conn = info; in allocate_mr_list()
2157 list_add_tail(&smbdirect_mr->list, &info->mr_list); in allocate_mr_list()
2163 kfree(smbdirect_mr); in allocate_mr_list()
2165 list_for_each_entry_safe(smbdirect_mr, tmp, &info->mr_list, list) { in allocate_mr_list()
2166 list_del(&smbdirect_mr->list); in allocate_mr_list()
2167 ib_dereg_mr(smbdirect_mr->mr); in allocate_mr_list()
2168 kfree(smbdirect_mr->sgt.sgl); in allocate_mr_list()
2169 kfree(smbdirect_mr); in allocate_mr_list()
2250 struct smbd_mr *smbdirect_mr; in smbd_register_mr() local
2263 smbdirect_mr = get_mr(info); in smbd_register_mr()
2264 if (!smbdirect_mr) { in smbd_register_mr()
2270 smbdirect_mr->dir = dir; in smbd_register_mr()
2271 smbdirect_mr->need_invalidate = need_invalidate; in smbd_register_mr()
2272 smbdirect_mr->sgt.nents = 0; in smbd_register_mr()
2273 smbdirect_mr->sgt.orig_nents = 0; in smbd_register_mr()
2277 smbd_iter_to_mr(info, iter, &smbdirect_mr->sgt, info->max_frmr_depth); in smbd_register_mr()
2279 rc = ib_dma_map_sg(info->id->device, smbdirect_mr->sgt.sgl, in smbd_register_mr()
2280 smbdirect_mr->sgt.nents, dir); in smbd_register_mr()
2287 rc = ib_map_mr_sg(smbdirect_mr->mr, smbdirect_mr->sgt.sgl, in smbd_register_mr()
2288 smbdirect_mr->sgt.nents, NULL, PAGE_SIZE); in smbd_register_mr()
2289 if (rc != smbdirect_mr->sgt.nents) { in smbd_register_mr()
2292 rc, smbdirect_mr->sgt.nents); in smbd_register_mr()
2296 ib_update_fast_reg_key(smbdirect_mr->mr, in smbd_register_mr()
2297 ib_inc_rkey(smbdirect_mr->mr->rkey)); in smbd_register_mr()
2298 reg_wr = &smbdirect_mr->wr; in smbd_register_mr()
2300 smbdirect_mr->cqe.done = register_mr_done; in smbd_register_mr()
2301 reg_wr->wr.wr_cqe = &smbdirect_mr->cqe; in smbd_register_mr()
2304 reg_wr->mr = smbdirect_mr->mr; in smbd_register_mr()
2305 reg_wr->key = smbdirect_mr->mr->rkey; in smbd_register_mr()
2317 return smbdirect_mr; in smbd_register_mr()
2324 ib_dma_unmap_sg(info->id->device, smbdirect_mr->sgt.sgl, in smbd_register_mr()
2325 smbdirect_mr->sgt.nents, smbdirect_mr->dir); in smbd_register_mr()
2328 smbdirect_mr->state = MR_ERROR; in smbd_register_mr()
2339 struct smbd_mr *smbdirect_mr; in local_inv_done() local
2343 smbdirect_mr = container_of(cqe, struct smbd_mr, cqe); in local_inv_done()
2344 smbdirect_mr->state = MR_INVALIDATED; in local_inv_done()
2347 smbdirect_mr->state = MR_ERROR; in local_inv_done()
2349 complete(&smbdirect_mr->invalidate_done); in local_inv_done()
2358 int smbd_deregister_mr(struct smbd_mr *smbdirect_mr) in smbd_deregister_mr() argument
2361 struct smbd_connection *info = smbdirect_mr->conn; in smbd_deregister_mr()
2364 if (smbdirect_mr->need_invalidate) { in smbd_deregister_mr()
2366 wr = &smbdirect_mr->inv_wr; in smbd_deregister_mr()
2368 smbdirect_mr->cqe.done = local_inv_done; in smbd_deregister_mr()
2369 wr->wr_cqe = &smbdirect_mr->cqe; in smbd_deregister_mr()
2371 wr->ex.invalidate_rkey = smbdirect_mr->mr->rkey; in smbd_deregister_mr()
2374 init_completion(&smbdirect_mr->invalidate_done); in smbd_deregister_mr()
2381 wait_for_completion(&smbdirect_mr->invalidate_done); in smbd_deregister_mr()
2382 smbdirect_mr->need_invalidate = false; in smbd_deregister_mr()
2388 smbdirect_mr->state = MR_INVALIDATED; in smbd_deregister_mr()
2390 if (smbdirect_mr->state == MR_INVALIDATED) { in smbd_deregister_mr()
2392 info->id->device, smbdirect_mr->sgt.sgl, in smbd_deregister_mr()
2393 smbdirect_mr->sgt.nents, in smbd_deregister_mr()
2394 smbdirect_mr->dir); in smbd_deregister_mr()
2395 smbdirect_mr->state = MR_READY; in smbd_deregister_mr()