From da78c67091136eed859a6fac9a287852d21fe242 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Sun, 4 Feb 2018 13:24:13 +0100 Subject: [PATCH] vhost: drop VIRTIO_F_NOTIFY_ON_EMPTY feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This feature is not particularly useful for storage. It forces us to read additional vq memory on each I/O completion and that's quite expensive. Quoting VIRTIO 1.0: ``` VIRTIO_F_NOTIFY_ON_EMPTY (24) If this feature has been negotiated by driver, the device MUST issue an interrupt if the device runs out of available descriptors on a virtqueue, even though interrupts are suppressed using the VIRTQ_AVAIL_F_NO_INTERRUPT flag or the used_event field. ``` Later on: ``` Note: An example of a driver using this feature is the legacy networking driver: it doesn’t need to know every time a packet is transmitted, but it does need to free the transmitted packets a finite time after they are transmitted. It can avoid using a timer if the device interrupts it when all the packets are transmitted. ``` Change-Id: I7f53293bf811a4cd5ae8e42e18f35042ea6f4ba8 Suggested-by: Pawel Wodkowski Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/398325 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Pawel Wodkowski Reviewed-by: Daniel Verkamp --- lib/vhost/vhost.c | 5 ----- lib/vhost/vhost_internal.h | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index 29c64d1ce..9a14421a2 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -374,11 +374,6 @@ spdk_vhost_vq_used_ring_enqueue(struct spdk_vhost_dev *vdev, struct spdk_vhost_v spdk_wmb(); virtqueue->used_req_cnt++; - - if (spdk_vhost_dev_has_feature(vdev, VIRTIO_F_NOTIFY_ON_EMPTY) && - spdk_unlikely(vring->avail->idx == vring->last_avail_idx)) { - spdk_vhost_vq_used_signal(vdev, virtqueue); - } } int diff --git a/lib/vhost/vhost_internal.h b/lib/vhost/vhost_internal.h index f5640d9bf..da346cb63 100644 --- a/lib/vhost/vhost_internal.h +++ b/lib/vhost/vhost_internal.h @@ -91,7 +91,8 @@ (1ULL << VIRTIO_RING_F_INDIRECT_DESC)) #define SPDK_VHOST_DISABLED_FEATURES ((1ULL << VIRTIO_RING_F_EVENT_IDX) | \ - (1ULL << VIRTIO_RING_F_INDIRECT_DESC)) + (1ULL << VIRTIO_RING_F_INDIRECT_DESC) | \ + (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY)) struct spdk_vhost_virtqueue { struct rte_vhost_vring vring;