On Tue, Mar 19, 2024 at 01:02:21PM -0400, Michael S. Tsirkin wrote:
On Tue, Mar 19, 2024 at 05:36:01PM +0100, Stefano Garzarella wrote:
On Mon, Feb 19, 2024 at 02:56:04AM +0800, Zhu Lingshan wrote:
> This commits reports write zeroes configuration of
> virtio-block devices to user space, includes:
> 1)maximum write zeroes sectors size
> 2)maximum write zeroes segment number
>
> Signed-off-by: Zhu Lingshan <lingshan.zhu@xxxxxxxxx>
> ---
> drivers/vdpa/vdpa.c | 23 +++++++++++++++++++++++
> include/uapi/linux/vdpa.h | 2 ++
> 2 files changed, 25 insertions(+)
>
> diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c
> index bf3fa90908a7..adbcbc7b18b2 100644
> --- a/drivers/vdpa/vdpa.c
> +++ b/drivers/vdpa/vdpa.c
> @@ -1064,6 +1064,26 @@ static int vdpa_dev_blk_discard_config_fill(struct sk_buff *msg, u64 features,
> return 0;
> }
>
> +static int
> +vdpa_dev_blk_write_zeroes_config_fill(struct sk_buff *msg, u64 features,
> + const struct virtio_blk_config *config)
> +{
> + u32 val_u32;
> +
> + if ((features & BIT_ULL(VIRTIO_BLK_F_WRITE_ZEROES)) == 0)
> + return 0;
> +
> + val_u32 = __virtio32_to_cpu(true, config->max_write_zeroes_sectors);
> + if (nla_put_u32(msg, VDPA_ATTR_DEV_BLK_CFG_MAX_WRITE_ZEROES_SEC, val_u32))
> + return -EMSGSIZE;
> +
> + val_u32 = __virtio32_to_cpu(true, config->max_write_zeroes_seg);
> + if (nla_put_u32(msg, VDPA_ATTR_DEV_BLK_CFG_MAX_WRITE_ZEROES_SEG, val_u32))
> + return -EMSGSIZE;
Should we cover also `config->write_zeroes_may_unmap` ?
This review came too late I applied the patch. Generally
if I don't see any response in about
a week I assume there is not interest.
Ooops, sorry about that! I should add me as a reviewer for vDPA
otherwise lately it's hard for me to monitor patches :-(
BTW, some comments can be resolved with later patches if you think it
makes sense to resolve them.
Thanks,
Stefano