[PATCH v3 0/5] vhost-user-blk: dynamically resize config space based on features

Daniil Tatianin posted 5 patches 1 year, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220906073111.353245-1-d-tatianin@yandex-team.ru
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Raphael Norwitz <raphael.norwitz@nutanix.com>, Stefan Hajnoczi <stefanha@redhat.com>, Jason Wang <jasowang@redhat.com>
MAINTAINERS                           |  4 +++
hw/block/meson.build                  |  4 +--
hw/block/vhost-user-blk.c             | 29 +++++++++++---------
hw/block/virtio-blk-common.c          | 39 +++++++++++++++++++++++++++
hw/block/virtio-blk.c                 | 28 +++----------------
hw/net/virtio-net.c                   |  9 +++++--
hw/virtio/virtio.c                    | 10 ++++---
include/hw/virtio/vhost-user-blk.h    |  1 -
include/hw/virtio/virtio-blk-common.h | 20 ++++++++++++++
include/hw/virtio/virtio.h            | 10 +++++--
10 files changed, 105 insertions(+), 49 deletions(-)
create mode 100644 hw/block/virtio-blk-common.c
create mode 100644 include/hw/virtio/virtio-blk-common.h
[PATCH v3 0/5] vhost-user-blk: dynamically resize config space based on features
Posted by Daniil Tatianin 1 year, 7 months ago
This patch set attempts to align vhost-user-blk with virtio-blk in
terms of backward compatibility and flexibility. It also improves
the virtio core by introducing new common code that can be used by
a virtio device to calculate its config space size.

In particular it adds the following things:
- Common virtio code for deducing the required device config size based
  on provided host features.
- Ability to disable modern virtio-blk features like
  discard/write-zeroes for vhost-user-blk.
- Dynamic configuration space resizing based on enabled features,
  by reusing the common code introduced in the earlier commits.
- Cleans up the VHostUserBlk structure by reusing parent fields.

