From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Srujana Challa <schalla@marvell.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com, jasowang@redhat.com, vattunuru@marvell.com,
jerinj@marvell.com
Subject: Re: [PATCH v3] virtio-pci: correctly set virtio pci queue mem multiplier
Date: Fri, 23 Feb 2024 06:46:55 +0100 [thread overview]
Message-ID: <62e08b11-81ca-40e3-a761-592f4c0b0976@linaro.org> (raw)
In-Reply-To: <20240223052617.1867132-1-schalla@marvell.com>
Hi Srujana,
On 23/2/24 06:26, Srujana Challa wrote:
> Currently, virtio_pci_queue_mem_mult function always returns 4K
> when VIRTIO_PCI_FLAG_PAGE_PER_VQ is set. But this won't
> work for vhost vdpa when host has page size other than 4K.
> This patch introduces a new property(host-page-per-vq) for vdpa
> use case to fix the same.
>
> Signed-off-by: Srujana Challa <schalla@marvell.com>
> ---
> v2->v3:
> - Modified property name, page-per-vdpa-vq to host-page-per-vq.
>
> v1->v2:
> - Introduced a new property to get virtqueue mem multiplier for
> vdpa use case.
>
> hw/virtio/virtio-pci.c | 10 ++++++++--
> include/hw/virtio/virtio-pci.h | 5 +++++
> 2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 1a7039fb0c..f29e60830b 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -320,8 +320,12 @@ static bool virtio_pci_ioeventfd_enabled(DeviceState *d)
>
> static inline int virtio_pci_queue_mem_mult(struct VirtIOPCIProxy *proxy)
> {
> - return (proxy->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ) ?
> - QEMU_VIRTIO_PCI_QUEUE_MEM_MULT : 4;
> + if (proxy->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ)
> + return QEMU_VIRTIO_PCI_QUEUE_MEM_MULT;
> + else if (proxy->flags & VIRTIO_PCI_FLAG_HOST_PAGE_PER_VQ)
> + return qemu_real_host_page_size();
> + else
> + return 4;
> }
Per our coding style, this code should use braces:
https://www.qemu.org/docs/master/devel/style.html#block-structure
Regards,
Phil.
next prev parent reply other threads:[~2024-02-23 5:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 5:26 [PATCH v3] virtio-pci: correctly set virtio pci queue mem multiplier Srujana Challa
2024-02-23 5:46 ` Philippe Mathieu-Daudé [this message]
2024-02-23 6:09 ` Michael S. Tsirkin
2024-02-28 6:13 ` [EXT] " Srujana Challa
2024-02-28 6:52 ` Michael S. Tsirkin
2024-02-28 9:26 ` Srujana Challa
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=62e08b11-81ca-40e3-a761-592f4c0b0976@linaro.org \
--to=philmd@linaro.org \
--cc=jasowang@redhat.com \
--cc=jerinj@marvell.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=schalla@marvell.com \
--cc=vattunuru@marvell.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).