Re: [PATCH V9 5/6] virtio: introduce a mdev based transport

From: Jason Wang
Date: Wed Nov 06 2019 - 08:12:20 EST



On 2019/11/6 äå7:00, Cornelia Huck wrote:
On Wed, 6 Nov 2019 15:05:47 +0800
Jason Wang <jasowang@xxxxxxxxxx> wrote:

This patch introduces a new mdev transport for virtio. This is used to
use kernel virtio driver to drive the mediated device that is capable
of populating virtqueue directly.

A new virtio-mdev driver will be registered to the mdev bus, when a
new virtio-mdev device is probed, it will register the device with
mdev based config ops. This means it is a software transport between
mdev driver and mdev device. The transport was implemented through
device specific ops which is a part of mdev_parent_ops now.

Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
---
drivers/virtio/Kconfig | 13 ++
drivers/virtio/Makefile | 1 +
drivers/virtio/virtio_mdev.c | 406 +++++++++++++++++++++++++++++++++++
3 files changed, 420 insertions(+)
create mode 100644 drivers/virtio/virtio_mdev.c

diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
index 078615cf2afc..558ac607d107 100644
--- a/drivers/virtio/Kconfig
+++ b/drivers/virtio/Kconfig
@@ -43,6 +43,19 @@ config VIRTIO_PCI_LEGACY
If unsure, say Y.
+config VIRTIO_MDEV
+ tristate "MDEV driver for virtio devices"
+ depends on VFIO_MDEV && VIRTIO
+ default n
+ help
+ This driver provides support for virtio based paravirtual
+ device driver over MDEV bus. This requires your environemnt
+ has appropriate virtio mdev device implementation which may
+ operate on the physical device that the datapath of virtio
+ could be offloaded to hardware.
That sentence is a bit confusing to me... what about

"For this to be useful, you need an appropriate virtio mdev device
implementation that operates on a physical device to allow the datapath
of virtio to be offloaded to hardware."

?

+
+ If unsure, say M
Building this as a module should not hurt (but please add a trailing
'.' here :)

+
config VIRTIO_PMEM
tristate "Support for virtio pmem driver"
depends on VIRTIO
With the changes above,

Reviewed-by: Cornelia Huck <cohuck@xxxxxxxxxx>


Will post V10.

Thanks