qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v1 3/4] vhost-vdpa: implement vhost-vdpa backend


From: Laurent Vivier
Subject: Re: [RFC v1 3/4] vhost-vdpa: implement vhost-vdpa backend
Date: Tue, 21 Apr 2020 17:54:14 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 20/04/2020 11:32, Cindy Lu wrote:
> Currently we have 2 types of vhost backends in QEMU: vhost kernel and
> vhost-user. The above patch provides a generic device for vDPA purpose,
> this vDPA device exposes to user space a non-vendor-specific configuration
> interface for setting up a vhost HW accelerator, this patch set introduces
> a third vhost backend called vhost-vdpa based on the vDPA interface.
> 
> Vhost-vdpa usage:
> 
>   qemu-system-x86_64 -cpu host -enable-kvm \
>     ......
>   -netdev type=vhost-vdpa,vhostdev=/dev/vhost-vdpa-id,id=vhost-vdpa0 \
>   -device virtio-net-pci,netdev=vhost-vdpa0,page-per-vq=on \
> 
> Author: Tiwei Bie

Use "git commit --author" to set that.

> Signed-off-by: Cindy Lu <address@hidden>
> ---
>  hw/net/vhost_net.c                |  43 ++++
>  hw/net/virtio-net.c               |   9 +
>  hw/virtio/Makefile.objs           |   2 +-
>  hw/virtio/vhost-backend.c         |   3 +
>  hw/virtio/vhost-vdpa.c            | 379 ++++++++++++++++++++++++++++++
>  hw/virtio/vhost.c                 |   5 +
>  include/hw/virtio/vhost-backend.h |   6 +-
>  include/hw/virtio/vhost-vdpa.h    |  14 ++
>  8 files changed, 459 insertions(+), 2 deletions(-)
>  create mode 100644 hw/virtio/vhost-vdpa.c
>  create mode 100644 include/hw/virtio/vhost-vdpa.h
> 
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index 4096d64aaf..0d13fda2fc 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
...
> @@ -434,6 +462,10 @@ VHostNetState *get_vhost_net(NetClientState *nc)
>          assert(vhost_net);
>          break;
>  #endif
> +    case NET_CLIENT_DRIVER_VHOST_VDPA:
> +        vhost_net = vhost_vdpa_get_vhost_net(nc);
> +        assert(vhost_net);
> +        break;

This should be inside a "#ifdef".

Thanks,
Laurent




reply via email to

[Prev in Thread] Current Thread [Next in Thread]