diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2020-12-17 15:52:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-17 15:52:18 +0000 |
commit | a764a3d66eb5a04dea769be15d88ef0ac4e5a5ea (patch) | |
tree | e78b28a2ec436ff9550bcaea765683311bcb7989 /lib/dma.c | |
parent | ff70ca1a9f97feae62e326eca39624c13aa8117f (diff) | |
download | libvfio-user-a764a3d66eb5a04dea769be15d88ef0ac4e5a5ea.zip libvfio-user-a764a3d66eb5a04dea769be15d88ef0ac4e5a5ea.tar.gz libvfio-user-a764a3d66eb5a04dea769be15d88ef0ac4e5a5ea.tar.bz2 |
add mappable bit in DMA segment (#215)
remove duplicate code for initializing DMA segment, mark DMA segment whether it's mappable, plus basic unit test for dma_addr_to_sg
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/dma.c')
-rw-r--r-- | lib/dma.c | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -375,13 +375,7 @@ _dma_addr_sg_split(const dma_controller_t *dma, size_t region_len = MIN(region_end - dma_addr, len); if (cnt < max_sg) { - sg[cnt].dma_addr = region->dma_addr; - sg[cnt].region = idx; - sg[cnt].offset = dma_addr - region->dma_addr; - sg[cnt].length = region_len; - if (_dma_should_mark_dirty(dma, prot)) { - _dma_mark_dirty(dma, region, sg); - } + dma_init_sg(dma, sg, dma_addr, region_len, prot, idx); } cnt++; |