public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vishwanath Seshagiri <vishs@meta.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>
Cc: "Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>, "David Wei" <dw@davidwei.uk>,
	netdev@vger.kernel.org, virtualization@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] virtio_net: add page pool support for buffer allocation
Date: Fri, 9 Jan 2026 12:36:01 -0800	[thread overview]
Message-ID: <fe38f83c-25f2-4e16-945c-210ceb66b37a@meta.com> (raw)
In-Reply-To: <20260109014836-mutt-send-email-mst@kernel.org>



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.



  reply	other threads:[~2026-01-09 20:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-06 22:19 [PATCH 0/2] virtio_net: add page_pool support Vishwanath Seshagiri
2026-01-06 22:19 ` [PATCH 1/2] virtio_net: add page pool support for buffer allocation Vishwanath Seshagiri
2026-01-07  3:49   ` Xuan Zhuo
2026-01-07 18:41     ` Vishwanath Seshagiri
2026-01-08  3:16   ` Jason Wang
2026-01-08  6:23     ` Vishwanath Seshagiri
2026-01-09  3:16       ` Jason Wang
2026-01-09  6:50         ` Michael S. Tsirkin
2026-01-09 20:36           ` Vishwanath Seshagiri [this message]
2026-01-10  1:57         ` Vishwanath Seshagiri
2026-01-12  3:15           ` Jason Wang
2026-01-06 22:19 ` [PATCH 2/2] selftests: virtio_net: add buffer circulation test Vishwanath Seshagiri
2026-01-07  8:28 ` [PATCH 0/2] virtio_net: add page_pool support Michael S. Tsirkin
2026-01-08  5:23   ` Vishwanath Seshagiri
2026-01-28 20:19     ` Michael S. Tsirkin
2026-01-28 20:27       ` Vishwanath Seshagiri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe38f83c-25f2-4e16-945c-210ceb66b37a@meta.com \
    --to=vishs@meta.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox