Christoph Hellwig
2023-Jul-20 06:57 UTC
[PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()
On Thu, Jul 20, 2023 at 02:45:14PM +0800, Xuan Zhuo wrote:> virtqueue_dma_dev() return the device that working with the DMA APIs. > Then that can be used like other devices. So what is the problem. > > I always think the code path without the DMA APIs is the trouble for you.Because we now have an API where the upper level drivers sometimes see the dma device and sometimes not. This will be abused and cause trouble sooner than you can say "layering".
Xuan Zhuo
2023-Jul-20 07:34 UTC
[PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()
On Wed, 19 Jul 2023 23:57:51 -0700, Christoph Hellwig <hch at infradead.org> wrote:> On Thu, Jul 20, 2023 at 02:45:14PM +0800, Xuan Zhuo wrote: > > virtqueue_dma_dev() return the device that working with the DMA APIs. > > Then that can be used like other devices. So what is the problem. > > > > I always think the code path without the DMA APIs is the trouble for you. > > Because we now have an API where the upper level drivers sometimes > see the dma device and sometimes not.No dma device is just for the old devices. The API without DMA dev are only compatible with older devices. We can't give up these old devices, but we also have to embrace new features.> This will be abused and cause > trouble sooner than you can say "layering".I don't understand what the possible trouble here is. When no dma device, the driver just does the same thing as before. Thanks.