Linux virtualization list
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Eugenio Pérez" <eperezma@redhat.com>
Cc: Rob Miller <rob.miller@broadcom.com>,
	Parav Pandit <parav@mellanox.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, Harpreet Singh Anand <hanand@xilinx.com>,
	Xiao W Wang <xiao.w.wang@intel.com>, Eli Cohen <eli@mellanox.com>,
	virtualization@lists.linux-foundation.org,
	Eric Blake <eblake@redhat.com>, Michael Lilja <ml@napatech.com>,
	Jim Harford <jim.harford@broadcom.com>
Subject: Re: [RFC v2 7/7] vhost: Route host->guest notification through shadow virtqueue
Date: Wed, 17 Feb 2021 17:24:01 +0000	[thread overview]
Message-ID: <20210217172401.GI269203@stefanha-x1.localdomain> (raw)
In-Reply-To: <20210209153757.1653598-8-eperezma@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1605 bytes --]

On Tue, Feb 09, 2021 at 04:37:57PM +0100, Eugenio Pérez wrote:
> @@ -40,6 +42,26 @@ static void vhost_handle_guest_kick(EventNotifier *n)
>      }
>  }
>  
> +/* Forward vhost notifications */
> +static void vhost_handle_call(EventNotifier *n)

The name vhost_shadow_vq_handle_call() expresses the purpose of the
function more clearly.

> @@ -75,8 +102,19 @@ bool vhost_shadow_vq_start_rcu(struct vhost_dev *dev,
>      /* Check for pending notifications from the guest */
>      vhost_handle_guest_kick(&svq->host_notifier);
>  
> +    r = dev->vhost_ops->vhost_set_vring_call(dev, &call_file);
> +    if (r != 0) {
> +        error_report("Couldn't set call fd: %s", strerror(errno));
> +        goto err_set_vring_call;
> +    }

This ignores notifier_is_masked and always unmasks.

> @@ -1608,6 +1607,10 @@ void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n,
>      if (mask) {
>          assert(vdev->use_guest_notifier_mask);
>          file.fd = event_notifier_get_fd(&hdev->vqs[index].masked_notifier);
> +    } else if (hdev->sw_lm_enabled) {
> +        VhostShadowVirtqueue *svq = hdev->shadow_vqs[n];
> +        EventNotifier *e = vhost_shadow_vq_get_call_notifier(svq);
> +        file.fd = event_notifier_get_fd(e);
>      } else {
>          file.fd = event_notifier_get_fd(virtio_queue_get_guest_notifier(vvq));
>      }

Maybe you can extend this function so it can be called unconditionally
from both vhost_shadow_vq_start_rcu() and vhost_shadow_vq_stop_rcu(). It
would be a single place that invokes vhost_set_vring_call().

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2021-02-17 17:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210209153757.1653598-1-eperezma@redhat.com>
     [not found] ` <20210209153757.1653598-2-eperezma@redhat.com>
     [not found]   ` <14b2637e-9610-356e-ad18-27a9a8b82508@redhat.com>
     [not found]     ` <CAJaqyWd+NuY3B94HX8J_EzFf4sxeZnFCcw=aXfT-KZ7nfmL6DQ@mail.gmail.com>
2021-02-11 16:40       ` [RFC v2 1/7] vhost: Delete trailing dot in errpr_setg argument Stefano Garzarella
     [not found] ` <20210209153757.1653598-3-eperezma@redhat.com>
2021-02-17 12:41   ` [RFC v2 2/7] virtio: Add virtio_queue_host_notifier_status Stefan Hajnoczi
     [not found] ` <20210209153757.1653598-4-eperezma@redhat.com>
2021-02-17 12:44   ` [RFC v2 3/7] vhost: Save masked_notifier state Stefan Hajnoczi
     [not found] ` <20210209153757.1653598-5-eperezma@redhat.com>
2021-02-17 13:01   ` [RFC v2 4/7] vhost: Add VhostShadowVirtqueue Stefan Hajnoczi
     [not found] ` <20210209153757.1653598-6-eperezma@redhat.com>
2021-02-17 15:26   ` [RFC v2 5/7] vhost: Add x-vhost-enable-shadow-vq qmp Stefan Hajnoczi
     [not found] ` <20210209153757.1653598-7-eperezma@redhat.com>
2021-02-17 16:56   ` [RFC v2 6/7] vhost: Route guest->host notification through shadow virtqueue Stefan Hajnoczi
     [not found] ` <20210209153757.1653598-8-eperezma@redhat.com>
2021-02-17 17:24   ` Stefan Hajnoczi [this message]
2021-03-01  6:24   ` [RFC v2 7/7] vhost: Route host->guest " Jason Wang

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=20210217172401.GI269203@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eli@mellanox.com \
    --cc=eperezma@redhat.com \
    --cc=hanand@xilinx.com \
    --cc=jim.harford@broadcom.com \
    --cc=ml@napatech.com \
    --cc=mst@redhat.com \
    --cc=parav@mellanox.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rob.miller@broadcom.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xiao.w.wang@intel.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