From 66894635fa4ffebdb66704cedd97b972e50bbebb Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Mon, 20 Mar 2017 18:14:05 +0100 Subject: [PATCH] vhost: obey VRING_AVAIL_F_NO_INTERRUPT If VRING_AVAIL_F_NO_INTERRUPT flag for queue is negotiated, guest can set this flag in avail ring to suppress interrupts from host. Change-Id: I2043067de33da009a974be5915ae81b1343fc424 Signed-off-by: Pawel Wodkowski --- lib/vhost/vhost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index e763b7177..dbbc1c63a 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -240,7 +240,9 @@ vq_used_ring_enqueue(struct rte_vhost_vring *vq, uint16_t id, uint32_t len) rte_compiler_barrier(); vq->used->idx = vq->last_used_idx; - eventfd_write(vq->callfd, (eventfd_t)1); + if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) { + eventfd_write(vq->callfd, (eventfd_t)1); + } } static bool