lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fe38f83c-25f2-4e16-945c-210ceb66b37a@meta.com>
Date: Fri, 9 Jan 2026 12:36:01 -0800
From: Vishwanath Seshagiri <vishs@...a.com>
To: "Michael S. Tsirkin" <mst@...hat.com>, Jason Wang <jasowang@...hat.com>
Cc: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
        Eugenio Pérez <eperezma@...hat.com>,
        Andrew Lunn <andrew+netdev@...n.ch>,
        "David S . Miller"
 <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, David Wei <dw@...idwei.uk>,
        netdev@...r.kernel.org, virtualization@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] virtio_net: add page pool support for buffer
 allocation



On 1/8/26 10:50 PM, Michael S. Tsirkin wrote:
> On Fri, Jan 09, 2026 at 11:16:39AM +0800, Jason Wang wrote:
>>> My concern was that virtio has its own DMA abstraction
>>> vdev->map->map_page() (used by VDUSE), and I wasn't sure if page_pool's
>>> standard dma_map_page() would be compatible with all virtio backends.
>>
>> You are right, DMA is unware about virtio mappings, so we can't use that.
> 
> Or maybe we could add an API saying whether virtio mappings are DMA ones
> and then enable that conditionally? Because on some platforms, mapping
> in the pool can save *a lot* of cycles.
> 

I think virtqueue_dma_dev() alread serves this purpose? It returns the
DMA device when virtio uses standard DMA API and NULL when custom
mappings (VDUSE) or direct physical addressing.

This is the same check used by XDP in virtnet_xsk_pool_enable(), which
calls xsk_pool_dma_map(pool, dma_dev, 0) only when virtqueue_dma_dev()
returns non-NULL.

For v2, I'll use this to conditionally enable the PP_FLAG_DMA_MAP at 
probe to give us pool-managed DMA on most systems while falling back
to manual mapping for VDUSE.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