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