Xuan Zhuo
2023-Jul-20 06:45 UTC
[PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()
On Wed, 19 Jul 2023 23:22:42 -0700, Christoph Hellwig <hch at infradead.org> wrote:> On Thu, Jul 13, 2023 at 10:51:59AM -0400, Michael S. Tsirkin wrote: > > On Thu, Jul 13, 2023 at 04:15:16AM -0700, Christoph Hellwig wrote: > > > On Mon, Jul 10, 2023 at 11:42:32AM +0800, Xuan Zhuo wrote: > > > > Added virtqueue_dma_dev() to get DMA device for virtio. Then the > > > > caller can do dma operation in advance. The purpose is to keep memory > > > > mapped across multiple add/get buf operations. > > > > > > This is just poking holes into the abstraction.. > > > > More specifically? > > Because now you expose a device that can't be used for the non-dma > mapping case and shoud be hidden.Sorry I can not got. 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. Thanks.
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".