summaryrefslogtreecommitdiff
path: root/lib/librte_vhost
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.bie@intel.com>2018-10-11 22:22:34 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-18 10:24:39 +0200
commitcd9012c3f8d3905a8212da7945233a17633e796f (patch)
tree48638a2f6a19f2f1326e2ed7c46a3aa38829a6ef /lib/librte_vhost
parent7604677883d50c4f2b1970e2a877706947bf192b (diff)
downloaddpdk-cd9012c3f8d3905a8212da7945233a17633e796f.zip
dpdk-cd9012c3f8d3905a8212da7945233a17633e796f.tar.gz
dpdk-cd9012c3f8d3905a8212da7945233a17633e796f.tar.xz
vhost: fix notification for packed ring
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>
Diffstat (limited to 'lib/librte_vhost')
-rw-r--r--lib/librte_vhost/vhost.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index e62f4c5..047ee53 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)) {