New upstream version 18.08
[deb_dpdk.git] / doc / guides / nics / ifc.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2018 Intel Corporation.
3
4 IFCVF vDPA driver
5 =================
6
7 The IFCVF vDPA (vhost data path acceleration) driver provides support for the
8 Intel FPGA 100G VF (IFCVF). IFCVF's datapath is virtio ring compatible, it
9 works as a HW vhost backend which can send/receive packets to/from virtio
10 directly by DMA. Besides, it supports dirty page logging and device state
11 report/restore, this driver enables its vDPA functionality.
12
13
14 Pre-Installation Configuration
15 ------------------------------
16
17 Config File Options
18 ~~~~~~~~~~~~~~~~~~~
19
20 The following option can be modified in the ``config`` file.
21
22 - ``CONFIG_RTE_LIBRTE_IFCVF_VDPA_PMD`` (default ``y`` for linux)
23
24   Toggle compilation of the ``librte_ifcvf_vdpa`` driver.
25
26
27 IFCVF vDPA Implementation
28 -------------------------
29
30 IFCVF's vendor ID and device ID are same as that of virtio net pci device,
31 with its specific subsystem vendor ID and device ID. To let the device be
32 probed by IFCVF driver, adding "vdpa=1" parameter helps to specify that this
33 device is to be used in vDPA mode, rather than polling mode, virtio pmd will
34 skip when it detects this message.
35
36 Different VF devices serve different virtio frontends which are in different
37 VMs, so each VF needs to have its own DMA address translation service. During
38 the driver probe a new container is created for this device, with this
39 container vDPA driver can program DMA remapping table with the VM's memory
40 region information.
41
42 Key IFCVF vDPA driver ops
43 ~~~~~~~~~~~~~~~~~~~~~~~~~
44
45 - ifcvf_dev_config:
46   Enable VF data path with virtio information provided by vhost lib, including
47   IOMMU programming to enable VF DMA to VM's memory, VFIO interrupt setup to
48   route HW interrupt to virtio driver, create notify relay thread to translate
49   virtio driver's kick to a MMIO write onto HW, HW queues configuration.
50
51   This function gets called to set up HW data path backend when virtio driver
52   in VM gets ready.
53
54 - ifcvf_dev_close:
55   Revoke all the setup in ifcvf_dev_config.
56
57   This function gets called when virtio driver stops device in VM.
58
59 To create a vhost port with IFC VF
60 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61
62 - Create a vhost socket and assign a VF's device ID to this socket via
63   vhost API. When QEMU vhost connection gets ready, the assigned VF will
64   get configured automatically.
65
66
67 Features
68 --------
69
70 Features of the IFCVF driver are:
71
72 - Compatibility with virtio 0.95 and 1.0.
73
74
75 Prerequisites
76 -------------
77
78 - Platform with IOMMU feature. IFC VF needs address translation service to
79   Rx/Tx directly with virtio driver in VM.
80
81
82 Limitations
83 -----------
84
85 Dependency on vfio-pci
86 ~~~~~~~~~~~~~~~~~~~~~~
87
88 vDPA driver needs to setup VF MSIX interrupts, each queue's interrupt vector
89 is mapped to a callfd associated with a virtio ring. Currently only vfio-pci
90 allows multiple interrupts, so the IFCVF driver is dependent on vfio-pci.
91
92 Live Migration with VIRTIO_NET_F_GUEST_ANNOUNCE
93 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
94
95 IFC VF doesn't support RARP packet generation, virtio frontend supporting
96 VIRTIO_NET_F_GUEST_ANNOUNCE feature can help to do that.