From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: [PATCH v2] vhost: fix notification for packed ring Date: Thu, 11 Oct 2018 22:22:34 +0800 Message-ID: <20181011142234.17823-1-tiwei.bie@intel.com> References: <20181011130655.5485-1-tiwei.bie@intel.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: mst@redhat.com, jasowang@redhat.com, stable@dpdk.org To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org Return-path: In-Reply-To: <20181011130655.5485-1-tiwei.bie@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The notification can't be disabled in packed ring when application tries to disable notification, because the device event flags field is overwritten by an unexpected value. This patch fixes this issue. Fixes: b1cce26af1dc ("vhost: add notification for packed ring") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie Reviewed-by: Michael S. Tsirkin --- v2: return directly after disabling the interrupt (Jason/MST) lib/librte_vhost/vhost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index e62f4c594..047ee535c 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -667,8 +667,10 @@ vhost_enable_notify_packed(struct virtio_net *dev, { uint16_t flags; - if (!enable) + if (!enable) { vq->device_event->flags = VRING_EVENT_F_DISABLE; + return; + } flags = VRING_EVENT_F_ENABLE; if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) { -- 2.19.1