All of lore.kernel.org
 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>,
	Jason Wang <jasowang@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Harpreet Singh Anand <hanand@xilinx.com>,
	Xiao W Wang <xiao.w.wang@intel.com>, Eli Cohen <eli@mellanox.com>,
	virtualization@lists.linux-foundation.org,
	Michael Lilja <ml@napatech.com>,
	Jim Harford <jim.harford@broadcom.com>,
	Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [RFC v2 2/7] virtio: Add virtio_queue_host_notifier_status
Date: Wed, 17 Feb 2021 12:41:34 +0000	[thread overview]
Message-ID: <20210217124134.GD269203@stefanha-x1.localdomain> (raw)
In-Reply-To: <20210209153757.1653598-3-eperezma@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]

On Tue, Feb 09, 2021 at 04:37:52PM +0100, Eugenio Pérez wrote:
> This allows shadow virtqueue code to assert the queue status before
> making changes.
> 
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
>  include/hw/virtio/virtio.h | 1 +
>  hw/virtio/virtio.c         | 5 +++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index b7ece7a6a8..227cec13a8 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -316,6 +316,7 @@ void virtio_device_release_ioeventfd(VirtIODevice *vdev);
>  bool virtio_device_ioeventfd_enabled(VirtIODevice *vdev);
>  EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq);
>  void virtio_queue_set_host_notifier_enabled(VirtQueue *vq, bool enabled);
> +bool virtio_queue_host_notifier_status(const VirtQueue *vq);
>  void virtio_queue_host_notifier_read(EventNotifier *n);
>  void virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx,
>                                                  VirtIOHandleAIOOutput handle_output);
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 1fd1917ca0..53473ae4df 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -3594,6 +3594,11 @@ EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq)
>      return &vq->host_notifier;
>  }
>  
> +bool virtio_queue_host_notifier_status(const VirtQueue *vq)
> +{
> +    return vq->host_notifier_enabled;
> +}
> +
>  void virtio_queue_set_host_notifier_enabled(VirtQueue *vq, bool enabled)

Since there is a virtio_queue_set_host_notifier_enabled() I suggest
calling this function virtio_queue_is_host_notifier_enabled() or
virtio_queue_get_host_notifier_enabled(). That way it's clear they
set/get the same thing.

Stefan

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

WARNING: multiple messages have this Message-ID (diff)
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 2/7] virtio: Add virtio_queue_host_notifier_status
Date: Wed, 17 Feb 2021 12:41:34 +0000	[thread overview]
Message-ID: <20210217124134.GD269203@stefanha-x1.localdomain> (raw)
In-Reply-To: <20210209153757.1653598-3-eperezma@redhat.com>


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

On Tue, Feb 09, 2021 at 04:37:52PM +0100, Eugenio Pérez wrote:
> This allows shadow virtqueue code to assert the queue status before
> making changes.
> 
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
>  include/hw/virtio/virtio.h | 1 +
>  hw/virtio/virtio.c         | 5 +++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index b7ece7a6a8..227cec13a8 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -316,6 +316,7 @@ void virtio_device_release_ioeventfd(VirtIODevice *vdev);
>  bool virtio_device_ioeventfd_enabled(VirtIODevice *vdev);
>  EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq);
>  void virtio_queue_set_host_notifier_enabled(VirtQueue *vq, bool enabled);
> +bool virtio_queue_host_notifier_status(const VirtQueue *vq);
>  void virtio_queue_host_notifier_read(EventNotifier *n);
>  void virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx,
>                                                  VirtIOHandleAIOOutput handle_output);
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 1fd1917ca0..53473ae4df 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -3594,6 +3594,11 @@ EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq)
>      return &vq->host_notifier;
>  }
>  
> +bool virtio_queue_host_notifier_status(const VirtQueue *vq)
> +{
> +    return vq->host_notifier_enabled;
> +}
> +
>  void virtio_queue_set_host_notifier_enabled(VirtQueue *vq, bool enabled)

Since there is a virtio_queue_set_host_notifier_enabled() I suggest
calling this function virtio_queue_is_host_notifier_enabled() or
virtio_queue_get_host_notifier_enabled(). That way it's clear they
set/get the same thing.

Stefan

[-- 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

  reply	other threads:[~2021-02-17 12:43 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 15:37 [RFC v2 0/7] vDPA shadow virtqueue - notifications forwarding Eugenio Pérez
2021-02-09 15:37 ` [RFC v2 1/7] vhost: Delete trailing dot in errpr_setg argument Eugenio Pérez
2021-02-09 16:24   ` Eric Blake
2021-02-09 18:11     ` Eugenio Perez Martin
2021-02-11 16:40       ` Stefano Garzarella
2021-02-11 16:40         ` Stefano Garzarella
2021-02-09 15:37 ` [RFC v2 2/7] virtio: Add virtio_queue_host_notifier_status Eugenio Pérez
2021-02-17 12:41   ` Stefan Hajnoczi [this message]
2021-02-17 12:41     ` Stefan Hajnoczi
2021-02-17 18:38     ` Eugenio Perez Martin
2021-02-09 15:37 ` [RFC v2 3/7] vhost: Save masked_notifier state Eugenio Pérez
2021-02-17 12:44   ` Stefan Hajnoczi
2021-02-17 12:44     ` Stefan Hajnoczi
2021-02-09 15:37 ` [RFC v2 4/7] vhost: Add VhostShadowVirtqueue Eugenio Pérez
2021-02-17 13:01   ` Stefan Hajnoczi
2021-02-17 13:01     ` Stefan Hajnoczi
2021-02-17 18:40     ` Eugenio Perez Martin
2021-02-09 15:37 ` [RFC v2 5/7] vhost: Add x-vhost-enable-shadow-vq qmp Eugenio Pérez
2021-02-17 15:26   ` Stefan Hajnoczi
2021-02-17 15:26     ` Stefan Hajnoczi
2021-02-17 18:47     ` Eugenio Perez Martin
2021-02-18 18:35       ` Eugenio Perez Martin
2021-02-09 15:37 ` [RFC v2 6/7] vhost: Route guest->host notification through shadow virtqueue Eugenio Pérez
2021-02-17 16:56   ` Stefan Hajnoczi
2021-02-17 16:56     ` Stefan Hajnoczi
2021-02-17 20:11     ` Eugenio Perez Martin
2021-02-09 15:37 ` [RFC v2 7/7] vhost: Route host->guest " Eugenio Pérez
2021-02-17 17:24   ` Stefan Hajnoczi
2021-02-17 17:24     ` Stefan Hajnoczi
2021-02-17 19:13     ` Eugenio Perez Martin
2021-03-01  6:24   ` Jason Wang
2021-03-01  6:24     ` Jason Wang
2021-03-02 16:30     ` Eugenio Perez Martin
2021-02-09 15:54 ` [RFC v2 0/7] vDPA shadow virtqueue - notifications forwarding Eugenio Perez Martin
2021-02-11 11:12 ` no-reply

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=20210217124134.GD269203@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eli@mellanox.com \
    --cc=eperezma@redhat.com \
    --cc=hanand@xilinx.com \
    --cc=jasowang@redhat.com \
    --cc=jim.harford@broadcom.com \
    --cc=ml@napatech.com \
    --cc=mst@redhat.com \
    --cc=parav@mellanox.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rob.miller@broadcom.com \
    --cc=sgarzare@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.