dm: virtio: ensure interrupt delivery in virtio-blk

virtio-blk never sets used_all_avail when calling vq_endchains(), which
may become problematic if VIRTIO_F_NOTIFY_ON_EMPTY is enabled.

Provide vq_endchains() with that info to ensure the delivery of an
interrupt when the avail ring is drained in the case of
VIRTIO_F_NOTIFY_ON_EMPTY.

Tracked-On: #2763
Signed-off-by: Peter Fang <peter.fang@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
Peter Fang 2019-03-17 02:11:12 -07:00 committed by wenlingz
parent d38afa6f48
commit fa375a2aa1

View File

@ -201,7 +201,7 @@ virtio_blk_done(struct blockif_req *br, int err)
*/
pthread_mutex_lock(&blk->mtx);
vq_relchain(&blk->vq, io->idx, 1);
vq_endchains(&blk->vq, 0);
vq_endchains(&blk->vq, !vq_has_descs(&blk->vq));
pthread_mutex_unlock(&blk->mtx);
}