[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/5] virtio: enable VIRTIO_F_RING_PACKED for all devices
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH 5/5] virtio: enable VIRTIO_F_RING_PACKED for all devices |
Date: |
Tue, 26 May 2020 18:29:57 +0100 |
User-agent: |
Mutt/1.13.4 (2020-02-15) |
* Stefan Hajnoczi (address@hidden) wrote:
> The packed virtqueue layout was introduced in VIRTIO 1.1. It is a single
> ring instead of a split avail/used ring design. There are CPU cache
> advantages to this layout and it is also suited better to hardware
> implementation.
>
> The vhost-net backend has already supported packed virtqueues for some
> time. Performance benchmarks show that virtio-blk performance on NVMe
> drives is also improved.
>
> Go ahead and enable this feature for all VIRTIO devices. Keep it
> disabled for QEMU 5.0 and earlier machine types.
>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
> ---
> include/hw/virtio/virtio.h | 2 +-
> hw/core/machine.c | 18 +++++++++++++++++-
> 2 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index b69d517496..fd5b4a2044 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -292,7 +292,7 @@ typedef struct VirtIORNGConf VirtIORNGConf;
> DEFINE_PROP_BIT64("iommu_platform", _state, _field, \
> VIRTIO_F_IOMMU_PLATFORM, false), \
> DEFINE_PROP_BIT64("packed", _state, _field, \
> - VIRTIO_F_RING_PACKED, false)
> + VIRTIO_F_RING_PACKED, true)
>
> hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n);
> bool virtio_queue_enabled(VirtIODevice *vdev, int n);
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index bb3a7b18b1..3598c3c825 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -28,7 +28,23 @@
> #include "hw/mem/nvdimm.h"
> #include "migration/vmstate.h"
>
> -GlobalProperty hw_compat_5_0[] = {};
> +GlobalProperty hw_compat_5_0[] = {
> + { "vhost-user-blk", "packed", "off" },
> + { "vhost-user-fs-device", "packed", "off" },
> + { "vhost-vsock-device", "packed", "off" },
> + { "virtio-9p-device", "packed", "off" },
> + { "virtio-balloon-device", "packed", "off" },
> + { "virtio-blk-device", "packed", "off" },
> + { "virtio-crypto-device", "packed", "off" },
> + { "virtio-gpu-device", "packed", "off" },
> + { "virtio-input-device", "packed", "off" },
> + { "virtio-iommu-device", "packed", "off" },
> + { "virtio-net-device", "packed", "off" },
> + { "virtio-pmem", "packed", "off" },
> + { "virtio-rng-device", "packed", "off" },
> + { "virtio-scsi-common", "packed", "off" },
> + { "virtio-serial-device", "packed", "off" },
> +};
> const size_t hw_compat_5_0_len = G_N_ELEMENTS(hw_compat_5_0);
>
> GlobalProperty hw_compat_4_2[] = {
> --
> 2.25.3
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- Re: [PATCH 2/5] vhost: involve device backends in feature negotiation, (continued)
[PATCH 3/5] vhost-user-blk: add VIRTIO_F_RING_PACKED feature bit, Stefan Hajnoczi, 2020/05/22
[PATCH 4/5] vhost-scsi: add VIRTIO_F_VERSION_1 and VIRTIO_F_RING_PACKED, Stefan Hajnoczi, 2020/05/22
[PATCH 5/5] virtio: enable VIRTIO_F_RING_PACKED for all devices, Stefan Hajnoczi, 2020/05/22