From c06345bfafa580e2b5045475dddf05be2becaa35 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Tue, 12 Jun 2018 18:09:30 +0200 Subject: [PATCH] doc/vhost: add SVG diagram Replaced basic ASCII diagram with the complex SVG one. Also removed slightly misleading vhost introduction and replaced it with a doc/vhost_processing.md reference, which does a better job at explaining vhost. Vhost is a protocol intended to expose Virtio queues to an external process. While Virtio queues are defined by the Virtio protocol, it is still misleading to say vhost devices use Virtio protocol to communicate. They use Vhost-user protocol. Virtio shouldn't be mentioned unless we talk about QEMU or guest VM. Change-Id: I38ce4d3cc9e1c96339d9fa63b5e94019a17ccf9e Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/414816 Tested-by: SPDK Automated Test System Reviewed-by: Tomasz Zawadzki Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- doc/vhost.md | 44 +++++++++++--------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/doc/vhost.md b/doc/vhost.md index 3a3f980ea7..266f3ca47d 100644 --- a/doc/vhost.md +++ b/doc/vhost.md @@ -15,40 +15,18 @@ A vhost target provides a local storage service as a process running on a local machine. It is capable of exposing virtualized block devices to QEMU instances or other arbitrary -processes. These processes communicate with the vhost target using the -[virtio protocol](https://wiki.libvirt.org/page/Virtio), a standardized protocol for -paravirtualized devices. +processes. + +The following diagram presents how QEMU-based VM communicates with SPDK Vhost-SCSI device. + +![QEMU/SPDK vhost data flow](img/qemu_vhost_data_flow.svg) + +The diagram, and the vhost protocol itself is described in @ref vhost_processing doc. SPDK provides an accelerated vhost target by applying the same user space and polling -techniques as other components in SPDK. Since SPDK is polling for virtio submissions, -it can signal the virtio driver to skip notifications on submission. This avoids VMEXITs on I/O -submission and can significantly reduce CPU usage in the guest VM on heavy I/O workloads. - -The following diagram presents how QEMU-based VM communicates with an SPDK vhost device. - - +-------QEMU-VM--------+ +---------------SPDK-vhost-------------+ - | | | | - | +----------------+ | | +--------------------------------+ | - | | | | | | | | - | | Virtio-SCSI | | eventfd | | +-------------+ | | - | | Linux driver | | interrupt | | Virtio-SCSI | | | | - | | | <----------------+ device | NVMe disk | | | - | +--------^-------+ | | | | | | | - | | | | | +-------^-----+ | | - +----------------------+ | | | | | - | | +----------^---------------------+ | - | | | | | - | +--------------------------------------+ - | | | - | polling | | DMA - | | | - +-----------v----Shared hugepage memory------------+------------------------+ - | | | - | +----------------------------------+-------------------------v--------+ | - + | Virtqueues | Buffers | | - | +----------------------------------+----------------------------------+ | - | | - +---------------------------------------------------------------------------+ +techniques as other components in SPDK. Since SPDK is polling for vhost submissions, +it can signal the VM to skip notifications on submission. This avoids VMEXITs on I/O +submission and can significantly reduce CPU usage in the VM on heavy I/O workloads. # Prerequisites {#vhost_prereqs} @@ -135,7 +113,7 @@ will create a 64MB malloc bdev with 512-byte block size. scripts/rpc.py construct_malloc_bdev 64 512 -b Malloc0 ~~~ -## Create a virtio device {#vhost_vdev_create} +## Create a vhost device {#vhost_vdev_create} ### Vhost-SCSI