From: Si-Wei Liu <si-wei.liu@oracle.com>
To: "Eugenio Pérez" <eperezma@redhat.com>, qemu-devel@nongnu.org
Cc: yvugenfi@redhat.com, Jason Wang <jasowang@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Dragos Tatulea <dtatulea@nvidia.com>,
Shannon Nelson <snelson@pensando.io>
Subject: Re: [RFC PATCH 07/12] vdpa: add vhost_vdpa_reset_queue
Date: Fri, 21 Jul 2023 14:56:39 -0700 [thread overview]
Message-ID: <34ff94cc-82fb-831c-b07a-f7068a8a8297@oracle.com> (raw)
In-Reply-To: <20230720181459.607008-8-eperezma@redhat.com>
On 7/20/2023 11:14 AM, Eugenio Pérez wrote:
> Split out vq reset operation in its own function, as it may be called
> with ring reset.
>
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
> hw/virtio/vhost-vdpa.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
> index 6ae276ccde..df2515a247 100644
> --- a/hw/virtio/vhost-vdpa.c
> +++ b/hw/virtio/vhost-vdpa.c
> @@ -547,6 +547,21 @@ int vhost_vdpa_set_vring_ready(struct vhost_vdpa *v, unsigned idx)
> return vhost_vdpa_set_vring_ready_internal(v, idx, true);
> }
>
> +/* TODO: Properly reorder static functions */
> +static void vhost_vdpa_svq_stop(struct vhost_dev *dev, unsigned idx);
> +static void vhost_vdpa_reset_queue(struct vhost_dev *dev, int idx)
> +{
> + struct vhost_vdpa *v = dev->opaque;
> +
> + if (dev->features & VIRTIO_F_RING_RESET) {
> + vhost_vdpa_set_vring_ready_internal(v, idx, false);
I'm not sure I understand this patch - this is NOT the spec defined way
to initiate RING_RESET? Quoting the spec diff from the original
RING_RESET tex doc:
+The device MUST reset the queue when 1 is written to \field{queue_reset}, and
+present a 1 in \field{queue_reset} after the queue has been reset, until the
+driver re-enables the queue via \field{queue_enable} or the device is reset.
+The device MUST present consistent default values after queue reset.
+(see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}).
Or you intend to rewrite it to be spec conforming later on?
-Siwei
> + }
> +
> + if (v->shadow_vqs_enabled) {
> + vhost_vdpa_svq_stop(dev, idx - dev->vq_index);
> + }
> +}
> +
> /*
> * The use of this function is for requests that only need to be
> * applied once. Typically such request occurs at the beginning
> @@ -1543,4 +1558,5 @@ const VhostOps vdpa_ops = {
> .vhost_force_iommu = vhost_vdpa_force_iommu,
> .vhost_set_config_call = vhost_vdpa_set_config_call,
> .vhost_reset_status = vhost_vdpa_reset_status,
> + .vhost_reset_queue = vhost_vdpa_reset_queue,
> };
next prev parent reply other threads:[~2023-07-21 21:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 18:14 [RFC PATCH 00/12] Prefer to use SVQ to stall dataplane at NIC state restore through CVQ Eugenio Pérez
2023-07-20 18:14 ` [RFC PATCH 01/12] vhost: add vhost_reset_queue_op Eugenio Pérez
2023-07-20 18:14 ` [RFC PATCH 02/12] vhost: add vhost_restart_queue_op Eugenio Pérez
2023-07-20 18:14 ` [RFC PATCH 03/12] vhost_net: Use ops->vhost_restart_queue in vhost_net_virtqueue_restart Eugenio Pérez
2023-07-25 7:07 ` Jason Wang
2023-07-20 18:14 ` [RFC PATCH 04/12] vhost_net: Use ops->vhost_reset_queue in vhost_net_virtqueue_reset Eugenio Pérez
2023-07-25 7:08 ` Jason Wang
2023-07-20 18:14 ` [RFC PATCH 05/12] vdpa: add vhost_vdpa_set_vring_ready_internal Eugenio Pérez
2023-07-20 18:14 ` [RFC PATCH 06/12] vdpa: add vhost_vdpa_svq_stop Eugenio Pérez
2023-07-20 18:14 ` [RFC PATCH 07/12] vdpa: add vhost_vdpa_reset_queue Eugenio Pérez
2023-07-21 21:56 ` Si-Wei Liu [this message]
2023-07-24 16:35 ` Eugenio Perez Martin
2023-07-20 18:14 ` [RFC PATCH 08/12] vdpa: add vhost_vdpa_svq_start Eugenio Pérez
2023-07-20 18:14 ` [RFC PATCH 09/12] vdpa: add vhost_vdpa_restart_queue Eugenio Pérez
2023-07-20 18:14 ` [RFC PATCH 10/12] vdpa: enable all vqs if the device support RING_RESET feature Eugenio Pérez
2023-07-20 18:14 ` [RFC PATCH 11/12] vdpa: use SVQ to stall dataplane while NIC state is being restored Eugenio Pérez
2023-07-21 22:58 ` Si-Wei Liu
2023-07-24 19:59 ` Eugenio Perez Martin
2023-07-25 3:48 ` Jason Wang
2023-07-20 18:14 ` [RFC PATCH 12/12] vhost: Allow _F_RING_RESET with shadow virtqueue Eugenio Pérez
2023-07-21 6:48 ` [RFC PATCH 00/12] Prefer to use SVQ to stall dataplane at NIC state restore through CVQ Eugenio Perez Martin
2023-07-25 7:15 ` Jason Wang
2023-07-27 12:53 ` Eugenio Perez Martin
2023-07-27 13:05 ` Michael S. Tsirkin
2023-07-27 15:23 ` Eugenio Perez Martin
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=34ff94cc-82fb-831c-b07a-f7068a8a8297@oracle.com \
--to=si-wei.liu@oracle.com \
--cc=dtatulea@nvidia.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=snelson@pensando.io \
--cc=yvugenfi@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).