[PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-31 Thread Joerg Roedel
From: Joerg Roedel Segments can't be larger than the maximum DMA mapping size supported on the platform. Take that into account when setting the maximum segment size for a block device. Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Christoph Hellwig Signed-off-by: Joerg Roedel ---

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-29 Thread Christoph Hellwig
On Tue, Jan 29, 2019 at 09:43:42AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > Segments can't be larger than the maximum DMA mapping size > supported on the platform. Take that into account when > setting the maximum segment size for a block device. > > Reviewed-by: Konrad Rzeszutek

[PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-29 Thread Joerg Roedel
From: Joerg Roedel Segments can't be larger than the maximum DMA mapping size supported on the platform. Take that into account when setting the maximum segment size for a block device. Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Joerg Roedel --- drivers/block/virtio_blk.c | 10

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-28 Thread Christoph Hellwig
On Mon, Jan 28, 2019 at 12:14:33PM -0500, Michael S. Tsirkin wrote: > On Mon, Jan 28, 2019 at 09:05:26AM +0100, Christoph Hellwig wrote: > > On Thu, Jan 24, 2019 at 10:51:51AM +0100, Joerg Roedel wrote: > > > On Thu, Jan 24, 2019 at 09:42:21AM +0100, Christoph Hellwig wrote: > > > > Yes. But more

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-28 Thread Michael S. Tsirkin
On Mon, Jan 28, 2019 at 09:05:26AM +0100, Christoph Hellwig wrote: > On Thu, Jan 24, 2019 at 10:51:51AM +0100, Joerg Roedel wrote: > > On Thu, Jan 24, 2019 at 09:42:21AM +0100, Christoph Hellwig wrote: > > > Yes. But more importantly it would fix the limit for all other block > > > drivers that

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-28 Thread Christoph Hellwig
On Thu, Jan 24, 2019 at 10:51:51AM +0100, Joerg Roedel wrote: > On Thu, Jan 24, 2019 at 09:42:21AM +0100, Christoph Hellwig wrote: > > Yes. But more importantly it would fix the limit for all other block > > drivers that set large segment sizes when running over swiotlb. > > True, so it would be

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-24 Thread Joerg Roedel
On Thu, Jan 24, 2019 at 09:42:21AM +0100, Christoph Hellwig wrote: > Yes. But more importantly it would fix the limit for all other block > drivers that set large segment sizes when running over swiotlb. True, so it would be something like the diff below? I havn't worked on the block layer, so I

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-24 Thread Christoph Hellwig
On Thu, Jan 24, 2019 at 09:40:11AM +0100, Joerg Roedel wrote: > > I wonder if we should just move the dma max segment size check > > into blk_queue_max_segment_size so that all block drivers benefit > > from it. Even if not I think at least the SCSI midlayer should > > be updated to support it. >

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-24 Thread Joerg Roedel
On Wed, Jan 23, 2019 at 10:31:39PM +0100, Christoph Hellwig wrote: > On Wed, Jan 23, 2019 at 05:30:49PM +0100, Joerg Roedel wrote: > > + max_size = virtio_max_dma_size(vdev); > > + > > /* Host can optionally specify maximum segment size and number of > > * segments. */ > > err =

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-23 Thread Michael S. Tsirkin
On Wed, Jan 23, 2019 at 10:31:39PM +0100, Christoph Hellwig wrote: > On Wed, Jan 23, 2019 at 05:30:49PM +0100, Joerg Roedel wrote: > > + max_size = virtio_max_dma_size(vdev); > > + > > /* Host can optionally specify maximum segment size and number of > > * segments. */ > > err =

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-23 Thread Christoph Hellwig
On Wed, Jan 23, 2019 at 05:30:49PM +0100, Joerg Roedel wrote: > + max_size = virtio_max_dma_size(vdev); > + > /* Host can optionally specify maximum segment size and number of >* segments. */ > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SIZE_MAX, >

[PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel Segments can't be larger than the maximum DMA mapping size supported on the platform. Take that into account when setting the maximum segment size for a block device. Signed-off-by: Joerg Roedel --- drivers/block/virtio_blk.c | 10 ++ 1 file changed, 6