All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: "Eugenio Pérez" <eperezma@redhat.com>,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [RFC PATCH 3/6] virtio_test: call __virtio_unbreak_device
Date: Mon, 4 Jul 2022 15:06:39 -0400	[thread overview]
Message-ID: <20220704150450-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20220704171701.127665-4-sgarzare@redhat.com>

On Mon, Jul 04, 2022 at 07:16:58PM +0200, Stefano Garzarella wrote:
> Commit 8b4ec69d7e09 ("virtio: harden vring IRQ") initialize vq->broken
> to true, so we need to call __virtio_unbreak_device() before starting
> to use it.
> 
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>

I think this shouldn't be necessary with latest master.

> ---
>  tools/virtio/linux/virtio.h | 2 ++
>  tools/virtio/virtio_test.c  | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h
> index 363b98228301..feb720d4304f 100644
> --- a/tools/virtio/linux/virtio.h
> +++ b/tools/virtio/linux/virtio.h
> @@ -66,4 +66,6 @@ struct virtqueue *vring_new_virtqueue(unsigned int index,
>  				      const char *name);
>  void vring_del_virtqueue(struct virtqueue *vq);
>  
> +void __virtio_unbreak_device(struct virtio_device *dev);
> +
>  #endif
> diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
> index 23f142af544a..765e64895dab 100644
> --- a/tools/virtio/virtio_test.c
> +++ b/tools/virtio/virtio_test.c
> @@ -177,6 +177,7 @@ static void run_test(struct vdev_info *dev, struct vq_info *vq,
>  	long long spurious = 0;
>  	const bool random_batch = batch == RANDOM_BATCH;
>  
> +	__virtio_unbreak_device(&dev->vdev);
>  	r = ioctl(dev->control, VHOST_TEST_RUN, &test);
>  	assert(r >= 0);
>  	if (!reset_n) {
> -- 
> 2.36.1

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

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
	"Jason Wang" <jasowang@redhat.com>,
	linux-kernel@vger.kernel.org,
	"Eugenio Pérez" <eperezma@redhat.com>
Subject: Re: [RFC PATCH 3/6] virtio_test: call __virtio_unbreak_device
Date: Mon, 4 Jul 2022 15:06:39 -0400	[thread overview]
Message-ID: <20220704150450-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20220704171701.127665-4-sgarzare@redhat.com>

On Mon, Jul 04, 2022 at 07:16:58PM +0200, Stefano Garzarella wrote:
> Commit 8b4ec69d7e09 ("virtio: harden vring IRQ") initialize vq->broken
> to true, so we need to call __virtio_unbreak_device() before starting
> to use it.
> 
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>

I think this shouldn't be necessary with latest master.

> ---
>  tools/virtio/linux/virtio.h | 2 ++
>  tools/virtio/virtio_test.c  | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h
> index 363b98228301..feb720d4304f 100644
> --- a/tools/virtio/linux/virtio.h
> +++ b/tools/virtio/linux/virtio.h
> @@ -66,4 +66,6 @@ struct virtqueue *vring_new_virtqueue(unsigned int index,
>  				      const char *name);
>  void vring_del_virtqueue(struct virtqueue *vq);
>  
> +void __virtio_unbreak_device(struct virtio_device *dev);
> +
>  #endif
> diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
> index 23f142af544a..765e64895dab 100644
> --- a/tools/virtio/virtio_test.c
> +++ b/tools/virtio/virtio_test.c
> @@ -177,6 +177,7 @@ static void run_test(struct vdev_info *dev, struct vq_info *vq,
>  	long long spurious = 0;
>  	const bool random_batch = batch == RANDOM_BATCH;
>  
> +	__virtio_unbreak_device(&dev->vdev);
>  	r = ioctl(dev->control, VHOST_TEST_RUN, &test);
>  	assert(r >= 0);
>  	if (!reset_n) {
> -- 
> 2.36.1


  reply	other threads:[~2022-07-04 19:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 17:16 [RFC PATCH 0/6] virtio_test: add support for vhost-vdpa Stefano Garzarella
2022-07-04 17:16 ` Stefano Garzarella
2022-07-04 17:16 ` [RFC PATCH 1/6] tools/virtio: fix build Stefano Garzarella
2022-07-04 17:16   ` Stefano Garzarella
2022-07-04 19:07   ` Michael S. Tsirkin
2022-07-04 19:07     ` Michael S. Tsirkin
2022-07-05  7:14     ` Stefano Garzarella
2022-07-05  7:14       ` Stefano Garzarella
2022-07-04 17:16 ` [RFC PATCH 2/6] vhost_test: add $(srctree) on the included path Stefano Garzarella
2022-07-04 17:16   ` Stefano Garzarella
2022-07-04 17:16 ` [RFC PATCH 3/6] virtio_test: call __virtio_unbreak_device Stefano Garzarella
2022-07-04 17:16   ` Stefano Garzarella
2022-07-04 19:06   ` Michael S. Tsirkin [this message]
2022-07-04 19:06     ` Michael S. Tsirkin
2022-07-05  7:11     ` Stefano Garzarella
2022-07-05  7:11       ` Stefano Garzarella
2022-07-04 17:16 ` [RFC PATCH 4/6] tools/virtio: move feature negotiation in vdev_info_init() Stefano Garzarella
2022-07-04 17:16   ` Stefano Garzarella
2022-07-04 17:17 ` [RFC PATCH 5/6] virtio_test: support vhost-vdpa device Stefano Garzarella
2022-07-04 17:17   ` Stefano Garzarella
2022-07-04 17:17 ` [RFC PATCH 6/6] vdpasim: add vdpa_sim_test module Stefano Garzarella
2022-07-04 17:17   ` Stefano Garzarella
2022-07-12  8:34 ` [RFC PATCH 0/6] virtio_test: add support for vhost-vdpa Jason Wang
2022-07-12  8:34   ` Jason Wang
2022-07-12  8:45   ` Stefano Garzarella
2022-07-12  8:45     ` Stefano Garzarella
2022-07-12  8:47     ` Jason Wang
2022-07-12  8:47       ` Jason Wang
2022-07-12  9:20       ` Stefano Garzarella
2022-07-12  9:20         ` Stefano Garzarella

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=20220704150450-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgarzare@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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.