Lines Matching refs:mr

430 		   u64 iova, u64 total_size, u32 access, struct mthca_mr *mr)  in mthca_mr_alloc()  argument
444 mr->ibmr.rkey = mr->ibmr.lkey = hw_index_to_key(dev, key); in mthca_mr_alloc()
463 if (!mr->mtt) in mthca_mr_alloc()
475 if (mr->mtt) in mthca_mr_alloc()
478 mr->mtt->first_seg * dev->limits.mtt_seg_size); in mthca_mr_alloc()
481 mthca_dbg(dev, "Dumping MPT entry %08x:\n", mr->ibmr.lkey); in mthca_mr_alloc()
513 u32 access, struct mthca_mr *mr) in mthca_mr_alloc_notrans() argument
515 mr->mtt = NULL; in mthca_mr_alloc_notrans()
516 return mthca_mr_alloc(dev, pd, 12, 0, ~0ULL, access, mr); in mthca_mr_alloc_notrans()
522 u32 access, struct mthca_mr *mr) in mthca_mr_alloc_phys() argument
526 mr->mtt = mthca_alloc_mtt(dev, list_len); in mthca_mr_alloc_phys()
527 if (IS_ERR(mr->mtt)) in mthca_mr_alloc_phys()
528 return PTR_ERR(mr->mtt); in mthca_mr_alloc_phys()
530 err = mthca_write_mtt(dev, mr->mtt, 0, buffer_list, list_len); in mthca_mr_alloc_phys()
532 mthca_free_mtt(dev, mr->mtt); in mthca_mr_alloc_phys()
537 total_size, access, mr); in mthca_mr_alloc_phys()
539 mthca_free_mtt(dev, mr->mtt); in mthca_mr_alloc_phys()
553 void mthca_free_mr(struct mthca_dev *dev, struct mthca_mr *mr) in mthca_free_mr() argument
558 key_to_hw_index(dev, mr->ibmr.lkey) & in mthca_free_mr()
563 mthca_free_region(dev, mr->ibmr.lkey); in mthca_free_mr()
564 mthca_free_mtt(dev, mr->mtt); in mthca_free_mr()
568 u32 access, struct mthca_fmr *mr) in mthca_fmr_alloc() argument
574 int list_len = mr->attr.max_pages; in mthca_fmr_alloc()
578 if (mr->attr.page_shift < 12 || mr->attr.page_shift >= 32) in mthca_fmr_alloc()
583 mr->attr.max_pages * sizeof *mr->mem.arbel.mtts > PAGE_SIZE) in mthca_fmr_alloc()
586 mr->maps = 0; in mthca_fmr_alloc()
594 mr->ibmr.rkey = mr->ibmr.lkey = hw_index_to_key(dev, key); in mthca_fmr_alloc()
601 mr->mem.arbel.mpt = mthca_table_find(dev->mr_table.mpt_table, key, NULL); in mthca_fmr_alloc()
602 BUG_ON(!mr->mem.arbel.mpt); in mthca_fmr_alloc()
604 mr->mem.tavor.mpt = dev->mr_table.tavor_fmr.mpt_base + in mthca_fmr_alloc()
605 sizeof *(mr->mem.tavor.mpt) * idx; in mthca_fmr_alloc()
607 mr->mtt = __mthca_alloc_mtt(dev, list_len, dev->mr_table.fmr_mtt_buddy); in mthca_fmr_alloc()
608 if (IS_ERR(mr->mtt)) { in mthca_fmr_alloc()
609 err = PTR_ERR(mr->mtt); in mthca_fmr_alloc()
613 mtt_seg = mr->mtt->first_seg * dev->limits.mtt_seg_size; in mthca_fmr_alloc()
616 mr->mem.arbel.mtts = mthca_table_find(dev->mr_table.mtt_table, in mthca_fmr_alloc()
617 mr->mtt->first_seg, in mthca_fmr_alloc()
618 &mr->mem.arbel.dma_handle); in mthca_fmr_alloc()
619 BUG_ON(!mr->mem.arbel.mtts); in mthca_fmr_alloc()
621 mr->mem.tavor.mtts = dev->mr_table.tavor_fmr.mtt_base + mtt_seg; in mthca_fmr_alloc()
636 mpt_entry->page_size = cpu_to_be32(mr->attr.page_shift - 12); in mthca_fmr_alloc()
644 mthca_dbg(dev, "Dumping MPT entry %08x:\n", mr->ibmr.lkey); in mthca_fmr_alloc()
668 mthca_free_mtt(dev, mr->mtt); in mthca_fmr_alloc()