vhost: fix notification for packed ring
authorTiwei Bie <tiwei.bie@intel.com>
Thu, 11 Oct 2018 14:22:34 +0000 (22:22 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 18 Oct 2018 08:24:39 +0000 (10:24 +0200)
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 <tiwei.bie@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
lib/librte_vhost/vhost.c

index e62f4c5..047ee53 100644 (file)
@@ -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)) {