Skip to content
Commit 95bfec41 authored by Dmitry Fomichev's avatar Dmitry Fomichev Committed by Michael S. Tsirkin
Browse files

virtio-blk: add support for zoned block devices



This patch adds support for Zoned Block Devices (ZBDs) to the kernel
virtio-blk driver.

The patch accompanies the virtio-blk ZBD support draft that is now
being proposed for standardization. The latest version of the draft is
linked at

https://github.com/oasis-tcs/virtio-spec/issues/143 .

The QEMU zoned device code that implements these protocol extensions
has been developed by Sam Li and it is currently in review at the QEMU
mailing list.

A number of virtblk request structure changes has been introduced to
accommodate the functionality that is specific to zoned block devices
and, most importantly, make room for carrying the Zoned Append sector
value from the device back to the driver along with the request status.

The zone-specific code in the patch is heavily influenced by NVMe ZNS
code in drivers/nvme/host/zns.c, but it is simpler because the proposed
virtio ZBD draft only covers the zoned device features that are
relevant to the zoned functionality provided by Linux block layer.

includes the following fixup:

virtio-blk: fix probe without CONFIG_BLK_DEV_ZONED

When building without CONFIG_BLK_DEV_ZONED, VIRTIO_BLK_F_ZONED
is excluded from array of driver features.
As a result virtio_has_feature panics in virtio_check_driver_offered_feature
since that by design verifies that a feature we are checking for
is listed in the feature array.

To fix, replace the call to virtio_has_feature with a stub.

Message-Id: <20221016034127.330942-3-dmitry.fomichev@wdc.com>
Co-developed-by: default avatarStefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: default avatarDmitry Fomichev <dmitry.fomichev@wdc.com>
Message-Id: <20221220112340.518841-1-mst@redhat.com>
Reported-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
Tested-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
Reported-by: default avatarXuan Zhuo <xuanzhuo@linux.alibaba.com>
Debugged-by: default avatarXuan Zhuo <xuanzhuo@linux.alibaba.com>
Tested-by: default avatarAnders Roxell <anders.roxell@linaro.org>
Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
parent d16c0cd2
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