Commit 4b7f7e20 authored by Rusty Russell's avatar Rusty Russell

virtio: set max_segment_size and max_sectors to infinite.

Setting max_segment_size allows more than 64k per sg element, unless
the host specified a limit.  Setting max_sectors indicates that our
max_hw_segments is the only limit.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 1b4aa2fa
...@@ -277,6 +277,9 @@ static int virtblk_probe(struct virtio_device *vdev) ...@@ -277,6 +277,9 @@ static int virtblk_probe(struct virtio_device *vdev)
} }
set_capacity(vblk->disk, cap); set_capacity(vblk->disk, cap);
/* No real sector limit. */
blk_queue_max_sectors(vblk->disk->queue, -1U);
/* Host can optionally specify maximum segment size and number of /* Host can optionally specify maximum segment size and number of
* segments. */ * segments. */
err = virtio_config_val(vdev, VIRTIO_BLK_F_SIZE_MAX, err = virtio_config_val(vdev, VIRTIO_BLK_F_SIZE_MAX,
...@@ -284,6 +287,8 @@ static int virtblk_probe(struct virtio_device *vdev) ...@@ -284,6 +287,8 @@ static int virtblk_probe(struct virtio_device *vdev)
&v); &v);
if (!err) if (!err)
blk_queue_max_segment_size(vblk->disk->queue, v); blk_queue_max_segment_size(vblk->disk->queue, v);
else
blk_queue_max_segment_size(vblk->disk->queue, -1UL);
err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX, err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX,
offsetof(struct virtio_blk_config, seg_max), offsetof(struct virtio_blk_config, seg_max),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment