From: Jason Wang <jasowang@redhat.com>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: "rdunlap@infradead.org" <rdunlap@infradead.org>,
"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>,
"christophe.de.dinechin@gmail.com"
<christophe.de.dinechin@gmail.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"mst@redhat.com" <mst@redhat.com>,
"airlied@linux.ie" <airlied@linux.ie>,
"heiko.carstens@de.ibm.com" <heiko.carstens@de.ibm.com>,
"kevin.tian@intel.com" <kevin.tian@intel.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"oberpar@linux.ibm.com" <oberpar@linux.ibm.com>,
"kwankhede@nvidia.com" <kwankhede@nvidia.com>,
"rob.miller@broadcom.com" <rob.miller@broadcom.com>,
"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
"sebott@linux.ibm.com" <sebott@linux.ibm.com>,
"lulu@redhat.com" <lulu@redhat.com>,
"eperezma@redhat.com" <eperezma@redhat.com>,
"pasic@linux.ibm.com" <pasic@linux.ibm.com>,
borntraeger@de.ibm.com
Subject: Re: [PATCH V13 4/6] mdev: introduce mediated virtio bus
Date: Tue, 19 Nov 2019 10:40:07 +0800 [thread overview]
Message-ID: <f20d69d7-d621-b309-4a7d-1ba0ff22ee09@redhat.com> (raw)
In-Reply-To: <20191118134056.GJ3873@mellanox.com>
On 2019/11/18 下午9:41, Jason Gunthorpe wrote:
> On Mon, Nov 18, 2019 at 06:59:21PM +0800, Jason Wang wrote:
>> +struct bus_type mdev_virtio_bus_type;
>> +
>> +struct mdev_virtio_device {
>> + struct mdev_device mdev;
>> + const struct mdev_virtio_ops *ops;
>> + u16 class_id;
>> +};
> This seems to share nothing with mdev (ie mdev-vfio), why is it on the
> same bus?
>
> We went over this recently with Greg and he seemed pretty clear on
> this..
Mdev-vfio is not on this bus. The class_id here is used for distinguish
userspace virtio driver (vhost-mdev) and kernel virtio driver (virtio-mdev).
Parent can choose to create a type of "vhost" device then vhost-mdev
driver is matched, or "virtio" device then virtio-mdev driver is matched.
>
>> +struct mdev_virtio_ops {
>> + /* Virtqueue ops */
>> + int (*set_vq_address)(struct mdev_device *mdev,
>> + u16 idx, u64 desc_area, u64 driver_area,
>> + u64 device_area);
>> + void (*set_vq_num)(struct mdev_device *mdev, u16 idx, u32 num);
>> + void (*kick_vq)(struct mdev_device *mdev, u16 idx);
>> + void (*set_vq_cb)(struct mdev_device *mdev, u16 idx,
>> + struct virtio_mdev_callback *cb);
>> + void (*set_vq_ready)(struct mdev_device *mdev, u16 idx, bool ready);
>> + bool (*get_vq_ready)(struct mdev_device *mdev, u16 idx);
>> + int (*set_vq_state)(struct mdev_device *mdev, u16 idx, u64 state);
>> + u64 (*get_vq_state)(struct mdev_device *mdev, u16 idx);
>> +
>> + /* Device ops */
>> + u16 (*get_vq_align)(struct mdev_device *mdev);
>> + u64 (*get_features)(struct mdev_device *mdev);
>> + int (*set_features)(struct mdev_device *mdev, u64 features);
>> + void (*set_config_cb)(struct mdev_device *mdev,
>> + struct virtio_mdev_callback *cb);
>> + u16 (*get_vq_num_max)(struct mdev_device *mdev);
>> + u32 (*get_device_id)(struct mdev_device *mdev);
>> + u32 (*get_vendor_id)(struct mdev_device *mdev);
>> + u8 (*get_status)(struct mdev_device *mdev);
>> + void (*set_status)(struct mdev_device *mdev, u8 status);
>> + void (*get_config)(struct mdev_device *mdev, unsigned int offset,
>> + void *buf, unsigned int len);
>> + void (*set_config)(struct mdev_device *mdev, unsigned int offset,
>> + const void *buf, unsigned int len);
>> + u32 (*get_generation)(struct mdev_device *mdev);
>> +};
> Why aren't all of these 'struct mdev_device_virtio *' ?
>
> Jason
It can simplify the assignment of those ops in mdev device implementation.
Thanks
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <jasowang@redhat.com>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: "rdunlap@infradead.org" <rdunlap@infradead.org>,
"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>,
"christophe.de.dinechin@gmail.com"
<christophe.de.dinechin@gmail.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"mst@redhat.com" <mst@redhat.com>,
"airlied@linux.ie" <airlied@linux.ie>,
"heiko.carstens@de.ibm.com" <heiko.carstens@de.ibm.com>,
"kevin.tian@intel.com" <kevin.tian@intel.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"oberpar@linux.ibm.com" <oberpar@linux.ibm.com>,
"kwankhede@nvidia.com" <kwankhede@nvidia.com>,
"rob.miller@broadcom.com" <rob.miller@broadcom.com>,
"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
"sebott@linux.ibm.com" <sebott@linux.ibm.com>,
"lulu@redhat.com" <lulu@redhat.com>,
"eperezma@redhat.com" <eperezma@redhat.com>,
"pasic@linux.ibm.com" <pasic@linux.ibm.com>,
"borntraeger@de.ibm.com" <borntraeger@de.ibm.com>,
"haotian.wang@sifive.com" <haotian.wang@sifive.com>,
"jeffrey.t.kirsher@intel.com" <jeffrey.t.kirsher@intel.com>,
"cunming.liang@intel.com" <cunming.liang@intel.com>,
"zhi.a.wang@intel.com" <zhi.a.wang@intel.com>,
"farman@linux.ibm.com" <farman@linux.ibm.com>,
Parav Pandit <parav@mellanox.com>,
"gor@linux.ibm.com" <gor@linux.ibm.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
"xiao.w.wang@intel.com" <xiao.w.wang@intel.com>,
"freude@linux.ibm.com" <freude@linux.ibm.com>,
"stefanha@redhat.com" <stefanha@redhat.com>,
"zhihong.wang@intel.com" <zhihong.wang@intel.com>,
"rodrigo.vivi@intel.com" <rodrigo.vivi@intel.com>,
"intel-gvt-dev@lists.freedesktop.org"
<intel-gvt-dev@lists.freedesktop.org>,
"hch@infradead.org" <hch@infradead.org>,
"akrowiak@linux.ibm.com" <akrowiak@linux.ibm.com>,
"aadam@redhat.com" <aadam@redhat.com>,
Jiri Pirko <jiri@mellanox.com>,
"tiwei.bie@intel.com" <tiwei.bie@intel.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"cohuck@redhat.com" <cohuck@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"lingshan.zhu@intel.com" <lingshan.zhu@intel.com>
Subject: Re: [PATCH V13 4/6] mdev: introduce mediated virtio bus
Date: Tue, 19 Nov 2019 10:40:07 +0800 [thread overview]
Message-ID: <f20d69d7-d621-b309-4a7d-1ba0ff22ee09@redhat.com> (raw)
Message-ID: <20191119024007.y67HcV0H_enZIgpjtfUTAhWVABVwDKzkZgmv3VZrsgs@z> (raw)
In-Reply-To: <20191118134056.GJ3873@mellanox.com>
On 2019/11/18 下午9:41, Jason Gunthorpe wrote:
> On Mon, Nov 18, 2019 at 06:59:21PM +0800, Jason Wang wrote:
>> +struct bus_type mdev_virtio_bus_type;
>> +
>> +struct mdev_virtio_device {
>> + struct mdev_device mdev;
>> + const struct mdev_virtio_ops *ops;
>> + u16 class_id;
>> +};
> This seems to share nothing with mdev (ie mdev-vfio), why is it on the
> same bus?
>
> We went over this recently with Greg and he seemed pretty clear on
> this..
Mdev-vfio is not on this bus. The class_id here is used for distinguish
userspace virtio driver (vhost-mdev) and kernel virtio driver (virtio-mdev).
Parent can choose to create a type of "vhost" device then vhost-mdev
driver is matched, or "virtio" device then virtio-mdev driver is matched.
>
>> +struct mdev_virtio_ops {
>> + /* Virtqueue ops */
>> + int (*set_vq_address)(struct mdev_device *mdev,
>> + u16 idx, u64 desc_area, u64 driver_area,
>> + u64 device_area);
>> + void (*set_vq_num)(struct mdev_device *mdev, u16 idx, u32 num);
>> + void (*kick_vq)(struct mdev_device *mdev, u16 idx);
>> + void (*set_vq_cb)(struct mdev_device *mdev, u16 idx,
>> + struct virtio_mdev_callback *cb);
>> + void (*set_vq_ready)(struct mdev_device *mdev, u16 idx, bool ready);
>> + bool (*get_vq_ready)(struct mdev_device *mdev, u16 idx);
>> + int (*set_vq_state)(struct mdev_device *mdev, u16 idx, u64 state);
>> + u64 (*get_vq_state)(struct mdev_device *mdev, u16 idx);
>> +
>> + /* Device ops */
>> + u16 (*get_vq_align)(struct mdev_device *mdev);
>> + u64 (*get_features)(struct mdev_device *mdev);
>> + int (*set_features)(struct mdev_device *mdev, u64 features);
>> + void (*set_config_cb)(struct mdev_device *mdev,
>> + struct virtio_mdev_callback *cb);
>> + u16 (*get_vq_num_max)(struct mdev_device *mdev);
>> + u32 (*get_device_id)(struct mdev_device *mdev);
>> + u32 (*get_vendor_id)(struct mdev_device *mdev);
>> + u8 (*get_status)(struct mdev_device *mdev);
>> + void (*set_status)(struct mdev_device *mdev, u8 status);
>> + void (*get_config)(struct mdev_device *mdev, unsigned int offset,
>> + void *buf, unsigned int len);
>> + void (*set_config)(struct mdev_device *mdev, unsigned int offset,
>> + const void *buf, unsigned int len);
>> + u32 (*get_generation)(struct mdev_device *mdev);
>> +};
> Why aren't all of these 'struct mdev_device_virtio *' ?
>
> Jason
It can simplify the assignment of those ops in mdev device implementation.
Thanks
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-11-19 2:40 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-18 10:59 [PATCH V13 0/6] mdev based hardware virtio offloading support Jason Wang
2019-11-18 10:59 ` [PATCH V13 1/6] mdev: make mdev bus agnostic Jason Wang
2019-11-19 3:08 ` Randy Dunlap
2019-11-19 3:08 ` Randy Dunlap
2019-11-18 10:59 ` [PATCH V13 2/6] mdev: split out VFIO bus specific parent ops Jason Wang
2019-11-18 10:59 ` Jason Wang
2019-11-18 10:59 ` [PATCH V13 3/6] mdev: move to drivers/ Jason Wang
2019-11-18 10:59 ` Jason Wang
2019-11-19 3:11 ` Randy Dunlap
2019-11-19 3:11 ` Randy Dunlap
2019-11-18 10:59 ` [PATCH V13 4/6] mdev: introduce mediated virtio bus Jason Wang
2019-11-18 13:41 ` Jason Gunthorpe
2019-11-18 13:41 ` Jason Gunthorpe
2019-11-18 20:27 ` Michael S. Tsirkin
2019-11-18 20:27 ` Michael S. Tsirkin
2019-11-18 20:28 ` Jason Gunthorpe
2019-11-18 20:28 ` Jason Gunthorpe
2019-11-19 2:41 ` Jason Wang
2019-11-19 2:41 ` Jason Wang
2019-11-19 12:38 ` Jason Gunthorpe
2019-11-19 14:02 ` Jason Wang
2019-11-19 14:02 ` Jason Wang
2019-11-19 14:14 ` Jason Gunthorpe
2019-11-20 2:14 ` Jason Wang
2019-11-20 2:14 ` Jason Wang
2019-11-20 13:49 ` Jason Gunthorpe
2019-11-20 13:49 ` Jason Gunthorpe
2019-11-21 3:05 ` Jason Wang
2019-11-21 3:05 ` Jason Wang
2019-11-26 12:07 ` Rob Miller
2019-11-26 12:07 ` Rob Miller
2019-11-19 2:40 ` Jason Wang [this message]
2019-11-19 2:40 ` Jason Wang
2019-11-19 3:13 ` Randy Dunlap
2019-11-19 3:13 ` Randy Dunlap
2019-11-18 10:59 ` [PATCH V13 5/6] virtio: introduce a mdev based transport Jason Wang
2019-11-18 10:59 ` Jason Wang
2019-11-18 10:59 ` [PATCH V13 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework Jason Wang
2019-11-18 10:59 ` Jason Wang
2019-11-18 15:17 ` Greg KH
2019-11-18 15:17 ` Greg KH
2019-11-19 3:03 ` Jason Wang
2019-11-19 3:03 ` Jason Wang
2019-11-19 12:40 ` Jason Gunthorpe
2019-11-19 14:07 ` Jason Wang
2019-11-19 14:07 ` Jason Wang
2019-11-19 16:39 ` Jason Gunthorpe
2019-11-18 15:45 ` Cornelia Huck
2019-11-18 15:45 ` Cornelia Huck
2019-11-19 3:04 ` Jason Wang
2019-11-19 3:04 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f20d69d7-d621-b309-4a7d-1ba0ff22ee09@redhat.com \
--to=jasowang@redhat.com \
--cc=airlied@linux.ie \
--cc=borntraeger@de.ibm.com \
--cc=christophe.de.dinechin@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=eperezma@redhat.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jakub.kicinski@netronome.com \
--cc=jgg@mellanox.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=linux-s390@vger.kernel.org \
--cc=lulu@redhat.com \
--cc=mst@redhat.com \
--cc=oberpar@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=rdunlap@infradead.org \
--cc=rob.miller@broadcom.com \
--cc=sebott@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox