[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cca7901b-51dd-4f4b-5c30-c42577ad5194@redhat.com>
Date: Tue, 4 Feb 2020 16:28:27 +0800
From: Jason Wang <jasowang@...hat.com>
To: Zhu Lingshan <lingshan.zhu@...ux.intel.com>, mst@...hat.com,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org
Cc: tiwei.bie@...el.com, jgg@...lanox.com, 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, lingshan.zhu@...el.com,
eperezma@...hat.com, lulu@...hat.com, parav@...lanox.com,
kevin.tian@...el.com, stefanha@...hat.com, rdunlap@...radead.org,
hch@...radead.org, aadam@...hat.com, jakub.kicinski@...ronome.com,
jiri@...lanox.com, shahafs@...lanox.com, hanand@...inx.com,
mhabets@...arflare.com
Subject: Re: [PATCH 5/5] vdpasim: vDPA device simulator
On 2020/2/4 下午4:21, Zhu Lingshan wrote:
>> +static const struct dma_map_ops vdpasim_dma_ops = {
>> + .map_page = vdpasim_map_page,
>> + .unmap_page = vdpasim_unmap_page,
>> + .alloc = vdpasim_alloc_coherent,
>> + .free = vdpasim_free_coherent,
>> +};
>> +
>
> Hey Jason,
>
> IMHO, it would be nice if dma_ops of the parent device could be
> re-used. vdpa_device is expecting to represent a physical device
> except this simulator, however, there are not enough information in
> vdpa_device.dev to indicating which kind physical device it attached
> to. Namely get_arch_dma_ops(struct bus type) can not work on
> vdpa_device.dev. Then it seems device drivers need to implement a wrap
> of dma_ops of parent devices. Can this work be done in the vdpa
> framework since it looks like a common task? Can
> "vd_dev->vdev.dev.parent = vdpa->dev->parent;" in virtio_vdpa_probe()
> do the work?
>
> Thanks,
> BR
> Zhu Lingshan
Good catch.
I think we can.
Thanks
Powered by blists - more mailing lists