From 71904d7f4d752819ccd7c4218d3e67969f5338e0 Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Wed, 19 Jul 2017 13:46:20 +0200 Subject: [PATCH] vhost: don't use interrupt suppressing hints on avail ring Randomly we loose some interrupts. This stop IO in guest till next request is issued which is abort Change-Id: I1a0b6391a324cabb0df17d2704126d161b1868f7 Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/370248 Tested-by: SPDK Automated Test System Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp --- lib/vhost/vhost.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index a14bf4ef8..bd6f6d32c 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -83,17 +83,6 @@ spdk_vhost_vq_avail_ring_get(struct rte_vhost_vring *vq, uint16_t *reqs, uint16_ return count; } -bool -spdk_vhost_vq_should_notify(struct spdk_vhost_dev *vdev, struct rte_vhost_vring *vq) -{ - if ((vdev->negotiated_features & (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY)) && - spdk_unlikely(vq->avail->idx == vq->last_avail_idx)) { - return 1; - } - - return !(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT); -} - struct vring_desc * spdk_vhost_vq_get_desc(struct rte_vhost_vring *vq, uint16_t req_idx) { @@ -125,9 +114,14 @@ spdk_vhost_vq_used_ring_enqueue(struct spdk_vhost_dev *vdev, struct rte_vhost_vr rte_compiler_barrier(); vq->used->idx = vq->last_used_idx; - if (spdk_vhost_vq_should_notify(vdev, vq)) { - eventfd_write(vq->callfd, (eventfd_t)1); - } + + /* + * We should be able to used hints form guest but simply checking + * avail->flags prove to be unreliable. Till it is figured out how + * reliable use avail->flags value interrupts are always sent to guest. + */ + eventfd_write(vq->callfd, (eventfd_t)1); + } bool