Lines Matching refs:mtt

211 	struct mthca_mtt *mtt;
217 mtt = kmalloc(sizeof *mtt, GFP_KERNEL);
218 if (!mtt)
221 mtt->buddy = buddy;
222 mtt->order = 0;
224 ++mtt->order;
226 mtt->first_seg = mthca_alloc_mtt_range(dev, mtt->order, buddy);
227 if (mtt->first_seg == -1) {
228 kfree(mtt);
232 return mtt;
240 void mthca_free_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt)
242 if (!mtt)
245 mthca_buddy_free(mtt->buddy, mtt->first_seg, mtt->order);
248 mtt->first_seg,
249 mtt->first_seg + (1 << mtt->order) - 1);
251 kfree(mtt);
254 static int __mthca_write_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt,
269 mtt->first_seg * dev->limits.mtt_seg_size +
316 struct mthca_mtt *mtt, int start_index,
322 mtts = dev->mr_table.tavor_fmr.mtt_base + mtt->first_seg * dev->limits.mtt_seg_size +
330 struct mthca_mtt *mtt, int start_index,
343 mtts = mthca_table_find(dev->mr_table.mtt_table, mtt->first_seg +
358 int mthca_write_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt,
366 return __mthca_write_mtt(dev, mtt, start_index, buffer_list, list_len);
371 mthca_arbel_write_mtt_seg(dev, mtt, start_index,
374 mthca_tavor_write_mtt_seg(dev, mtt, start_index,
463 if (!mr->mtt)
475 if (mr->mtt)
478 mr->mtt->first_seg * dev->limits.mtt_seg_size);
515 mr->mtt = NULL;
526 mr->mtt = mthca_alloc_mtt(dev, list_len);
527 if (IS_ERR(mr->mtt))
528 return PTR_ERR(mr->mtt);
530 err = mthca_write_mtt(dev, mr->mtt, 0, buffer_list, list_len);
532 mthca_free_mtt(dev, mr->mtt);
539 mthca_free_mtt(dev, mr->mtt);
564 mthca_free_mtt(dev, mr->mtt);
607 mr->mtt = __mthca_alloc_mtt(dev, list_len, dev->mr_table.fmr_mtt_buddy);
608 if (IS_ERR(mr->mtt)) {
609 err = PTR_ERR(mr->mtt);
613 mtt_seg = mr->mtt->first_seg * dev->limits.mtt_seg_size;
617 mr->mtt->first_seg,
668 mthca_free_mtt(dev, mr->mtt);
684 mthca_free_mtt(dev, fmr->mtt);