Lines Matching refs:mtt
195 struct mlx4_mtt *mtt) in mlx4_mtt_init() argument
200 mtt->order = -1; in mlx4_mtt_init()
201 mtt->page_shift = MLX4_ICM_PAGE_SHIFT; in mlx4_mtt_init()
204 mtt->page_shift = page_shift; in mlx4_mtt_init()
206 for (mtt->order = 0, i = 1; i < npages; i <<= 1) in mlx4_mtt_init()
207 ++mtt->order; in mlx4_mtt_init()
209 mtt->offset = mlx4_alloc_mtt_range(dev, mtt->order); in mlx4_mtt_init()
210 if (mtt->offset == -1) in mlx4_mtt_init()
251 void mlx4_mtt_cleanup(struct mlx4_dev *dev, struct mlx4_mtt *mtt) in mlx4_mtt_cleanup() argument
253 if (mtt->order < 0) in mlx4_mtt_cleanup()
256 mlx4_free_mtt_range(dev, mtt->offset, mtt->order); in mlx4_mtt_cleanup()
260 u64 mlx4_mtt_addr(struct mlx4_dev *dev, struct mlx4_mtt *mtt) in mlx4_mtt_addr() argument
262 return (u64) mtt->offset * dev->caps.mtt_entry_sz; in mlx4_mtt_addr()
428 return mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); in mlx4_mr_alloc_reserved()
562 mlx4_mtt_cleanup(dev, &mr->mtt); in mlx4_mr_free_reserved()
584 mlx4_mtt_cleanup(dev, &mr->mtt); in mlx4_mr_rereg_mem_cleanup()
585 mr->mtt.order = -1; in mlx4_mr_rereg_mem_cleanup()
595 err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); in mlx4_mr_rereg_mem_write()
604 if (mr->mtt.order < 0) { in mlx4_mr_rereg_mem_write()
609 &mr->mtt)); in mlx4_mr_rereg_mem_write()
610 if (mr->mtt.page_shift == 0) in mlx4_mr_rereg_mem_write()
611 mpt_entry->mtt_sz = cpu_to_be32(1 << mr->mtt.order); in mlx4_mr_rereg_mem_write()
613 if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) { in mlx4_mr_rereg_mem_write()
651 mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift); in mlx4_mr_enable()
653 if (mr->mtt.order < 0) { in mlx4_mr_enable()
658 &mr->mtt)); in mlx4_mr_enable()
661 if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) { in mlx4_mr_enable()
666 mpt_entry->mtt_sz = cpu_to_be32(1 << mr->mtt.order); in mlx4_mr_enable()
692 static int mlx4_write_mtt_chunk(struct mlx4_dev *dev, struct mlx4_mtt *mtt, in mlx4_write_mtt_chunk() argument
700 mtts = mlx4_table_find(&priv->mr_table.mtt_table, mtt->offset + in mlx4_write_mtt_chunk()
718 int __mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, in __mlx4_write_mtt() argument
728 max_mtts_first_page = mtts_per_page - (mtt->offset + start_index) in __mlx4_write_mtt()
734 err = mlx4_write_mtt_chunk(dev, mtt, start_index, chunk, page_list); in __mlx4_write_mtt()
746 int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, in mlx4_write_mtt() argument
755 if (mtt->order < 0) in mlx4_write_mtt()
767 inbox[0] = cpu_to_be64(mtt->offset + start_index); in mlx4_write_mtt()
786 return __mlx4_write_mtt(dev, mtt, start_index, npages, page_list); in mlx4_write_mtt()
790 int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, in mlx4_buf_write_mtt() argument
807 err = mlx4_write_mtt(dev, mtt, 0, buf->npages, page_list); in mlx4_buf_write_mtt()