Lines Matching refs:mtt
209 struct mthca_mtt *mtt;
215 mtt = kmalloc(sizeof *mtt, GFP_KERNEL);
216 if (!mtt)
219 mtt->buddy = buddy;
220 mtt->order = 0;
222 ++mtt->order;
224 mtt->first_seg = mthca_alloc_mtt_range(dev, mtt->order, buddy);
225 if (mtt->first_seg == -1) {
226 kfree(mtt);
230 return mtt;
238 void mthca_free_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt)
240 if (!mtt)
243 mthca_buddy_free(mtt->buddy, mtt->first_seg, mtt->order);
246 mtt->first_seg,
247 mtt->first_seg + (1 << mtt->order) - 1);
249 kfree(mtt);
252 static int __mthca_write_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt,
267 mtt->first_seg * dev->limits.mtt_seg_size +
314 struct mthca_mtt *mtt, int start_index,
320 mtts = dev->mr_table.tavor_fmr.mtt_base + mtt->first_seg * dev->limits.mtt_seg_size +
328 struct mthca_mtt *mtt, int start_index,
341 mtts = mthca_table_find(dev->mr_table.mtt_table, mtt->first_seg +
356 int mthca_write_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt,
364 return __mthca_write_mtt(dev, mtt, start_index, buffer_list, list_len);
369 mthca_arbel_write_mtt_seg(dev, mtt, start_index,
372 mthca_tavor_write_mtt_seg(dev, mtt, start_index,
461 if (!mr->mtt)
472 if (mr->mtt)
475 mr->mtt->first_seg * dev->limits.mtt_seg_size);
512 mr->mtt = NULL;
523 mr->mtt = mthca_alloc_mtt(dev, list_len);
524 if (IS_ERR(mr->mtt))
525 return PTR_ERR(mr->mtt);
527 err = mthca_write_mtt(dev, mr->mtt, 0, buffer_list, list_len);
529 mthca_free_mtt(dev, mr->mtt);
536 mthca_free_mtt(dev, mr->mtt);
561 mthca_free_mtt(dev, mr->mtt);