virtio: Introduce virtio_max_dma_size()
authorJoerg Roedel <jroedel@suse.de>
Thu, 7 Feb 2019 11:59:16 +0000 (12:59 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 6 Mar 2019 16:19:15 +0000 (11:19 -0500)
commite6d6dd6c875eb3c9b69bb640419405726e6e0bbe
tree0392d073aef16f875c6772cdda08554d8798a45a
parent133d624b1cee16906134e92d5befb843b58bcf31
virtio: Introduce virtio_max_dma_size()

This function returns the maximum segment size for a single
dma transaction of a virtio device. The possible limit comes
from the SWIOTLB implementation in the Linux kernel, that
has an upper limit of (currently) 256kb of contiguous
memory it can map. Other DMA-API implementations might also
have limits.

Use the new dma_max_mapping_size() function to determine the
maximum mapping size when DMA-API is in use for virtio.

Cc: stable@vger.kernel.org
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_ring.c
include/linux/virtio.h