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.

A sysfs based management interface is implemented, devices are
created and removed through:

/sys/devices/virtual/vdpa_simulator/netdev/{create|remove}

Netlink based lifecycle management could be implemented for vDPA
simulator as well.

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.

Signed-off-by: Jason Wang <jasowang@redhat.com>
  • Loading branch information
jasowang authored and intel-lab-lkp committed Jan 17, 2020
1 parent 47143b6 commit 5504776
Show file tree
Hide file tree
Showing 3 changed files with 814 additions and 0 deletions.
17 changes: 17 additions & 0 deletions drivers/virtio/vdpa/Kconfig
Expand Up @@ -7,3 +7,20 @@ config VDPA
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"
select VDPA
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
@@ -1,2 +1,3 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_VDPA) += vdpa.o
obj-$(CONFIG_VDPA_SIM) += vdpa_sim.o

0 comments on commit 5504776

Please sign in to comment.