Lines Matching refs:mtt

209 		      struct hns_roce_mtt *mtt)  in hns_roce_mtt_init()  argument
216 mtt->order = -1; in hns_roce_mtt_init()
217 mtt->page_shift = HNS_ROCE_HEM_PAGE_SHIFT; in hns_roce_mtt_init()
222 mtt->page_shift = page_shift; in hns_roce_mtt_init()
225 for (mtt->order = 0, i = HNS_ROCE_MTT_ENTRY_PER_SEG; i < npages; in hns_roce_mtt_init()
227 ++mtt->order; in hns_roce_mtt_init()
230 ret = hns_roce_alloc_mtt_range(hr_dev, mtt->order, &mtt->first_seg, in hns_roce_mtt_init()
231 mtt->mtt_type); in hns_roce_mtt_init()
238 void hns_roce_mtt_cleanup(struct hns_roce_dev *hr_dev, struct hns_roce_mtt *mtt) in hns_roce_mtt_cleanup() argument
242 if (mtt->order < 0) in hns_roce_mtt_cleanup()
245 if (mtt->mtt_type == MTT_TYPE_WQE) { in hns_roce_mtt_cleanup()
246 hns_roce_buddy_free(&mr_table->mtt_buddy, mtt->first_seg, in hns_roce_mtt_cleanup()
247 mtt->order); in hns_roce_mtt_cleanup()
249 mtt->first_seg, in hns_roce_mtt_cleanup()
250 mtt->first_seg + (1 << mtt->order) - 1); in hns_roce_mtt_cleanup()
252 hns_roce_buddy_free(&mr_table->mtt_cqe_buddy, mtt->first_seg, in hns_roce_mtt_cleanup()
253 mtt->order); in hns_roce_mtt_cleanup()
255 mtt->first_seg, in hns_roce_mtt_cleanup()
256 mtt->first_seg + (1 << mtt->order) - 1); in hns_roce_mtt_cleanup()
704 struct hns_roce_mtt *mtt, u32 start_index, in hns_roce_write_mtt_chunk() argument
714 if (mtt->mtt_type == MTT_TYPE_WQE) in hns_roce_write_mtt_chunk()
727 if (mtt->mtt_type == MTT_TYPE_WQE) in hns_roce_write_mtt_chunk()
733 mtt->first_seg + s / hr_dev->caps.mtt_entry_sz, in hns_roce_write_mtt_chunk()
750 struct hns_roce_mtt *mtt, u32 start_index, in hns_roce_write_mtt() argument
757 if (mtt->order < 0) in hns_roce_write_mtt()
760 if (mtt->mtt_type == MTT_TYPE_WQE) in hns_roce_write_mtt()
768 ret = hns_roce_write_mtt_chunk(hr_dev, mtt, start_index, chunk, in hns_roce_write_mtt()
782 struct hns_roce_mtt *mtt, struct hns_roce_buf *buf) in hns_roce_buf_write_mtt() argument
799 ret = hns_roce_write_mtt(hr_dev, mtt, 0, buf->npages, page_list); in hns_roce_buf_write_mtt()
882 struct hns_roce_mtt *mtt, struct ib_umem *umem) in hns_roce_ib_umem_write_mtt() argument
896 order = mtt->mtt_type == MTT_TYPE_WQE ? hr_dev->caps.mtt_ba_pg_sz : in hns_roce_ib_umem_write_mtt()
911 if (!(npage % (1 << (mtt->page_shift - PAGE_SHIFT)))) { in hns_roce_ib_umem_write_mtt()
912 if (page_addr & ((1 << mtt->page_shift) - 1)) { in hns_roce_ib_umem_write_mtt()
914 page_addr, mtt->page_shift); in hns_roce_ib_umem_write_mtt()
922 ret = hns_roce_write_mtt(hr_dev, mtt, n, i, in hns_roce_ib_umem_write_mtt()
933 ret = hns_roce_write_mtt(hr_dev, mtt, n, i, pages); in hns_roce_ib_umem_write_mtt()