• Home
  • Raw
  • Download

Lines Matching refs:mr

46 	struct ipath_mregion mr;        /* must be last */  member
65 struct ipath_mr *mr; in ipath_get_dma_mr() local
68 mr = kzalloc(sizeof *mr, GFP_KERNEL); in ipath_get_dma_mr()
69 if (!mr) { in ipath_get_dma_mr()
74 mr->mr.access_flags = acc; in ipath_get_dma_mr()
75 ret = &mr->ibmr; in ipath_get_dma_mr()
84 struct ipath_mr *mr; in alloc_mr() local
89 mr = kmalloc(sizeof *mr + m * sizeof mr->mr.map[0], GFP_KERNEL); in alloc_mr()
90 if (!mr) in alloc_mr()
95 mr->mr.map[i] = kmalloc(sizeof *mr->mr.map[0], GFP_KERNEL); in alloc_mr()
96 if (!mr->mr.map[i]) in alloc_mr()
99 mr->mr.mapsz = m; in alloc_mr()
105 if (!ipath_alloc_lkey(lk_table, &mr->mr)) in alloc_mr()
107 mr->ibmr.rkey = mr->ibmr.lkey = mr->mr.lkey; in alloc_mr()
114 kfree(mr->mr.map[i]); in alloc_mr()
116 kfree(mr); in alloc_mr()
117 mr = NULL; in alloc_mr()
120 return mr; in alloc_mr()
136 struct ipath_mr *mr; in ipath_reg_phys_mr() local
140 mr = alloc_mr(num_phys_buf, &to_idev(pd->device)->lk_table); in ipath_reg_phys_mr()
141 if (mr == NULL) { in ipath_reg_phys_mr()
146 mr->mr.pd = pd; in ipath_reg_phys_mr()
147 mr->mr.user_base = *iova_start; in ipath_reg_phys_mr()
148 mr->mr.iova = *iova_start; in ipath_reg_phys_mr()
149 mr->mr.length = 0; in ipath_reg_phys_mr()
150 mr->mr.offset = 0; in ipath_reg_phys_mr()
151 mr->mr.access_flags = acc; in ipath_reg_phys_mr()
152 mr->mr.max_segs = num_phys_buf; in ipath_reg_phys_mr()
153 mr->umem = NULL; in ipath_reg_phys_mr()
158 mr->mr.map[m]->segs[n].vaddr = (void *) buffer_list[i].addr; in ipath_reg_phys_mr()
159 mr->mr.map[m]->segs[n].length = buffer_list[i].size; in ipath_reg_phys_mr()
160 mr->mr.length += buffer_list[i].size; in ipath_reg_phys_mr()
168 ret = &mr->ibmr; in ipath_reg_phys_mr()
189 struct ipath_mr *mr; in ipath_reg_user_mr() local
206 mr = alloc_mr(n, &to_idev(pd->device)->lk_table); in ipath_reg_user_mr()
207 if (!mr) { in ipath_reg_user_mr()
213 mr->mr.pd = pd; in ipath_reg_user_mr()
214 mr->mr.user_base = start; in ipath_reg_user_mr()
215 mr->mr.iova = virt_addr; in ipath_reg_user_mr()
216 mr->mr.length = length; in ipath_reg_user_mr()
217 mr->mr.offset = umem->offset; in ipath_reg_user_mr()
218 mr->mr.access_flags = mr_access_flags; in ipath_reg_user_mr()
219 mr->mr.max_segs = n; in ipath_reg_user_mr()
220 mr->umem = umem; in ipath_reg_user_mr()
232 mr->mr.map[m]->segs[n].vaddr = vaddr; in ipath_reg_user_mr()
233 mr->mr.map[m]->segs[n].length = umem->page_size; in ipath_reg_user_mr()
240 ret = &mr->ibmr; in ipath_reg_user_mr()
257 struct ipath_mr *mr = to_imr(ibmr); in ipath_dereg_mr() local
261 i = mr->mr.mapsz; in ipath_dereg_mr()
264 kfree(mr->mr.map[i]); in ipath_dereg_mr()
267 if (mr->umem) in ipath_dereg_mr()
268 ib_umem_release(mr->umem); in ipath_dereg_mr()
270 kfree(mr); in ipath_dereg_mr()
291 fmr = kmalloc(sizeof *fmr + m * sizeof fmr->mr.map[0], GFP_KERNEL); in ipath_alloc_fmr()
297 fmr->mr.map[i] = kmalloc(sizeof *fmr->mr.map[0], in ipath_alloc_fmr()
299 if (!fmr->mr.map[i]) in ipath_alloc_fmr()
302 fmr->mr.mapsz = m; in ipath_alloc_fmr()
308 if (!ipath_alloc_lkey(&to_idev(pd->device)->lk_table, &fmr->mr)) in ipath_alloc_fmr()
310 fmr->ibfmr.rkey = fmr->ibfmr.lkey = fmr->mr.lkey; in ipath_alloc_fmr()
315 fmr->mr.pd = pd; in ipath_alloc_fmr()
316 fmr->mr.user_base = 0; in ipath_alloc_fmr()
317 fmr->mr.iova = 0; in ipath_alloc_fmr()
318 fmr->mr.length = 0; in ipath_alloc_fmr()
319 fmr->mr.offset = 0; in ipath_alloc_fmr()
320 fmr->mr.access_flags = mr_access_flags; in ipath_alloc_fmr()
321 fmr->mr.max_segs = fmr_attr->max_pages; in ipath_alloc_fmr()
329 kfree(fmr->mr.map[--i]); in ipath_alloc_fmr()
357 if (list_len > fmr->mr.max_segs) { in ipath_map_phys_fmr()
363 fmr->mr.user_base = iova; in ipath_map_phys_fmr()
364 fmr->mr.iova = iova; in ipath_map_phys_fmr()
366 fmr->mr.length = list_len * ps; in ipath_map_phys_fmr()
371 fmr->mr.map[m]->segs[n].vaddr = (void *) page_list[i]; in ipath_map_phys_fmr()
372 fmr->mr.map[m]->segs[n].length = ps; in ipath_map_phys_fmr()
400 fmr->mr.user_base = 0; in ipath_unmap_fmr()
401 fmr->mr.iova = 0; in ipath_unmap_fmr()
402 fmr->mr.length = 0; in ipath_unmap_fmr()
420 i = fmr->mr.mapsz; in ipath_dealloc_fmr()
422 kfree(fmr->mr.map[--i]); in ipath_dealloc_fmr()