qemu-devel
[Top][All Lists]
Advanced

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

RE: [PATCH v3 05/10] vdpa-dev: implement the realize interface


From: Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Subject: RE: [PATCH v3 05/10] vdpa-dev: implement the realize interface
Date: Tue, 29 Mar 2022 05:15:47 +0000


> -----Original Message-----
> From: Stefano Garzarella [mailto:sgarzare@redhat.com]
> Sent: Monday, March 28, 2022 11:00 PM
> To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> <longpeng2@huawei.com>
> Cc: Stefan Hajnoczi <stefanha@redhat.com>; Michael Tsirkin <mst@redhat.com>;
> Cornelia Huck <cohuck@redhat.com>; Paolo Bonzini <pbonzini@redhat.com>;
> Gonglei (Arei) <arei.gonglei@huawei.com>; Yechuan <yechuan@huawei.com>;
> Huangzhichao <huangzhichao@huawei.com>; qemu devel list 
> <qemu-devel@nongnu.org>
> Subject: Re: [PATCH v3 05/10] vdpa-dev: implement the realize interface
> 
> On Sat, Mar 19, 2022 at 03:20:07PM +0800, Longpeng(Mike) wrote:
> >From: Longpeng <longpeng2@huawei.com>
> >

[snap]

> > static void vhost_vdpa_device_unrealize(DeviceState *dev)
> >@@ -66,6 +197,7 @@ static void vhost_vdpa_device_set_status(VirtIODevice 
> >*vdev,
> uint8_t status)
> > static Property vhost_vdpa_device_properties[] = {
> >     DEFINE_PROP_STRING("vdpa-dev", VhostVdpaDevice, vdpa_dev),
> >     DEFINE_PROP_INT32("vdpa-dev-fd", VhostVdpaDevice, vdpa_dev_fd, -1),
> 
> Other vhost devices use the `vhostfd` property, maybe we should use the
> same name.
> 
> If we go for this change, then maybe we also need to change `vdpa-dev`
> to `vhostpath` or something like that
> 

Make sense.

I prefer to use 'vhostdev' for the file path, just like the usage in Netdev:
  -netdev type=vhost-vdpa,vhostdev=/dev/vhost-vdpa-0,id=vhostvdpa1

> Thanks,
> Stefano
> 
> >+    DEFINE_PROP_UINT16("queue-size", VhostVdpaDevice, queue_size, 0),
> >     DEFINE_PROP_END_OF_LIST(),
> > };
> >
> >diff --git a/include/hw/virtio/vdpa-dev.h b/include/hw/virtio/vdpa-dev.h
> >index 476bda0873..cf11abd0f7 100644
> >--- a/include/hw/virtio/vdpa-dev.h
> >+++ b/include/hw/virtio/vdpa-dev.h
> >@@ -28,6 +28,16 @@ struct VhostVdpaDevice {
> >     char *vdpa_dev;
> >     int vdpa_dev_fd;
> >     int32_t bootindex;
> >+    uint32_t vdev_id;
> >+    uint32_t num_queues;
> >+    struct vhost_dev dev;
> >+    struct vhost_vdpa vdpa;
> >+    VirtQueue **virtqs;
> >+    uint8_t *config;
> >+    int config_size;
> >+    uint16_t queue_size;
> >+    bool started;
> >+    int (*post_init)(VhostVdpaDevice *v, Error **errp);
> > };
> >
> > #endif
> >--
> >2.23.0
> >




reply via email to

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