[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8a4e504d-abb9-44f1-73ea-e337f596bf75@redhat.com>
Date: Tue, 19 Nov 2019 11:04:51 +0800
From: Jason Wang <jasowang@...hat.com>
To: Cornelia Huck <cohuck@...hat.com>
Cc: kvm@...r.kernel.org, linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org,
intel-gvt-dev@...ts.freedesktop.org, kwankhede@...dia.com,
alex.williamson@...hat.com, mst@...hat.com, tiwei.bie@...el.com,
gregkh@...uxfoundation.org, jgg@...lanox.com,
netdev@...r.kernel.org, maxime.coquelin@...hat.com,
cunming.liang@...el.com, zhihong.wang@...el.com,
rob.miller@...adcom.com, xiao.w.wang@...el.com,
haotian.wang@...ive.com, zhenyuw@...ux.intel.com,
zhi.a.wang@...el.com, jani.nikula@...ux.intel.com,
joonas.lahtinen@...ux.intel.com, rodrigo.vivi@...el.com,
airlied@...ux.ie, daniel@...ll.ch, farman@...ux.ibm.com,
pasic@...ux.ibm.com, sebott@...ux.ibm.com, oberpar@...ux.ibm.com,
heiko.carstens@...ibm.com, gor@...ux.ibm.com,
borntraeger@...ibm.com, akrowiak@...ux.ibm.com,
freude@...ux.ibm.com, lingshan.zhu@...el.com, eperezma@...hat.com,
lulu@...hat.com, parav@...lanox.com,
christophe.de.dinechin@...il.com, kevin.tian@...el.com,
stefanha@...hat.com, rdunlap@...radead.org, hch@...radead.org,
aadam@...hat.com, jakub.kicinski@...ronome.com, jiri@...lanox.com,
jeffrey.t.kirsher@...el.com
Subject: Re: [PATCH V13 6/6] docs: sample driver to demonstrate how to
implement virtio-mdev framework
On 2019/11/18 下午11:45, Cornelia Huck wrote:
> On Mon, 18 Nov 2019 18:59:23 +0800
> Jason Wang <jasowang@...hat.com> wrote:
>
> [Note: I have not looked into the reworked architecture of this *at all*
> so far; just something that I noted...]
>
>> This sample driver creates mdev device that simulate virtio net device
>> over virtio mdev transport. The device is implemented through vringh
>> and workqueue. A device specific dma ops is to make sure HVA is used
>> directly as the IOVA. This should be sufficient for kernel virtio
>> driver to work.
>>
>> Only 'virtio' type is supported right now. I plan to add 'vhost' type
>> on top which requires some virtual IOMMU implemented in this sample
>> driver.
>>
>> Signed-off-by: Jason Wang <jasowang@...hat.com>
>> ---
>> MAINTAINERS | 1 +
>> samples/Kconfig | 10 +
>> samples/vfio-mdev/Makefile | 1 +
>> samples/vfio-mdev/mvnet_loopback.c | 690 +++++++++++++++++++++++++++++
>> 4 files changed, 702 insertions(+)
>> create mode 100644 samples/vfio-mdev/mvnet_loopback.c
>>
>> +static struct mvnet_dev {
>> + struct class *vd_class;
>> + struct idr vd_idr;
>> + struct device dev;
>> +} mvnet_dev;
> This structure embeds a struct device (a reference-counted structure),
> yet it is a static variable. This is giving a bad example to potential
> implementers; just allocate it dynamically.
Yes, as spotted by Greg.
>
>> +static void mvnet_device_release(struct device *dev)
>> +{
>> + dev_dbg(dev, "mvnet: released\n");
> And that also means you need a proper release function here, of
> course.
Right.
Thanks
>
>> +}
Powered by blists - more mailing lists