Changes since v1 (mostly addresses Stefan's feedback):
- Introduce VirtIOConfigSizeParams & virtio_get_config_size
- Remove virtio_blk_set_config_size altogether, make virtio-blk-common.c
  only hold the virtio-blk config size parameters.
- Reuse parent fields in vhost-user-blk instead of introducing new ones.

Changes since v2:
- Squash the first four commits into one
- Set .min_size for virtio-net as well
- Move maintainer/meson user-blk bits to the last commit

Daniil Tatianin (5):
  virtio: introduce VirtIOConfigSizeParams & virtio_get_config_size
  virtio-blk: move config size params to virtio-blk-common
  vhost-user-blk: make it possible to disable write-zeroes/discard
  vhost-user-blk: make 'config_wce' part of 'host_features'
  vhost-user-blk: dynamically resize config space based on features

 MAINTAINERS                           |  4 +++
 hw/block/meson.build                  |  4 +--
 hw/block/vhost-user-blk.c             | 29 +++++++++++---------
 hw/block/virtio-blk-common.c          | 39 +++++++++++++++++++++++++++
 hw/block/virtio-blk.c                 | 28 +++----------------
 hw/net/virtio-net.c                   |  9 +++++--
 hw/virtio/virtio.c                    | 10 ++++---
 include/hw/virtio/vhost-user-blk.h    |  1 -
 include/hw/virtio/virtio-blk-common.h | 20 ++++++++++++++
 include/hw/virtio/virtio.h            | 10 +++++--
 10 files changed, 105 insertions(+), 49 deletions(-)
 create mode 100644 hw/block/virtio-blk-common.c
 create mode 100644 include/hw/virtio/virtio-blk-common.h

-- 
2.25.1
Re: [PATCH v3 0/5] vhost-user-blk: dynamically resize config space based on features
Posted by Raphael Norwitz 1 year, 7 months ago
Thanks for the changes. For the whole series:

Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>

On Tue, Sep 06, 2022 at 10:31:06AM +0300, Daniil Tatianin wrote:
> This patch set attempts to align vhost-user-blk with virtio-blk in
> terms of backward compatibility and flexibility. It also improves
> the virtio core by introducing new common code that can be used by
> a virtio device to calculate its config space size.
> 
> In particular it adds the following things:
> - Common virtio code for deducing the required device config size based
>   on provided host features.
> - Ability to disable modern virtio-blk features like
>   discard/write-zeroes for vhost-user-blk.
> - Dynamic configuration space resizing based on enabled features,
>   by reusing the common code introduced in the earlier commits.
> - Cleans up the VHostUserBlk structure by reusing parent fields.
> 
> Changes since v1 (mostly addresses Stefan's feedback):
> - Introduce VirtIOConfigSizeParams & virtio_get_config_size
> - Remove virtio_blk_set_config_size altogether, make virtio-blk-common.c
>   only hold the virtio-blk config size parameters.
> - Reuse parent fields in vhost-user-blk instead of introducing new ones.
> 
> Changes since v2:
> - Squash the first four commits into one
> - Set .min_size for virtio-net as well
> - Move maintainer/meson user-blk bits to the last commit
> 
> Daniil Tatianin (5):
>   virtio: introduce VirtIOConfigSizeParams & virtio_get_config_size
>   virtio-blk: move config size params to virtio-blk-common
>   vhost-user-blk: make it possible to disable write-zeroes/discard
>   vhost-user-blk: make 'config_wce' part of 'host_features'
>   vhost-user-blk: dynamically resize config space based on features
> 
>  MAINTAINERS                           |  4 +++
>  hw/block/meson.build                  |  4 +--
>  hw/block/vhost-user-blk.c             | 29 +++++++++++---------
>  hw/block/virtio-blk-common.c          | 39 +++++++++++++++++++++++++++
>  hw/block/virtio-blk.c                 | 28 +++----------------
>  hw/net/virtio-net.c                   |  9 +++++--
>  hw/virtio/virtio.c                    | 10 ++++---
>  include/hw/virtio/vhost-user-blk.h    |  1 -
>  include/hw/virtio/virtio-blk-common.h | 20 ++++++++++++++
>  include/hw/virtio/virtio.h            | 10 +++++--
>  10 files changed, 105 insertions(+), 49 deletions(-)
>  create mode 100644 hw/block/virtio-blk-common.c
>  create mode 100644 include/hw/virtio/virtio-blk-common.h
> 
> -- 
> 2.25.1
> 
Re: [PATCH v3 0/5] vhost-user-blk: dynamically resize config space based on features
Posted by Daniil Tatianin 1 year, 7 months ago
Thanks for reviewing! Could you send a Pull request? Or do we need an 
ack from someone else?

On 9/7/22 7:02 AM, Raphael Norwitz wrote:
> Thanks for the changes. For the whole series:
> 
> Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
> 
> On Tue, Sep 06, 2022 at 10:31:06AM +0300, Daniil Tatianin wrote:
>> This patch set attempts to align vhost-user-blk with virtio-blk in
>> terms of backward compatibility and flexibility. It also improves
>> the virtio core by introducing new common code that can be used by
>> a virtio device to calculate its config space size.
>>
>> In particular it adds the following things:
>> - Common virtio code for deducing the required device config size based
>>    on provided host features.
>> - Ability to disable modern virtio-blk features like
>>    discard/write-zeroes for vhost-user-blk.
>> - Dynamic configuration space resizing based on enabled features,
>>    by reusing the common code introduced in the earlier commits.
>> - Cleans up the VHostUserBlk structure by reusing parent fields.
>>
>> Changes since v1 (mostly addresses Stefan's feedback):
>> - Introduce VirtIOConfigSizeParams & virtio_get_config_size
>> - Remove virtio_blk_set_config_size altogether, make virtio-blk-common.c
>>    only hold the virtio-blk config size parameters.
>> - Reuse parent fields in vhost-user-blk instead of introducing new ones.
>>
>> Changes since v2:
>> - Squash the first four commits into one
>> - Set .min_size for virtio-net as well
>> - Move maintainer/meson user-blk bits to the last commit
>>
>> Daniil Tatianin (5):
>>    virtio: introduce VirtIOConfigSizeParams & virtio_get_config_size
>>    virtio-blk: move config size params to virtio-blk-common
>>    vhost-user-blk: make it possible to disable write-zeroes/discard
>>    vhost-user-blk: make 'config_wce' part of 'host_features'
>>    vhost-user-blk: dynamically resize config space based on features
>>
>>   MAINTAINERS                           |  4 +++
>>   hw/block/meson.build                  |  4 +--
>>   hw/block/vhost-user-blk.c             | 29 +++++++++++---------
>>   hw/block/virtio-blk-common.c          | 39 +++++++++++++++++++++++++++
>>   hw/block/virtio-blk.c                 | 28 +++----------------
>>   hw/net/virtio-net.c                   |  9 +++++--
>>   hw/virtio/virtio.c                    | 10 ++++---
>>   include/hw/virtio/vhost-user-blk.h    |  1 -
>>   include/hw/virtio/virtio-blk-common.h | 20 ++++++++++++++
>>   include/hw/virtio/virtio.h            | 10 +++++--
>>   10 files changed, 105 insertions(+), 49 deletions(-)
>>   create mode 100644 hw/block/virtio-blk-common.c
>>   create mode 100644 include/hw/virtio/virtio-blk-common.h
>>
>> -- 
>> 2.25.1
Re: [PATCH v3 0/5] vhost-user-blk: dynamically resize config space based on features
Posted by Raphael Norwitz 1 year, 7 months ago
> Thanks for reviewing! Could you send a Pull request? Or do we need an 
> ack from someone else?

mst typically includes the vhost-user-blk patches in his PRs. Usually a few
other people review but I'm not sure it's required.

A lot of folks have been busy prepping for KVM Forum the last few weeks
so I would expect delayed responses/reviews.

Re: [PATCH v3 0/5] vhost-user-blk: dynamically resize config space based on features
Posted by Daniil Tatianin 1 year, 6 months ago
Ping :)

On 9/6/22 10:31 AM, Daniil Tatianin wrote:
> This patch set attempts to align vhost-user-blk with virtio-blk in
> terms of backward compatibility and flexibility. It also improves
> the virtio core by introducing new common code that can be used by
> a virtio device to calculate its config space size.
> 
> In particular it adds the following things:
> - Common virtio code for deducing the required device config size based
>    on provided host features.
> - Ability to disable modern virtio-blk features like
>    discard/write-zeroes for vhost-user-blk.
> - Dynamic configuration space resizing based on enabled features,
>    by reusing the common code introduced in the earlier commits.
> - Cleans up the VHostUserBlk structure by reusing parent fields.
> 
> Changes since v1 (mostly addresses Stefan's feedback):
> - Introduce VirtIOConfigSizeParams & virtio_get_config_size
> - Remove virtio_blk_set_config_size altogether, make virtio-blk-common.c
>    only hold the virtio-blk config size parameters.
> - Reuse parent fields in vhost-user-blk instead of introducing new ones.
> 
> Changes since v2:
> - Squash the first four commits into one
> - Set .min_size for virtio-net as well
> - Move maintainer/meson user-blk bits to the last commit
> 
> Daniil Tatianin (5):
>    virtio: introduce VirtIOConfigSizeParams & virtio_get_config_size
>    virtio-blk: move config size params to virtio-blk-common
>    vhost-user-blk: make it possible to disable write-zeroes/discard
>    vhost-user-blk: make 'config_wce' part of 'host_features'
>    vhost-user-blk: dynamically resize config space based on features
> 
>   MAINTAINERS                           |  4 +++
>   hw/block/meson.build                  |  4 +--
>   hw/block/vhost-user-blk.c             | 29 +++++++++++---------
>   hw/block/virtio-blk-common.c          | 39 +++++++++++++++++++++++++++
>   hw/block/virtio-blk.c                 | 28 +++----------------
>   hw/net/virtio-net.c                   |  9 +++++--
>   hw/virtio/virtio.c                    | 10 ++++---
>   include/hw/virtio/vhost-user-blk.h    |  1 -
>   include/hw/virtio/virtio-blk-common.h | 20 ++++++++++++++
>   include/hw/virtio/virtio.h            | 10 +++++--
>   10 files changed, 105 insertions(+), 49 deletions(-)
>   create mode 100644 hw/block/virtio-blk-common.c
>   create mode 100644 include/hw/virtio/virtio-blk-common.h
>
Re: [PATCH v3 0/5] vhost-user-blk: dynamically resize config space based on features
Posted by Daniil Tatianin 1 year, 6 months ago

On 10/11/22 10:20 AM, Daniil Tatianin wrote:
> Ping :)
Oops, didn't see the pull request. Disregard this.

> On 9/6/22 10:31 AM, Daniil Tatianin wrote:
>> This patch set attempts to align vhost-user-blk with virtio-blk in
>> terms of backward compatibility and flexibility. It also improves
>> the virtio core by introducing new common code that can be used by
>> a virtio device to calculate its config space size.
>>
>> In particular it adds the following things:
>> - Common virtio code for deducing the required device config size based
>>    on provided host features.
>> - Ability to disable modern virtio-blk features like
>>    discard/write-zeroes for vhost-user-blk.
>> - Dynamic configuration space resizing based on enabled features,
>>    by reusing the common code introduced in the earlier commits.
>> - Cleans up the VHostUserBlk structure by reusing parent fields.
>>
>> Changes since v1 (mostly addresses Stefan's feedback):
>> - Introduce VirtIOConfigSizeParams & virtio_get_config_size
>> - Remove virtio_blk_set_config_size altogether, make virtio-blk-common.c
>>    only hold the virtio-blk config size parameters.
>> - Reuse parent fields in vhost-user-blk instead of introducing new ones.
>>
>> Changes since v2:
>> - Squash the first four commits into one
>> - Set .min_size for virtio-net as well
>> - Move maintainer/meson user-blk bits to the last commit
>>
>> Daniil Tatianin (5):
>>    virtio: introduce VirtIOConfigSizeParams & virtio_get_config_size
>>    virtio-blk: move config size params to virtio-blk-common
>>    vhost-user-blk: make it possible to disable write-zeroes/discard
>>    vhost-user-blk: make 'config_wce' part of 'host_features'
>>    vhost-user-blk: dynamically resize config space based on features
>>
>>   MAINTAINERS                           |  4 +++
>>   hw/block/meson.build                  |  4 +--
>>   hw/block/vhost-user-blk.c             | 29 +++++++++++---------
>>   hw/block/virtio-blk-common.c          | 39 +++++++++++++++++++++++++++
>>   hw/block/virtio-blk.c                 | 28 +++----------------
>>   hw/net/virtio-net.c                   |  9 +++++--
>>   hw/virtio/virtio.c                    | 10 ++++---
>>   include/hw/virtio/vhost-user-blk.h    |  1 -
>>   include/hw/virtio/virtio-blk-common.h | 20 ++++++++++++++
>>   include/hw/virtio/virtio.h            | 10 +++++--
>>   10 files changed, 105 insertions(+), 49 deletions(-)
>>   create mode 100644 hw/block/virtio-blk-common.c
>>   create mode 100644 include/hw/virtio/virtio-blk-common.h
>>