Skip to content

Commit 2c53d0f

Browse files
jasowangmstsirkin
authored andcommitted
vdpasim: vDPA device simulator
This patch implements a software vDPA networking device. The datapath is implemented through vringh and workqueue. The device has an on-chip IOMMU which translates IOVA to PA. For kernel virtio drivers, vDPA simulator driver provides dma_ops. For vhost driers, set_map() methods of vdpa_config_ops is implemented to accept mappings from vhost. Currently, vDPA device simulator will loopback TX traffic to RX. So the main use case for the device is vDPA feature testing, prototyping and development. Note, there's no management API implemented, a vDPA device will be registered once the module is probed. We need to handle this in the future development. Signed-off-by: Jason Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 4c8cf31 commit 2c53d0f

File tree

4 files changed

+651
-0
lines changed

4 files changed

+651
-0
lines changed

drivers/virtio/vdpa/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,22 @@ config VDPA
55
Enable this module to support vDPA device that uses a
66
datapath which complies with virtio specifications with
77
vendor specific control path.
8+
9+
menuconfig VDPA_MENU
10+
bool "VDPA drivers"
11+
default n
12+
13+
if VDPA_MENU
14+
15+
config VDPA_SIM
16+
tristate "vDPA device simulator"
17+
depends on RUNTIME_TESTING_MENU
18+
select VDPA
19+
select VHOST_RING
20+
default n
21+
help
22+
vDPA networking device simulator which loop TX traffic back
23+
to RX. This device is used for testing, prototyping and
24+
development of vDPA.
25+
26+
endif # VDPA_MENU

drivers/virtio/vdpa/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0
22
obj-$(CONFIG_VDPA) += vdpa.o
3+
obj-$(CONFIG_VDPA_SIM) += vdpa_sim/

drivers/virtio/vdpa/vdpa_sim/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
obj-$(CONFIG_VDPA_SIM) += vdpa_sim.o

0 commit comments

Comments
 (0)