[RFC 00/10] add generic vDPA device support

Longpeng(Mike) via posted 10 patches 2 years, 3 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220105005900.860-1-longpeng2@huawei.com
Maintainers: Cornelia Huck <cohuck@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
There is a newer version of this series
hw/virtio/Kconfig            |   5 +
hw/virtio/meson.build        |   2 +
hw/virtio/vdpa-dev-pci.c     | 127 +++++++++++++
hw/virtio/vdpa-dev.c         | 355 +++++++++++++++++++++++++++++++++++
hw/virtio/virtio-pci.c       |  93 +++++++++
hw/virtio/virtio-pci.h       |   4 +
include/hw/virtio/vdpa-dev.h |  26 +++
linux-headers/linux/vhost.h  |  10 +
8 files changed, 622 insertions(+)
create mode 100644 hw/virtio/vdpa-dev-pci.c
create mode 100644 hw/virtio/vdpa-dev.c
create mode 100644 include/hw/virtio/vdpa-dev.h
[RFC 00/10] add generic vDPA device support
Posted by Longpeng(Mike) via 2 years, 3 months ago
From: Longpeng <longpeng2@huawei.com>

Hi guys,

This patchset tries to support the generic vDPA device, the previous
disscussion can be found here [1].

With the generic vDPA device, QEMU won't need to touch the device
types any more, such like vfio.

We can use the generic vDPA device as follow:
  -device vhost-vdpa-device-pci,vdpa-dev=/dev/vhost-vdpa-X

I've done some simple tests on Huawei's offloading card (net, 0.95)
and vdpa_sim_blk (1.0);

Note:
  the kernel part does not send out yet, I'll send it as soon as possible.

[1] https://lore.kernel.org/all/20211208052010.1719-1-longpeng2@huawei.com/

Longpeng (Mike) (10):
  virtio: get class_id and pci device id by the virtio id
  vhost: add 3 commands for vhost-vdpa
  vdpa: add the infrastructure of vdpa-dev
  vdpa-dev: implement the instance_init/class_init interface
  vdpa-dev: implement the realize interface
  vdpa-dev: implement the unrealize interface
  vdpa-dev: implement the get_config/set_config interface
  vdpa-dev: implement the get_features interface
  vdpa-dev: implement the set_status interface
  vdpa-dev: mark the device as unmigratable

 hw/virtio/Kconfig            |   5 +
 hw/virtio/meson.build        |   2 +
 hw/virtio/vdpa-dev-pci.c     | 127 +++++++++++++
 hw/virtio/vdpa-dev.c         | 355 +++++++++++++++++++++++++++++++++++
 hw/virtio/virtio-pci.c       |  93 +++++++++
 hw/virtio/virtio-pci.h       |   4 +
 include/hw/virtio/vdpa-dev.h |  26 +++
 linux-headers/linux/vhost.h  |  10 +
 8 files changed, 622 insertions(+)
 create mode 100644 hw/virtio/vdpa-dev-pci.c
 create mode 100644 hw/virtio/vdpa-dev.c
 create mode 100644 include/hw/virtio/vdpa-dev.h

-- 
2.23.0


Re: [RFC 00/10] add generic vDPA device support
Posted by Stefan Hajnoczi 2 years, 3 months ago
On Wed, Jan 05, 2022 at 08:58:50AM +0800, Longpeng(Mike) wrote:
> From: Longpeng <longpeng2@huawei.com>
> 
> Hi guys,
> 
> This patchset tries to support the generic vDPA device, the previous
> disscussion can be found here [1].
> 
> With the generic vDPA device, QEMU won't need to touch the device
> types any more, such like vfio.
> 
> We can use the generic vDPA device as follow:
>   -device vhost-vdpa-device-pci,vdpa-dev=/dev/vhost-vdpa-X
> 
> I've done some simple tests on Huawei's offloading card (net, 0.95)
> and vdpa_sim_blk (1.0);
> 
> Note:
>   the kernel part does not send out yet, I'll send it as soon as possible.
> 
> [1] https://lore.kernel.org/all/20211208052010.1719-1-longpeng2@huawei.com/
> 
> Longpeng (Mike) (10):
>   virtio: get class_id and pci device id by the virtio id
>   vhost: add 3 commands for vhost-vdpa
>   vdpa: add the infrastructure of vdpa-dev
>   vdpa-dev: implement the instance_init/class_init interface
>   vdpa-dev: implement the realize interface
>   vdpa-dev: implement the unrealize interface
>   vdpa-dev: implement the get_config/set_config interface
>   vdpa-dev: implement the get_features interface
>   vdpa-dev: implement the set_status interface
>   vdpa-dev: mark the device as unmigratable

Nice and small.

Stefan