Virtualization Archive mirror
 help / color / mirror / Atom feed
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, virtualization@lists.linux.dev
Subject: Re: [PATCH vhost v3 0/4] virtio_net: rx enable premapped mode by default
Date: Sun, 28 Apr 2024 09:18:49 +0800	[thread overview]
Message-ID: <1714267129.6438966-2-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <45002f120a57ec362459868a67af1627a22274d1.camel@redhat.com>

On Fri, 26 Apr 2024 13:00:08 +0200, Paolo Abeni <pabeni@redhat.com> wrote:
> On Wed, 2024-04-24 at 16:16 +0800, Xuan Zhuo wrote:
> > 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.
> >     5. And we need space the chain the pages submitted once to virtio core.
> >
> >     More:
> >         https://lore.kernel.org/all/CACGkMEu=Aok9z2imB_c5qVuujSh=vjj1kx12fy9N7hqyi+M5Ow@mail.gmail.com/
> >
> > Why we do not use the page space to store the dma?
> >     http://lore.kernel.org/all/CACGkMEuyeJ9mMgYnnB42=hw6umNuo=agn7VBqBqYPd7GN=+39Q@mail.gmail.com
> >
> > Please review.
> >
> > v3:
> >     1. big mode still use the mode that virtio core does the dma map/unmap
> >
> > v2:
> >     1. make gcc happy in page_chain_get_dma()
> >         http://lore.kernel.org/all/202404221325.SX5ChRGP-lkp@intel.com
> >
> > v1:
> >     1. discussed for using page pool
> >     2. use dma sync to replace the unmap for the first page
>
> Judging by the subj prefix, this is targeting the vhost tree, right?
>
> There are a few patches landing on virtio_net on net-next, I guess
> there will be some conflict while pushing to Linux (but I haven't
> double check yet!)
>
> Perhaps you could provide a stable git branch so that both vhost and
> netdev could pull this set?

This patch set is related with the virio core, so I push this
to the vhost branch. And there is no new feature to the virtio-net.
Similar situation in the past, we pushed to the vhost branch.

I am ok to net-next or vhost. We can hear others

@Michael

Thanks.

>
> Thanks!
>
> Paolo
>

      reply	other threads:[~2024-04-28  1:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24  8:16 [PATCH vhost v3 0/4] virtio_net: rx enable premapped mode by default Xuan Zhuo
2024-04-24  8:16 ` [PATCH vhost v3 1/4] virtio_ring: enable premapped mode whatever use_dma_api Xuan Zhuo
2024-04-24  8:16 ` [PATCH vhost v3 2/4] virtio_net: big mode skip the unmap check Xuan Zhuo
2024-04-25  2:11   ` Jason Wang
2024-04-25  2:35     ` Xuan Zhuo
2024-04-25  6:04       ` Jason Wang
2024-04-24  8:16 ` [PATCH vhost v3 3/4] virtio_net: rx remove premapped failover code Xuan Zhuo
2024-04-24  8:16 ` [PATCH vhost v3 4/4] virtio_net: remove the misleading comment Xuan Zhuo
2024-04-26 11:00 ` [PATCH vhost v3 0/4] virtio_net: rx enable premapped mode by default Paolo Abeni
2024-04-28  1:18   ` Xuan Zhuo [this message]

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=1714267129.6438966-2-xuanzhuo@linux.alibaba.com \
    --to=xuanzhuo@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=virtualization@lists.linux.dev \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).