Skip to content

Commit

Permalink
vdpasim: vDPA device simulator
Browse files Browse the repository at this point in the history
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 <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20200326140125.19794-9-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
jasowang authored and mstsirkin committed Apr 2, 2020
1 parent 4c8cf31 commit 2c53d0f
Show file tree
Hide file tree
Showing 4 changed files with 651 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/virtio/vdpa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,22 @@ config VDPA
Enable this module to support vDPA device that uses a
datapath which complies with virtio specifications with
vendor specific control path.

menuconfig VDPA_MENU
bool "VDPA drivers"
default n

if VDPA_MENU

config VDPA_SIM
tristate "vDPA device simulator"
depends on RUNTIME_TESTING_MENU
select VDPA
select VHOST_RING
default n
help
vDPA networking device simulator which loop TX traffic back
to RX. This device is used for testing, prototyping and
development of vDPA.

endif # VDPA_MENU
1 change: 1 addition & 0 deletions drivers/virtio/vdpa/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_VDPA) += vdpa.o
obj-$(CONFIG_VDPA_SIM) += vdpa_sim/
2 changes: 2 additions & 0 deletions drivers/virtio/vdpa/vdpa_sim/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_VDPA_SIM) += vdpa_sim.o

0 comments on commit 2c53d0f

Please sign in to comment.