Re: [PATCH vhost v11 03/10] virtio_ring: introduce virtqueue_set_premapped()

2023-07-19 Thread Christoph Hellwig
On Thu, Jul 13, 2023 at 10:47:23AM -0400, Michael S. Tsirkin wrote: > There are a gazillion virtio drivers and most of them just use the > virtio API, without bothering with these micro-optimizations. virtio > already tracks addresses so mapping/unmapping them for DMA is easier > done in the core.

Re: [PATCH vhost v11 03/10] virtio_ring: introduce virtqueue_set_premapped()

2023-07-13 Thread Michael S. Tsirkin
On Thu, Jul 13, 2023 at 04:14:45AM -0700, Christoph Hellwig wrote: > On Mon, Jul 10, 2023 at 11:42:30AM +0800, Xuan Zhuo wrote: > > This helper allows the driver change the dma mode to premapped mode. > > Under the premapped mode, the virtio core do not do dma mapping > > internally. > > > > This

Re: [PATCH vhost v11 03/10] virtio_ring: introduce virtqueue_set_premapped()

2023-07-13 Thread Michael S. Tsirkin
On Thu, Jul 13, 2023 at 04:14:45AM -0700, Christoph Hellwig wrote: > On Mon, Jul 10, 2023 at 11:42:30AM +0800, Xuan Zhuo wrote: > > This helper allows the driver change the dma mode to premapped mode. > > Under the premapped mode, the virtio core do not do dma mapping > > internally. > > > > This

Re: [PATCH vhost v11 03/10] virtio_ring: introduce virtqueue_set_premapped()

2023-07-13 Thread Christoph Hellwig
On Mon, Jul 10, 2023 at 11:42:30AM +0800, Xuan Zhuo wrote: > This helper allows the driver change the dma mode to premapped mode. > Under the premapped mode, the virtio core do not do dma mapping > internally. > > This just work when the use_dma_api is true. If the use_dma_api is false, > the dma

Re: [PATCH vhost v11 03/10] virtio_ring: introduce virtqueue_set_premapped()

2023-07-12 Thread Xuan Zhuo
On Wed, 12 Jul 2023 16:24:18 +0800, Jason Wang wrote: > On Mon, Jul 10, 2023 at 11:42 AM Xuan Zhuo > wrote: > > > This helper allows the driver change the dma mode to premapped mode. > > Under the premapped mode, the virtio core do not do dma mapping > > internally. > > > > This just work when th

Re: [PATCH vhost v11 03/10] virtio_ring: introduce virtqueue_set_premapped()

2023-07-12 Thread Jason Wang
On Mon, Jul 10, 2023 at 11:42 AM Xuan Zhuo wrote: > This helper allows the driver change the dma mode to premapped mode. > Under the premapped mode, the virtio core do not do dma mapping > internally. > > This just work when the use_dma_api is true. If the use_dma_api is false, > the dma options