Skip to contentSkip to conversation

vdpa: introduce virtio pci driver

PATCH Superseded Jason Wang 2 participants 3 messages Jun 10, 2020 virtio core

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jason Wang

author
#0 lore raw

PATCH v2 1/1 vdpa: introduce virtio pci driver

This patch introduce a vDPA driver for virtio-pci device. It bridges the virtio-pci control command to the vDPA bus. This will be used for developing new features for both software vDPA framework and hardware vDPA feature.

Compared to vdpa_sim, it has several advantages:

- it's a real device driver which allow us to play with real hardware features
- type independent instead of networking specific

Note that since virtio specification does not support get/restore virtqueue state. So we can not use this driver for VM. This can be addressed by extending the virtio specification.

Consider the driver is mainly for testing and development for vDPA features, it can only be bound via dynamic ids to make sure it's not conflict with the drivers like virtio-pci or IFCVF.

---
Changes since V1:
- use NULL id_table to allow dynamic ids only
- squash the doorbell reporting

---
 drivers/vdpa/Kconfig           |   8 +
 drivers/vdpa/Makefile          |   1 +
 drivers/vdpa/vp_vdpa/Makefile  |   2 +
 drivers/vdpa/vp_vdpa/vp_vdpa.c | 601 +++++++++++++++++++++++++++++++++
 4 files changed, 612 insertions(+)
 create mode 100644 drivers/vdpa/vp_vdpa/Makefile
 create mode 100644 drivers/vdpa/vp_vdpa/vp_vdpa.c
drivers/vdpa/Kconfig +8 -0
index e8140065c8a5..5cef3a4872e3 100644
@@ -28,4 +28,12 @@ config IFCVF
 	  To compile this driver as a module, choose M here: the module will
 	  be called ifcvf.
 
+config VP_VDPA
+	tristate "Virtio PCI bridge vDPA driver"
+	depends on PCI_MSI
+	help
+	  This kernel module that bridges virtio PCI device to vDPA
+	  bus. It allows us to test and develop vDPA subsystem inside
+	  an VM with the emulated virtio-pci device
+
 endif # VDPA
drivers/vdpa/Makefile +1 -0
index 8bbb686ca7a2..37d00f49b3bf 100644
@@ -2,3 +2,4 @@
 obj-$(CONFIG_VDPA) += vdpa.o
 obj-$(CONFIG_VDPA_SIM) += vdpa_sim/
 obj-$(CONFIG_IFCVF)    += ifcvf/
+obj-$(CONFIG_VP_VDPA)    += vp_vdpa/
drivers/vdpa/vp_vdpa/Makefile new file +2 -0
new file mode 100644
index 000000000000..231088d3af7d
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+obj-$(CONFIG_VP_VDPA) += vp_vdpa.o
drivers/vdpa/vp_vdpa/vp_vdpa.c new file +601 -0

601 lines not on this page · raw message

Signature · 1 line
2.20.1
#1 lore raw
Quoted 4 lines · Jason Wang

This patch introduce a vDPA driver for virtio-pci device. It bridges the virtio-pci control command to the vDPA bus. This will be used for developing new features for both software vDPA framework and hardware vDPA feature.

The mail headers are mailformed here:

Content-Type: text/plain; charset=a

so git am can't parse it:

error: cannot convert from a to UTF-8
fatal: could not parse patch

Signature · 1 line
MST
author
#2 lore raw
Quoted 5 lines · Michael S. Tsirkin
Quoted 4 lines · Jason Wang

This patch introduce a vDPA driver for virtio-pci device. It bridges the virtio-pci control command to the vDPA bus. This will be used for developing new features for both software vDPA framework and hardware vDPA feature.

Quoted 8 lines

The mail headers are mailformed here:

Content-Type: text/plain; charset=a

so git am can't parse it:

error: cannot convert from a to UTF-8
fatal: could not parse patch

My bad, let me repost.

Thanks