qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	cohuck@redhat.com, "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Raphael Norwitz" <raphael.norwitz@nutanix.com>,
	"Gonglei (Arei)" <arei.gonglei@huawei.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Fam Zheng" <fam@euphon.net>, "Max Reitz" <mreitz@redhat.com>
Subject: Re: [PATCH 5/5] virtio: enable VIRTIO_F_RING_PACKED for all devices
Date: Fri, 29 May 2020 15:15:59 +0800	[thread overview]
Message-ID: <8e3a0ac5-9294-ca7e-071e-3074c43204c3@redhat.com> (raw)
In-Reply-To: <20200522171726.648279-6-stefanha@redhat.com>


On 2020/5/23 上午1:17, Stefan Hajnoczi 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 <stefanha@redhat.com>
> ---
>   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" },


Missing "vhost-user-gpu" here?

I try to do something like this in the past but give up since I end up 
with similar list.

It would be better to consider something more smart, probably need some 
refactor for a common parent class.

Thanks


> +};
>   const size_t hw_compat_5_0_len = G_N_ELEMENTS(hw_compat_5_0);
>   
>   GlobalProperty hw_compat_4_2[] = {



  parent reply	other threads:[~2020-05-29  7:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 17:17 [PATCH 0/5] virtio: enable VIRTIO_F_RING_PACKED for all devices Stefan Hajnoczi
2020-05-22 17:17 ` [PATCH 1/5] tests/libqos: mask out VIRTIO_F_RING_PACKED for now Stefan Hajnoczi
2020-05-22 19:21   ` Thomas Huth
2020-05-22 17:17 ` [PATCH 2/5] vhost: involve device backends in feature negotiation Stefan Hajnoczi
2020-05-27 14:28   ` Marc-André Lureau
2020-05-29 15:20     ` Stefan Hajnoczi
2020-05-29  7:04   ` Jason Wang
2020-05-29 13:56     ` Stefan Hajnoczi
2020-05-29 14:29       ` Dr. David Alan Gilbert
2020-06-03 14:44         ` Stefan Hajnoczi
2020-06-01 12:51       ` Jason Wang
2020-06-03 14:39         ` Stefan Hajnoczi
2020-05-22 17:17 ` [PATCH 3/5] vhost-user-blk: add VIRTIO_F_RING_PACKED feature bit Stefan Hajnoczi
2020-05-25  4:06   ` Raphael Norwitz
2020-05-22 17:17 ` [PATCH 4/5] vhost-scsi: add VIRTIO_F_VERSION_1 and VIRTIO_F_RING_PACKED Stefan Hajnoczi
2020-05-25  4:02   ` Raphael Norwitz
2020-05-22 17:17 ` [PATCH 5/5] virtio: enable VIRTIO_F_RING_PACKED for all devices Stefan Hajnoczi
2020-05-26 17:29   ` Dr. David Alan Gilbert
2020-05-29  7:15   ` Jason Wang [this message]
2020-05-29 15:28     ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e3a0ac5-9294-ca7e-071e-3074c43204c3@redhat.com \
    --to=jasowang@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=cohuck@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=fam@euphon.net \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael.norwitz@nutanix.com \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).