X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_vhost%2Fvhost.c;h=e62f4c594a64bea6c3d78c5761b4693ae1dd54cd;hb=547be3f01f55;hp=91026b3e13fe7f3556fcf53122d43ea045156663;hpb=d02f2092a31457b6477e7e995f9b0ca122d951bc;p=dpdk.git diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index 91026b3e13..e62f4c594a 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -647,12 +647,18 @@ rte_vhost_avail_entries(int vid, uint16_t queue_id) } static inline void -vhost_enable_notify_split(struct vhost_virtqueue *vq, int enable) +vhost_enable_notify_split(struct virtio_net *dev, + struct vhost_virtqueue *vq, int enable) { - if (enable) - vq->used->flags &= ~VRING_USED_F_NO_NOTIFY; - else - vq->used->flags |= VRING_USED_F_NO_NOTIFY; + if (!(dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX))) { + if (enable) + vq->used->flags &= ~VRING_USED_F_NO_NOTIFY; + else + vq->used->flags |= VRING_USED_F_NO_NOTIFY; + } else { + if (enable) + vhost_avail_event(vq) = vq->last_avail_idx; + } } static inline void @@ -690,7 +696,7 @@ rte_vhost_enable_guest_notification(int vid, uint16_t queue_id, int enable) if (vq_is_packed(dev)) vhost_enable_notify_packed(dev, vq, enable); else - vhost_enable_notify_split(vq, enable); + vhost_enable_notify_split(dev, vq, enable); return 0; }