From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: [PATCH] vhost: fix missing flag reset on stop Date: Mon, 27 Jun 2016 13:28:49 +0800 Message-ID: <1467005329-4216-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: huawei.xie@intel.com, Yuanhan Liu To: dev@dpdk.org Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 05B5D5A62 for ; Mon, 27 Jun 2016 07:28:50 +0200 (CEST) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Yuanhan Liu --- 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