Skip to contentSkip to conversation

vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices

PATCH Applied Xin Zeng 2 participants 2 messages Apr 26, 2024 – May 3, 2024

Subsystems (5)
lore
Share & tools
lore

Xin Zeng

author
#0 lore raw

PATCH v7 1/1 vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices

Add vfio pci variant driver for Intel QAT SR-IOV VF devices. This driver registers to the vfio subsystem through the interfaces exposed by the susbsystem. It follows the live migration protocol v2 defined in uapi/linux/vfio.h and interacts with Intel QAT PF driver through a set of interfaces defined in qat/qat_mig_dev.h to support live migration of Intel QAT VF devices.

This version only covers migration for Intel QAT GEN4 VF devices.

---
Changes in v7:
- Move some device specific details from the commit message into driver and add more comments around the P2P state handler (Alex)

V6:
https://lore.kernel.org/kvm/[email protected]

---
 MAINTAINERS                   |   8 +
 drivers/vfio/pci/Kconfig      |   2 +
 drivers/vfio/pci/Makefile     |   2 +
 drivers/vfio/pci/qat/Kconfig  |  12 +
 drivers/vfio/pci/qat/Makefile |   3 +
 drivers/vfio/pci/qat/main.c   | 702 ++++++++++++++++++++++++++++++++++
 6 files changed, 729 insertions(+)
 create mode 100644 drivers/vfio/pci/qat/Kconfig
 create mode 100644 drivers/vfio/pci/qat/Makefile
 create mode 100644 drivers/vfio/pci/qat/main.c
MAINTAINERS +8 -0
index aa3b947fb080..929cf84ff852 100644
@@ -23241,6 +23241,14 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/vfio/platform/
 
+VFIO QAT PCI DRIVER
+M:	Xin Zeng <[email protected]>
+M:	Giovanni Cabiddu <[email protected]>
+L:	[email protected]
+L:	[email protected]
+S:	Supported
+F:	drivers/vfio/pci/qat/
+
 VFIO VIRTIO PCI DRIVER
 M:	Yishai Hadas <[email protected]>
 L:	[email protected]
drivers/vfio/pci/Kconfig +2 -0
index 15821a2d77d2..bf50ffa10bde 100644
@@ -69,4 +69,6 @@ source "drivers/vfio/pci/virtio/Kconfig"
 
 source "drivers/vfio/pci/nvgrace-gpu/Kconfig"
 
+source "drivers/vfio/pci/qat/Kconfig"
+
 endmenu
drivers/vfio/pci/Makefile +2 -0
index ce7a61f1d912..cf00c0a7e55c 100644
@@ -17,3 +17,5 @@ obj-$(CONFIG_PDS_VFIO_PCI) += pds/
 obj-$(CONFIG_VIRTIO_VFIO_PCI) += virtio/
 
 obj-$(CONFIG_NVGRACE_GPU_VFIO_PCI) += nvgrace-gpu/
+
+obj-$(CONFIG_QAT_VFIO_PCI) += qat/
drivers/vfio/pci/qat/Kconfig new file +12 -0
new file mode 100644
index 000000000000..bf52cfa4b595
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config QAT_VFIO_PCI
+	tristate "VFIO support for QAT VF PCI devices"
+	select VFIO_PCI_CORE
+	depends on CRYPTO_DEV_QAT_4XXX
+	help
+	  This provides migration support for Intel(R) QAT Virtual Function
+	  using the VFIO framework.
+
+	  To compile this as a module, choose M here: the module
+	  will be called qat_vfio_pci. If you don't know what to do here,
+	  say N.
drivers/vfio/pci/qat/Makefile new file +3 -0
new file mode 100644
index 000000000000..5fe5c4ec19d3
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_QAT_VFIO_PCI) += qat_vfio_pci.o
+qat_vfio_pci-y := main.o
drivers/vfio/pci/qat/main.c new file +702 -0

702 lines not on this page · raw message

base-commit: f0bbfc391aa7eaa796f09ee40dd1cd78c6c81960

Signature · 1 line
2.18.2
#1 lore raw
Quoted 21 lines · On Fri, 26 Apr 2024 14:40:51 +0800 Xin Zeng <[email protected]> wrote:

Add vfio pci variant driver for Intel QAT SR-IOV VF devices. This driver registers to the vfio subsystem through the interfaces exposed by the susbsystem. It follows the live migration protocol v2 defined in uapi/linux/vfio.h and interacts with Intel QAT PF driver through a set of interfaces defined in qat/qat_mig_dev.h to support live migration of Intel QAT VF devices.

This version only covers migration for Intel QAT GEN4 VF devices.

---
Changes in v7:
- Move some device specific details from the commit message into driver and add more comments around the P2P state handler (Alex)

V6:
https://lore.kernel.org/kvm/[email protected]

Quoted 11 lines
---
 MAINTAINERS                   |   8 +
 drivers/vfio/pci/Kconfig      |   2 +
 drivers/vfio/pci/Makefile     |   2 +
 drivers/vfio/pci/qat/Kconfig  |  12 +
 drivers/vfio/pci/qat/Makefile |   3 +
 drivers/vfio/pci/qat/main.c   | 702 ++++++++++++++++++++++++++++++++++
 6 files changed, 729 insertions(+)
 create mode 100644 drivers/vfio/pci/qat/Kconfig
 create mode 100644 drivers/vfio/pci/qat/Makefile
 create mode 100644 drivers/vfio/pci/qat/main.c

Applied to vfio next branch for v6.10. Thanks,

Alex