virtio_ring: remove flags check for unmap packed indirect desc
When calling vring_unmap_desc_packed(), it will not encounter the situation that the flags contains VRING_DESC_F_INDIRECT. So remove this logic. Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Link: https://lore.kernel.org/r/20220224110402.108161-4-xuanzhuo@linux.alibaba.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
b4282ebc71
commit
920379a465
@ -1009,20 +1009,12 @@ static void vring_unmap_desc_packed(const struct vring_virtqueue *vq,
|
|||||||
|
|
||||||
flags = le16_to_cpu(desc->flags);
|
flags = le16_to_cpu(desc->flags);
|
||||||
|
|
||||||
if (flags & VRING_DESC_F_INDIRECT) {
|
|
||||||
dma_unmap_single(vring_dma_dev(vq),
|
|
||||||
le64_to_cpu(desc->addr),
|
|
||||||
le32_to_cpu(desc->len),
|
|
||||||
(flags & VRING_DESC_F_WRITE) ?
|
|
||||||
DMA_FROM_DEVICE : DMA_TO_DEVICE);
|
|
||||||
} else {
|
|
||||||
dma_unmap_page(vring_dma_dev(vq),
|
dma_unmap_page(vring_dma_dev(vq),
|
||||||
le64_to_cpu(desc->addr),
|
le64_to_cpu(desc->addr),
|
||||||
le32_to_cpu(desc->len),
|
le32_to_cpu(desc->len),
|
||||||
(flags & VRING_DESC_F_WRITE) ?
|
(flags & VRING_DESC_F_WRITE) ?
|
||||||
DMA_FROM_DEVICE : DMA_TO_DEVICE);
|
DMA_FROM_DEVICE : DMA_TO_DEVICE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static struct vring_packed_desc *alloc_indirect_packed(unsigned int total_sg,
|
static struct vring_packed_desc *alloc_indirect_packed(unsigned int total_sg,
|
||||||
gfp_t gfp)
|
gfp_t gfp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user