All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vhost: fix missing flag reset on stop
@ 2016-06-27  5:28 Yuanhan Liu
  2016-06-29 14:55 ` Loftus, Ciara
  0 siblings, 1 reply; 3+ messages in thread
From: Yuanhan Liu @ 2016-06-27  5:28 UTC (permalink / raw)
  To: dev; +Cc: huawei.xie, Yuanhan Liu

Commit 550c9d27d143 ("vhost: set/reset device flags internally") moves
the VIRTIO_DEV_RUNNING set/reset to vhost lib. But I missed one reset
on stop; here fixes it.

Fixes: 550c9d27d143 ("vhost: set/reset device flags internally")

Reported-by: Loftus Ciara <ciara.loftus@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 lib/librte_vhost/vhost_user/virtio-net-user.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c b/lib/librte_vhost/vhost_user/virtio-net-user.c
index a6a48dc..e7c4347 100644
--- a/lib/librte_vhost/vhost_user/virtio-net-user.c
+++ b/lib/librte_vhost/vhost_user/virtio-net-user.c
@@ -317,8 +317,10 @@ user_get_vring_base(int vid, struct vhost_vring_state *state)
 	if (dev == NULL)
 		return -1;
 	/* We have to stop the queue (virtio) if it is running. */
-	if (dev->flags & VIRTIO_DEV_RUNNING)
+	if (dev->flags & VIRTIO_DEV_RUNNING) {
+		dev->flags &= ~VIRTIO_DEV_RUNNING;
 		notify_ops->destroy_device(vid);
+	}
 
 	/* Here we are safe to get the last used index */
 	vhost_get_vring_base(vid, state->index, state);
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] vhost: fix missing flag reset on stop
  2016-06-27  5:28 [PATCH] vhost: fix missing flag reset on stop Yuanhan Liu
@ 2016-06-29 14:55 ` Loftus, Ciara
  2016-06-30  5:31   ` Yuanhan Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Loftus, Ciara @ 2016-06-29 14:55 UTC (permalink / raw)
  To: Yuanhan Liu, dev; +Cc: Xie, Huawei

> 
> Commit 550c9d27d143 ("vhost: set/reset device flags internally") moves
> the VIRTIO_DEV_RUNNING set/reset to vhost lib. But I missed one reset
> on stop; here fixes it.
> 
> Fixes: 550c9d27d143 ("vhost: set/reset device flags internally")
> 
> Reported-by: Loftus Ciara <ciara.loftus@intel.com>
> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> ---
>  lib/librte_vhost/vhost_user/virtio-net-user.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c
> b/lib/librte_vhost/vhost_user/virtio-net-user.c
> index a6a48dc..e7c4347 100644
> --- a/lib/librte_vhost/vhost_user/virtio-net-user.c
> +++ b/lib/librte_vhost/vhost_user/virtio-net-user.c
> @@ -317,8 +317,10 @@ user_get_vring_base(int vid, struct
> vhost_vring_state *state)
>  	if (dev == NULL)
>  		return -1;
>  	/* We have to stop the queue (virtio) if it is running. */
> -	if (dev->flags & VIRTIO_DEV_RUNNING)
> +	if (dev->flags & VIRTIO_DEV_RUNNING) {
> +		dev->flags &= ~VIRTIO_DEV_RUNNING;
>  		notify_ops->destroy_device(vid);
> +	}
> 
>  	/* Here we are safe to get the last used index */
>  	vhost_get_vring_base(vid, state->index, state);
> --
> 1.9.0

Thanks for the patch. I've tested it and it solves the issue I was seeing where destroy_device was being called too many times.

Tested-by: Ciara Loftus <ciara.loftus@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vhost: fix missing flag reset on stop
  2016-06-29 14:55 ` Loftus, Ciara
@ 2016-06-30  5:31   ` Yuanhan Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Yuanhan Liu @ 2016-06-30  5:31 UTC (permalink / raw)
  To: Loftus, Ciara; +Cc: dev, Xie, Huawei

On Wed, Jun 29, 2016 at 02:55:40PM +0000, Loftus, Ciara wrote:
> > 
> > Commit 550c9d27d143 ("vhost: set/reset device flags internally") moves
> > the VIRTIO_DEV_RUNNING set/reset to vhost lib. But I missed one reset
> > on stop; here fixes it.
> > 
> > Fixes: 550c9d27d143 ("vhost: set/reset device flags internally")
> > 
> > Reported-by: Loftus Ciara <ciara.loftus@intel.com>
> > Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> > ---
> >  lib/librte_vhost/vhost_user/virtio-net-user.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c
> > b/lib/librte_vhost/vhost_user/virtio-net-user.c
> > index a6a48dc..e7c4347 100644
> > --- a/lib/librte_vhost/vhost_user/virtio-net-user.c
> > +++ b/lib/librte_vhost/vhost_user/virtio-net-user.c
> > @@ -317,8 +317,10 @@ user_get_vring_base(int vid, struct
> > vhost_vring_state *state)
> >  	if (dev == NULL)
> >  		return -1;
> >  	/* We have to stop the queue (virtio) if it is running. */
> > -	if (dev->flags & VIRTIO_DEV_RUNNING)
> > +	if (dev->flags & VIRTIO_DEV_RUNNING) {
> > +		dev->flags &= ~VIRTIO_DEV_RUNNING;
> >  		notify_ops->destroy_device(vid);
> > +	}
> > 
> >  	/* Here we are safe to get the last used index */
> >  	vhost_get_vring_base(vid, state->index, state);
> > --
> > 1.9.0
> 
> Thanks for the patch. I've tested it and it solves the issue I was seeing where destroy_device was being called too many times.
> 
> Tested-by: Ciara Loftus <ciara.loftus@intel.com>

Thanks for testing!

Applied to dpdk-next-virtio.

	--yliu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-30  5:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-27  5:28 [PATCH] vhost: fix missing flag reset on stop Yuanhan Liu
2016-06-29 14:55 ` Loftus, Ciara
2016-06-30  5:31   ` Yuanhan Liu

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.