summaryrefslogtreecommitdiff
path: root/t4ht-workaround
diff options
context:
space:
mode:
authorChangpeng Liu <changpeng.liu@intel.com>2018-03-09 10:44:23 +0800
committerMichael S. Tsirkin <mst@redhat.com>2018-03-20 02:34:04 +0200
commit88c8553838346b26be4460485cc57c38850b36f7 (patch)
tree17453361e58dceccb5ecb16b5e73c4eb16d5330b /t4ht-workaround
parentad89d36f241c9f1583bf625e6be3fb5226dec655 (diff)
virtio-blk: add discard and write zeroes features to specification
Existing virtio-blk protocol doesn't have DISCARD/WRITE ZEROES support, this will impact the performance when using SSD backend over file systems. Here is the proposal to extend existing virtio-blk protocol to support DISCARD/WRITE ZEROES commands. Basic idea here is using 16 Bytes payload to support 1 descriptor, users can put several segments together with 1 DISCARD/WRITE ZEROES command. struct virtio_blk_discard_write_zeroes { le64 sector; le32 num_sectors; struct { le32 unmap:1; le32 reserved:31; } flags; }; For the purpose to support such feature, we need to introduce 2 new feature flags: VIRTIO_BLK_F_DISCARD/VIRTIO_BLK_F_WRITE_ZEROES, and 2 new command types: VIRTIO_BLK_T_DISCARD/VIRTIO_BLK_T_WRITE_ZEROES. Also we introduce several new parameters in the configuration space of virtio-blk: max_discard_sectors/max_discard_seg/max_write_zeroes_sectors. These parameters will tell the OS what's the granularity when issuing such commands. If both DISCARD and WRITE ZEROES are supported, unmap flag bit maybe used for WRITE ZEROES command with DISCARD bit enabled. Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Approved-by: https://www.oasis-open.org/apps/org/workgroup/virtio/ballot.php?id=3181 Fixes: https://github.com/oasis-tcs/virtio-spec/issues/5
Diffstat (limited to 't4ht-workaround')
0 files changed, 0 insertions, 0 deletions