Lines Matching full:length
25 int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length) in mr_check_range() argument
35 if (iova < mr->ibmr.iova || length > mr->ibmr.length || in mr_check_range()
36 iova > mr->ibmr.iova + mr->ibmr.length - length) in mr_check_range()
115 int rxe_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, u64 iova, in rxe_mr_init_user() argument
127 umem = ib_umem_get(&rxe->ib_dev, start, length, access); in rxe_mr_init_user()
151 if (length > 0) { in rxe_mr_init_user()
222 u64 length; in lookup_iova() local
233 length = mr->map[map_index]->buf[buf_index].size; in lookup_iova()
235 while (offset >= length) { in lookup_iova()
236 offset -= length; in lookup_iova()
243 length = mr->map[map_index]->buf[buf_index].size; in lookup_iova()
252 void *iova_to_vaddr(struct rxe_mr *mr, u64 iova, int length) in iova_to_vaddr() argument
269 if (mr_check_range(mr, iova, length)) { in iova_to_vaddr()
277 if (offset + length > mr->map[m]->buf[n].size) { in iova_to_vaddr()
289 /* copy data from a range (vaddr, vaddr+length-1) to or from
292 int rxe_mr_copy(struct rxe_mr *mr, u64 iova, void *addr, int length, in rxe_mr_copy() argument
304 if (length == 0) in rxe_mr_copy()
314 memcpy(dest, src, length); in rxe_mr_copy()
321 err = mr_check_range(mr, iova, length); in rxe_mr_copy()
332 while (length > 0) { in rxe_mr_copy()
341 if (bytes > length) in rxe_mr_copy()
342 bytes = length; in rxe_mr_copy()
346 length -= bytes; in rxe_mr_copy()
374 int length, in copy_data() argument
385 if (length == 0) in copy_data()
388 if (length > resid) { in copy_data()
393 if (sge->length && (offset < sge->length)) { in copy_data()
401 while (length > 0) { in copy_data()
402 bytes = length; in copy_data()
404 if (offset >= sge->length) { in copy_data()
418 if (sge->length) { in copy_data()
430 if (bytes > sge->length - offset) in copy_data()
431 bytes = sge->length - offset; in copy_data()
442 length -= bytes; in copy_data()
462 int advance_dma_data(struct rxe_dma_info *dma, unsigned int length) in advance_dma_data() argument
468 while (length) { in advance_dma_data()
471 if (offset >= sge->length) { in advance_dma_data()
479 bytes = length; in advance_dma_data()
481 if (bytes > sge->length - offset) in advance_dma_data()
482 bytes = sge->length - offset; in advance_dma_data()
486 length -= bytes; in advance_dma_data()