virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH vhost v1 0/7] virtio_net: rx enable premapped mode by default
@ 2024-04-22  1:53 Xuan Zhuo
  2024-04-22  1:53 ` [PATCH vhost v1 1/7] virtio_ring: introduce dma map api for page Xuan Zhuo
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Xuan Zhuo @ 2024-04-22  1:53 UTC (permalink / raw)
  To: virtualization
  Cc: Michael S. Tsirkin, Jason Wang, Xuan Zhuo, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev

Actually, for the virtio drivers, we can enable premapped mode whatever
the value of use_dma_api. Because we provide the virtio dma apis.
So the driver can enable premapped mode unconditionally.

This patch set makes the big mode of virtio-net to support premapped mode.
And enable premapped mode for rx by default.

Based on the following points, we do not use page pool to manage these
    pages:

    1. virtio-net uses the DMA APIs wrapped by virtio core. Therefore,
       we can only prevent the page pool from performing DMA operations, and
       let the driver perform DMA operations on the allocated pages.
    2. But when the page pool releases the page, we have no chance to
       execute dma unmap.
    3. A solution to #2 is to execute dma unmap every time before putting
       the page back to the page pool. (This is actually a waste, we don't
       execute unmap so frequently.)
    4. But there is another problem, we still need to use page.dma_addr to
       save the dma address. Using page.dma_addr while using page pool is
       unsafe behavior.

    More:
        https://lore.kernel.org/all/CACGkMEu=Aok9z2imB_c5qVuujSh=vjj1kx12fy9N7hqyi+M5Ow@mail.gmail.com/

Please review.


v1:
    1. discussed for using page pool
    2. use dma sync to replace the unmap for the first page

Thanks.


Xuan Zhuo (7):
  virtio_ring: introduce dma map api for page
  virtio_ring: enable premapped mode whatever use_dma_api
  virtio_net: replace private by pp struct inside page
  virtio_net: big mode support premapped
  virtio_net: enable premapped by default
  virtio_net: rx remove premapped failover code
  virtio_net: remove the misleading comment

 drivers/net/virtio_net.c     | 243 +++++++++++++++++++++++------------
 drivers/virtio/virtio_ring.c |  59 ++++++++-
 include/linux/virtio.h       |   7 +
 3 files changed, 222 insertions(+), 87 deletions(-)

--
2.32.0.3.g01195cf9f


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-04-22  5:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-22  1:53 [PATCH vhost v1 0/7] virtio_net: rx enable premapped mode by default Xuan Zhuo
2024-04-22  1:53 ` [PATCH vhost v1 1/7] virtio_ring: introduce dma map api for page Xuan Zhuo
2024-04-22  1:53 ` [PATCH vhost v1 2/7] virtio_ring: enable premapped mode whatever use_dma_api Xuan Zhuo
2024-04-22  1:53 ` [PATCH vhost v1 3/7] virtio_net: replace private by pp struct inside page Xuan Zhuo
2024-04-22  1:54 ` [PATCH vhost v1 4/7] virtio_net: big mode support premapped Xuan Zhuo
2024-04-22  5:40   ` kernel test robot
2024-04-22  1:54 ` [PATCH vhost v1 5/7] virtio_net: enable premapped by default Xuan Zhuo
2024-04-22  1:54 ` [PATCH vhost v1 6/7] virtio_net: rx remove premapped failover code Xuan Zhuo
2024-04-22  1:54 ` [PATCH vhost v1 7/7] virtio_net: remove the misleading comment Xuan Zhuo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).