Christoph Hellwig
2023-Apr-11 06:46 UTC
[PATCH vhost v6 08/11] virtio_ring: introduce virtqueue_dma_dev()
On Tue, Apr 11, 2023 at 02:28:00PM +0800, Xuan Zhuo wrote:> > That is just completely broken, virtio or not. Highlevel code like > > sockets must never do dma mappings themselves. > > AF_XDP provides some API for net driver. This API will do dma map or dma sync. > > cc AF_XDP maintainers.So in that case AF_XDP doesn't actually require a dma device as you claimed early and gets the layering right after all. Just don't use that API from a network driver that doesn't need to do dma mappings like virtio for the !platform_access case then.
Xuan Zhuo
2023-Apr-11 06:51 UTC
[PATCH vhost v6 08/11] virtio_ring: introduce virtqueue_dma_dev()
On Mon, 10 Apr 2023 23:46:56 -0700, Christoph Hellwig <hch at infradead.org> wrote:> On Tue, Apr 11, 2023 at 02:28:00PM +0800, Xuan Zhuo wrote: > > > That is just completely broken, virtio or not. Highlevel code like > > > sockets must never do dma mappings themselves. > > > > AF_XDP provides some API for net driver. This API will do dma map or dma sync. > > > > cc AF_XDP maintainers. > > So in that case AF_XDP doesn't actually require a dma device as you > claimed early and gets the layering right after all. Just don't use that > API from a network driver that doesn't need to do dma mappings like > virtio for the !platform_access case then.Yes