numam-spdk/doc/virtio.md
Karol Latecki 3d8a0b19b0 doc: Fix Markdown MD032 linter warnings
"MD032 Lists should be surrounded by blank lines"
Fix this markdown linter error by inserting newlines or
adjusting text to list points using spaces.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I09e1f021b8e95e0c6c58c393d7ecc11ce61c3132
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/434
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
2020-02-06 09:46:06 +00:00

1.5 KiB

Virtio driver

Introduction

SPDK Virtio driver is a C library that allows communicating with Virtio devices. It allows any SPDK application to become an initiator for (SPDK) vhost targets.

The driver supports two different usage models:

  • PCI - This is the standard mode of operation when used in a guest virtual machine, where QEMU has presented the virtio controller as a virtual PCI device.
  • vhost-user - Can be used to connect to a vhost socket directly on the same host.

The driver, just like the SPDK @ref vhost, is using pollers instead of standard interrupts to check for an I/O response. If used inside a VM, it bypasses interrupt and context switching overhead of QEMU and guest kernel, significantly boosting the overall I/O performance.

This Virtio library is currently used to implement two bdev modules: @ref bdev_config_virtio_scsi and @ref bdev_config_virtio_blk. These modules will export generic SPDK block devices usable by any SPDK application.

2MB hugepages

vhost-user specification puts a limitation on the number of "memory regions" used (8). Each region corresponds to one file descriptor, and DPDK - as SPDK's memory allocator - uses one file per hugepage by default. So by default this makes SPDK Virtio practical with only 1GB hugepages. To run an SPDK app using Virtio initiator with 2MB hugepages it is required to pass '-g' command-line option . This forces DPDK to create a single non-physically-contiguous hugetlbfs file for all its memory.