[PATCH v6] virtio_blk: add DISCARD and WRIET ZEROES commands support

2018-06-05 Thread Changpeng Liu
byte units if the VIRTIO_BLK_F_WRITE_ZEROES feature bit is negotiated. Signed-off-by: Changpeng Liu --- CHANGELOG: v6: don't set T_OUT bit to discard and write zeroes commands. v5: use new block layer API: blk_queue_flag_set. v4: several optimizations based on MST's comments, remove bit field usage for command desc

[PATCH v5] virtio_blk: add DISCARD and WRIET ZEROES commands support

2018-05-28 Thread Changpeng Liu
byte units if the VIRTIO_BLK_F_WRITE_ZEROES feature bit is negotiated. Signed-off-by: Changpeng Liu --- CHANGELOG: v5: use new block layer API: blk_queue_flag_set. v4: several optimizations based on MST's comments, remove bit field usage for command descriptor. v3: define the virtio-blk protocol to add discard

[PATCH v5] virtio_blk: add DISCARD and WRIET ZEROES commands support

2018-05-28 Thread Changpeng Liu
byte units if the VIRTIO_BLK_F_WRITE_ZEROES feature bit is negotiated. Signed-off-by: Changpeng Liu --- CHANGELOG: v5: use new block layer API: blk_queue_flag_set. v4: several optimizations based on MST's comments, remove bit field usage for command descriptor. v3: define the virtio-blk protocol to add discard

[PATCH v4] virtio_blk: add DISCARD and WRIET ZEROES commands support

2018-05-28 Thread Changpeng Liu
byte units if the VIRTIO_BLK_F_WRITE_ZEROES feature bit is negotiated. Signed-off-by: Changpeng Liu --- CHANGELOG: v4: several optimizations based on MST's comments, remove bit field usage for command descriptor. v3: define the virtio-blk protocol to add discard and write zeroes support, first version implementa

[PATCH v3] virtio_blk: add DISCARD and WRIET ZEROES command support

2018-03-29 Thread Changpeng Liu
commands. The specification change list here: https://github.com/oasis-tcs/virtio-spec CHANGELOG: v3: finalized the specification change. Signed-off-by: Changpeng Liu <changpeng@intel.com> --- drivers/block/virtio_blk.c | 96 +++-- include/uapi

[PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver

2017-07-04 Thread Changpeng Liu
VIRTIO_BLK_T_DISCARD to extend exist virtio-blk protocol, define 16 bytes discard descriptor for each discard segment, the discard segment defination aligns with SCSI or NVM Express protocols, virtio-blk driver will support multi-range discard request as well. Signed-off-by: Changpeng Liu <changp

[PATCH] virtio-blk: add DISCARD support to virtio-blk driver

2017-03-27 Thread Changpeng Liu
VIRTIO_BLK_T_DISCARD to extend exist virtio-blk protocol. virtio-blk protocol uses a single 8 bytes descriptor containing type,reserved and sector, currently Linux uses the reserved field as IO priority, here we also re-use the reserved field as number of discard sectors. Signed-off-by: Changpeng Liu

[RFC] virtio_blk: add DISCARD support to virtio_blk driver

2017-03-20 Thread Changpeng Liu
Currently virtio_blk driver does not provide discard feature flag, so the filesystems which built on top of the block device will not send discard command. This is okay for HDD backend, but it will impact the performance for SSD backend. Add a feature flag such as VIRTIO_BLK_F_DISCARD to

[RFC] virtio_blk: add DISCARD support to virtio_blk driver

2017-03-19 Thread Changpeng Liu
Currently virtio_blk driver does not provide discard feature flag, so the filesystems which built on top of the block device will not send discard command. This is okay for HDD backend, but it will impact the performance for SSD backend. Add a feature flag such as VIRTIO_BLK_F_DISCARD to