Lines Matching refs:smbdirect_mr
2373 struct smbd_mr *smbdirect_mr; in smbd_mr_recovery_work() local
2376 list_for_each_entry(smbdirect_mr, &info->mr_list, list) { in smbd_mr_recovery_work()
2377 if (smbdirect_mr->state == MR_INVALIDATED || in smbd_mr_recovery_work()
2378 smbdirect_mr->state == MR_ERROR) { in smbd_mr_recovery_work()
2381 rc = ib_dereg_mr(smbdirect_mr->mr); in smbd_mr_recovery_work()
2390 smbdirect_mr->mr = ib_alloc_mr( in smbd_mr_recovery_work()
2393 if (IS_ERR(smbdirect_mr->mr)) { in smbd_mr_recovery_work()
2403 if (smbdirect_mr->state == MR_INVALIDATED) in smbd_mr_recovery_work()
2405 info->id->device, smbdirect_mr->sgl, in smbd_mr_recovery_work()
2406 smbdirect_mr->sgl_count, in smbd_mr_recovery_work()
2407 smbdirect_mr->dir); in smbd_mr_recovery_work()
2409 smbdirect_mr->state = MR_READY; in smbd_mr_recovery_work()
2449 struct smbd_mr *smbdirect_mr, *tmp; in allocate_mr_list() local
2460 smbdirect_mr = kzalloc(sizeof(*smbdirect_mr), GFP_KERNEL); in allocate_mr_list()
2461 if (!smbdirect_mr) in allocate_mr_list()
2463 smbdirect_mr->mr = ib_alloc_mr(info->pd, info->mr_type, in allocate_mr_list()
2465 if (IS_ERR(smbdirect_mr->mr)) { in allocate_mr_list()
2471 smbdirect_mr->sgl = kcalloc( in allocate_mr_list()
2475 if (!smbdirect_mr->sgl) { in allocate_mr_list()
2477 ib_dereg_mr(smbdirect_mr->mr); in allocate_mr_list()
2480 smbdirect_mr->state = MR_READY; in allocate_mr_list()
2481 smbdirect_mr->conn = info; in allocate_mr_list()
2483 list_add_tail(&smbdirect_mr->list, &info->mr_list); in allocate_mr_list()
2489 kfree(smbdirect_mr); in allocate_mr_list()
2491 list_for_each_entry_safe(smbdirect_mr, tmp, &info->mr_list, list) { in allocate_mr_list()
2492 list_del(&smbdirect_mr->list); in allocate_mr_list()
2493 ib_dereg_mr(smbdirect_mr->mr); in allocate_mr_list()
2494 kfree(smbdirect_mr->sgl); in allocate_mr_list()
2495 kfree(smbdirect_mr); in allocate_mr_list()
2559 struct smbd_mr *smbdirect_mr; in smbd_register_mr() local
2570 smbdirect_mr = get_mr(info); in smbd_register_mr()
2571 if (!smbdirect_mr) { in smbd_register_mr()
2575 smbdirect_mr->need_invalidate = need_invalidate; in smbd_register_mr()
2576 smbdirect_mr->sgl_count = num_pages; in smbd_register_mr()
2577 sg_init_table(smbdirect_mr->sgl, num_pages); in smbd_register_mr()
2583 sg_set_page(&smbdirect_mr->sgl[0], pages[0], tailsz, offset); in smbd_register_mr()
2589 &smbdirect_mr->sgl[0], pages[0], PAGE_SIZE - offset, offset); in smbd_register_mr()
2592 sg_set_page(&smbdirect_mr->sgl[i], pages[i], PAGE_SIZE, 0); in smbd_register_mr()
2595 sg_set_page(&smbdirect_mr->sgl[i], pages[i], in smbd_register_mr()
2600 smbdirect_mr->dir = dir; in smbd_register_mr()
2601 rc = ib_dma_map_sg(info->id->device, smbdirect_mr->sgl, num_pages, dir); in smbd_register_mr()
2608 rc = ib_map_mr_sg(smbdirect_mr->mr, smbdirect_mr->sgl, num_pages, in smbd_register_mr()
2617 ib_update_fast_reg_key(smbdirect_mr->mr, in smbd_register_mr()
2618 ib_inc_rkey(smbdirect_mr->mr->rkey)); in smbd_register_mr()
2619 reg_wr = &smbdirect_mr->wr; in smbd_register_mr()
2621 smbdirect_mr->cqe.done = register_mr_done; in smbd_register_mr()
2622 reg_wr->wr.wr_cqe = &smbdirect_mr->cqe; in smbd_register_mr()
2625 reg_wr->mr = smbdirect_mr->mr; in smbd_register_mr()
2626 reg_wr->key = smbdirect_mr->mr->rkey; in smbd_register_mr()
2638 return smbdirect_mr; in smbd_register_mr()
2645 ib_dma_unmap_sg(info->id->device, smbdirect_mr->sgl, in smbd_register_mr()
2646 smbdirect_mr->sgl_count, smbdirect_mr->dir); in smbd_register_mr()
2649 smbdirect_mr->state = MR_ERROR; in smbd_register_mr()
2660 struct smbd_mr *smbdirect_mr; in local_inv_done() local
2664 smbdirect_mr = container_of(cqe, struct smbd_mr, cqe); in local_inv_done()
2665 smbdirect_mr->state = MR_INVALIDATED; in local_inv_done()
2668 smbdirect_mr->state = MR_ERROR; in local_inv_done()
2670 complete(&smbdirect_mr->invalidate_done); in local_inv_done()
2679 int smbd_deregister_mr(struct smbd_mr *smbdirect_mr) in smbd_deregister_mr() argument
2682 struct smbd_connection *info = smbdirect_mr->conn; in smbd_deregister_mr()
2685 if (smbdirect_mr->need_invalidate) { in smbd_deregister_mr()
2687 wr = &smbdirect_mr->inv_wr; in smbd_deregister_mr()
2689 smbdirect_mr->cqe.done = local_inv_done; in smbd_deregister_mr()
2690 wr->wr_cqe = &smbdirect_mr->cqe; in smbd_deregister_mr()
2692 wr->ex.invalidate_rkey = smbdirect_mr->mr->rkey; in smbd_deregister_mr()
2695 init_completion(&smbdirect_mr->invalidate_done); in smbd_deregister_mr()
2702 wait_for_completion(&smbdirect_mr->invalidate_done); in smbd_deregister_mr()
2703 smbdirect_mr->need_invalidate = false; in smbd_deregister_mr()
2709 smbdirect_mr->state = MR_INVALIDATED; in smbd_deregister_mr()