path: root/drivers/net/ifc
AgeCommit message (Collapse)Author
2019-02-08vhost: remove vDPA available ring relay helperXiao Wang
We don't need to relay available ring and check the desc, vdpa device can access the available ring in the guest directly. With this patch, we can achieve better throughput and lower CPU usage. Signed-off-by: Xiao Wang <> Reviewed-by: Maxime Coquelin <>
2018-12-21net/ifc: support SW assisted VDPA live migrationXiao Wang
In SW assisted live migration mode, driver will stop the device and setup a mediated virtio ring to relay the communication between the virtio driver and the VDPA device. This data path intervention will allow SW to help on guest dirty page logging for live migration. This SW fallback is event driven relay thread, so when the network throughput is low, this SW fallback will take little CPU resource, but when the throughput goes up, the relay thread's CPU usage will goes up accordingly. User needs to take all the factors including CPU usage, guest perf degradation, etc. into consideration when selecting the live migration support mode. Signed-off-by: Xiao Wang <> Reviewed-by: Maxime Coquelin <>
2018-12-21net/ifc: use vhost lib function for used ring loggingXiao Wang
Vhost lib has already provided a helper for used ring logging, driver could use it to reduce code. Signed-off-by: Xiao Wang <> Reviewed-by: Maxime Coquelin <>
2018-12-21net/ifc: add LM mode parameterXiao Wang
This patch series enables a new method for live migration, i.e. software assisted live migration. This patch provides a device argument for user to choose the methold. When "sw-live-migration=1", driver/device will do live migration with a relay thread dealing with dirty page logging. Without this parameter, device will do dirty page logging and there's no relay thread consuming CPU resource. Signed-off-by: Xiao Wang <> Reviewed-by: Maxime Coquelin <>
2018-12-21net/ifc: detect if VDPA mode is specifiedXiao Wang
If user wants the VF to be used in VDPA (vhost data path acceleration) mode, then the user can add a "vdpa=1" parameter for the device. So if driver does not find this option, it should quit and let the bus continue the probe. Signed-off-by: Xiao Wang <> Reviewed-by: Maxime Coquelin <>
2018-12-21net/ifc: store only registered device instanceXiao Wang
If driver fails to register ifc VF device into vhost lib, then this device should not be stored. Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver") Cc: Signed-off-by: Xiao Wang <> Reviewed-by: Maxime Coquelin <>
2018-12-21net/ifc: add probing error logsXiao Wang
Driver probe may fail for different causes, debug message is helpful for debugging issue. Signed-off-by: Xiao Wang <> Reviewed-by: Maxime Coquelin <>
2018-12-21vhost: provide helper for host notifier ctrlXiao Wang
VDPA driver can decide if it needs to enable/disable the host notifier mapping, so exposing a API can allow flexibility. A later patch will base on this. Signed-off-by: Xiao Wang <> Reviewed-by: Maxime Coquelin <>
2018-12-13net/ifcvf: fix typo on struct nameXiaolong Ye
The struct should be ifcvf_net_config other than ifcvf_net_device_config The variable is used as named opaque variable, struct fields are not accessed at all, so using wrong struct type has no effect but it should be fixed. Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver") Cc: Signed-off-by: Xiaolong Ye <> Acked-by: Xiao Wang <>
2018-10-29add missing static keyword to globalsFerruh Yigit
Some global variables can indeed be static, add static keyword to them. Signed-off-by: Ferruh Yigit <> Acked-by: Jerin Jacob <> Acked-by: Shreyansh Jain <>
2018-10-26drivers/net: use sleep delay by default for Intel NICsIlya Maximets
NICs uses different delays up to a second during their configuration. It makes no sense to busy-wait so long wasting CPU cycles and preventing any other threads to execute on the same CPU core. These busy polling are the rudiments that came from the kernel drivers where you can not sleep in interrupt context, but as we're in userspace, we're able and should sleep to allow other threads to run. Delays never called on rx/tx path, so this should not affect performance. Signed-off-by: Ilya Maximets <> Reviewed-by: Ferruh Yigit <>
2018-10-11net/ifc: invoke ifcvf HW init function in probeXiaolong Ye
As ifcvf_init_hw is independent with ifcvf_vfio_setup, it's better to invoke it directly in probe func. Signed-off-by: Xiaolong Ye <> Acked-by: Xiao Wang <>
2018-10-11net/ifc: fix address translation function nameXiao Wang
The address translation from user virtual address to guest physical address should not be named as qva_to_gpa. Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver") Cc: Signed-off-by: Xiao Wang <> Acked-by: Xiaolong Ye <>
2018-10-09net/ifc: fix build with Linux < 3.19Xiao Wang
The typedef of "__virtio16" is introduced into Linux kernel in v3.19. To prevent build error on old kernel, this patch replaces the "__virtio" usage with "uint16_t". Fixes: d7fe5a2861e7 ("net/ifc: support live migration") Signed-off-by: Xiao Wang <> Reviewed-by: Ferruh Yigit <>
2018-09-28net/ifc: support live migrationXiao Wang
IFCVF can help to log dirty page in live migration stage, each queue's index can be read and configured to support VHOST_USER_GET_VRING_BASE and VHOST_USER_SET_VRING_BASE. Signed-off-by: Xiao Wang <> Reviewed-by: Xiaolong Ye <> Tested-by: Xiaolong Ye <>
2018-09-28net/ifc: do not notify before HW readyXiao Wang
If the device is not clearly reset by the previous driver and holds some invalid ring addr, and the relay thread kicks it before HW is properly re-configured, a bad DMA request may happen. Besides, the notify_addr which is used by the relay thread is set in the vdpa_ifcvf_start function, if a kick relay happens before vdpa_ifcvf_start finishes, a null addr is accessed. Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver") Cc: Signed-off-by: Xiao Wang <> Reviewed-by: Xiaolong Ye <>
2018-07-26build: fix meson build on FreeBSDBruce Richardson
A number of drivers have dependencies on libraries which are only built on Linux, and so they need to be disabled on FreeBSD. Rather than basing the disabling on OS, in each case we base the building of the library on the presence of the required dependency. Fixes: 50385c106021 ("net/ifc: add to meson build") Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") Fixes: 5936aa3a39b9 ("net/vhost: add to meson build") Fixes: 3298fa4853b8 ("raw/dpaa2_cmdif: introduce DPAA2 command interface driver") Fixes: b1ee472fed58 ("raw/dpaa2_qdma: introduce the DPAA2 QDMA driver") Signed-off-by: Bruce Richardson <>
2018-07-12remove useless constructor headersThomas Monjalon
A constructor is usually declared with RTE_INIT* macros. As it is a static function, no need to declare before its definition. The macro is used directly in the function definition. Signed-off-by: Thomas Monjalon <>
2018-06-15net/ifc: enable the host notifier supportTiwei Bie
The necessary vDPA ops have already been implemented in ifcvf driver. So just need to announce the necessary protocol features to enable the host notifier support. Signed-off-by: Tiwei Bie <> Acked-by: Xiao Wang <> Reviewed-by: Maxime Coquelin <>
2018-06-14net/ifc: add to meson buildXiao Wang
Signed-off-by: Bruce Richardson <> Signed-off-by: Xiao Wang <>
2018-06-14net/ifc: make driver name consistentXiao Wang
Make the compiler switch name and document name consistent as ``ifc`` to avoid confusion. Also rename the map file to standard name for meson build in the process. Signed-off-by: Xiao Wang <> Signed-off-by: Bruce Richardson <>
2018-04-27net/ifcvf: add ifcvf vDPA driverXiao Wang
The IFCVF vDPA (vhost data path acceleration) driver provides support for the Intel FPGA 100G VF (IFCVF). IFCVF's datapath is virtio ring compatible, it works as a HW vhost backend which can send/receive packets to/from virtio directly by DMA. Different VF devices serve different virtio frontends which are in different VMs, so each VF needs to have its own DMA address translation service. During the driver probe a new container is created, with this container vDPA driver can program DMA remapping table with the VM's memory region information. Key vDPA driver ops implemented: - ifcvf_dev_config: Enable VF data path with virtio information provided by vhost lib, including IOMMU programming to enable VF DMA to VM's memory, VFIO interrupt setup to route HW interrupt to virtio driver, create notify relay thread to translate virtio driver's kick to a MMIO write onto HW, HW queues configuration. - ifcvf_dev_close: Revoke all the setup in ifcvf_dev_config. Live migration feature is supported by IFCVF and this driver enables it. For the dirty page logging, VF helps to log for packet buffer write, driver helps to make the used ring as dirty when device stops. Because vDPA driver needs to set up MSI-X vector to interrupt the guest, only vfio-pci is supported currently. Signed-off-by: Xiao Wang <> Signed-off-by: Rosen Xu <> Reviewed-by: Maxime Coquelin <> Reviewed-by: Ferruh Yigit <>