]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/doc/virtio.md
import 15.2.0 Octopus source
[ceph.git] / ceph / src / spdk / doc / virtio.md
1 # Virtio driver {#virtio}
2
3 # Introduction {#virtio_intro}
4
5 SPDK Virtio driver is a C library that allows communicating with Virtio devices.
6 It allows any SPDK application to become an initiator for (SPDK) vhost targets.
7
8 The driver supports two different usage models:
9 * PCI - This is the standard mode of operation when used in a guest virtual
10 machine, where QEMU has presented the virtio controller as a virtual PCI device.
11 * vhost-user - Can be used to connect to a vhost socket directly on the same host.
12
13 The driver, just like the SPDK @ref vhost, is using pollers instead of standard
14 interrupts to check for an I/O response. If used inside a VM, it bypasses interrupt
15 and context switching overhead of QEMU and guest kernel, significantly boosting
16 the overall I/O performance.
17
18 This Virtio library is currently used to implement two bdev modules:
19 @ref bdev_config_virtio_scsi and @ref bdev_config_virtio_blk.
20 These modules will export generic SPDK block devices usable by any SPDK application.
21
22 # 2MB hugepages {#virtio_2mb}
23
24 vhost-user specification puts a limitation on the number of "memory regions" used (8).
25 Each region corresponds to one file descriptor, and DPDK - as SPDK's memory allocator -
26 uses one file per hugepage by default. So *by default* this makes SPDK Virtio practical
27 with only 1GB hugepages. To run an SPDK app using Virtio initiator with 2MB hugepages
28 it is required to pass '-g' command-line option . This forces DPDK to create a single
29 non-physically-contiguous hugetlbfs file for all its memory.