Virtualization Archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: virtualization@lists.linux.dev,
	"Michael S. Tsirkin" <mst@redhat.com>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH vhost v5 00/10] virtio: drivers maintain dma info for premapped vq
Date: Wed, 27 Mar 2024 16:47:25 +0800	[thread overview]
Message-ID: <CACGkMEvEkq-LH3vkx1uRZ5fDASn0Q=apXbOTK4jSaA=YU6ttHw@mail.gmail.com> (raw)
In-Reply-To: <1711526642.5018039-4-xuanzhuo@linux.alibaba.com>

On Wed, Mar 27, 2024 at 4:07 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
>
> On Wed, 27 Mar 2024 15:50:17 +0800, Jason Wang <jasowang@redhat.com> wrote:
> > On Wed, Mar 27, 2024 at 3:16 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> > >
> > > On Tue, 26 Mar 2024 14:35:21 +0800, Jason Wang <jasowang@redhat.com> wrote:
> > > > On Mon, Mar 25, 2024 at 4:54 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> > > > >
> > > > > As discussed:
> > > > >
> > > > > http://lore.kernel.org/all/CACGkMEvq0No8QGC46U4mGsMtuD44fD_cfLcPaVmJ3rHYqRZxYg@mail.gmail.com
> > > > >
> > > > > If the virtio is premapped mode, the driver should manage the dma info by self.
> > > > > So the virtio core should not store the dma info. We can release the memory used
> > > > > to store the dma info.
> > > > >
> > > > > For virtio-net xmit queue, if the virtio-net maintains the dma info,
> > > > > the virtio-net must allocate too much memory(19 * queue_size for per-queue), so
> > > > > we do not plan to make the virtio-net to maintain the dma info by default. The
> > > > > virtio-net xmit queue only maintain the dma info when premapped mode is enable
> > > > > (such as AF_XDP is enable).
> > > > >
> > > > > So this patch set try to do:
> > > > >
> > > > > 1. make the virtio core to do not store the dma info when driver can do that
> > > > >     - But if the desc_extra has not dma info, we face a new question,
> > > > >       it is hard to get the dma info of the desc with indirect flag.
> > > > >       For split mode, that is easy from desc, but for the packed mode,
> > > > >       it is hard to get the dma info from the desc. And hardening
> > > > >       the dma unmap is safe, we should store the dma info of indirect
> > > > >       descs when the virtio core does not store the bufer dma info.
> > > > >
> > > > >       The follow patches to this:
> > > > >          * virtio_ring: packed: structure the indirect desc table
> > > > >          * virtio_ring: split: structure the indirect desc table
> > > > >
> > > > >     - On the other side, in the umap handle, we mix the indirect descs with
> > > > >       other descs. That make things too complex. I found if we we distinguish
> > > > >       the descs with VRING_DESC_F_INDIRECT before unmap, thing will be clearer.
> > > > >
> > > > >       The follow patches do this.
> > > > >          * virtio_ring: packed: remove double check of the unmap ops
> > > > >          * virtio_ring: split: structure the indirect desc table
> > > > >
> > > > > 2. make the virtio core to enable premapped mode by find_vqs() params
> > > > >     - Because the find_vqs() will try to allocate memory for the dma info.
> > > > >       If we set the premapped mode after find_vqs() and release the
> > > > >       dma info, that is odd.
> > > > >
> > > > >
> > > > > Please review.
> > > > >
> > > > > Thanks
> > > >
> > > > This doesn't apply cleany on vhost.git linux-next branch.
> > > >
> > > > Which tree is this based on?
> > >
> > >
> > > Sorry. That is on the top of "[PATCH vhost v5 0/6] refactor the params of
> > > find_vqs()".
> > >
> > > Lore-URL: http://lore.kernel.org/all/20240325090419.33677-1-xuanzhuo@linux.alibaba.com
> > >
> > > Thanks.
> >
> > I've tried that but it doesn't work:
> >
> > % git am ~/Downloads/\[PATCH\ vhost\ v5\ 01_10\]\ virtio_ring_\
> > introduce\ vring_need_unmap_buffer.eml
> > Applying: virtio_ring: introduce vring_need_unmap_buffer
> > error: patch failed: drivers/virtio/virtio_ring.c:2080
> > error: drivers/virtio/virtio_ring.c: patch does not apply
> > Patch failed at 0001 virtio_ring: introduce vring_need_unmap_buffer
> > hint: Use 'git am --show-current-patch=diff' to see the failed patch
> > When you have resolved this problem, run "git am --continue".
> > If you prefer to skip this patch, run "git am --skip" instead.
> > To restore the original branch and stop patching, run "git am --abort".
> >
> > I'm using vhost.git linux-next branch, HEAD is
> >
> > commit 56e71885b0349241c07631a7b979b61e81afab6a
> > Author: Maxime Coquelin <maxime.coquelin@redhat.com>
> > Date:   Tue Jan 9 12:10:24 2024 +0100
> >
> >     vduse: Temporarily fail if control queue feature requested
>
>
> NOT ON the vhost directly.
>
> That is on the top of "refactor the params of find_vqs"

I meant I just did it on top of this series.

>
> "refactor the params of find_vqs" said:
>
>         """
>         This pathset is splited from the
>
>              http://lore.kernel.org/all/20240229072044.77388-1-xuanzhuo@linux.alibaba.com
>
>         That may needs some cycles to discuss. But that notifies too many people.
>         """
>
> But now that is broken due to the change of the that patch set.
>
> I will post the new version of these two patch set soon.

Ok.

Thanks

>
> Thanks.
>
>
> >
> > Thanks
> >
> > >
> > > >
> > > > Thanks
> > > >
> > >
> >
>


      reply	other threads:[~2024-03-27  8:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25  8:54 [PATCH vhost v5 00/10] virtio: drivers maintain dma info for premapped vq Xuan Zhuo
2024-03-25  8:54 ` [PATCH vhost v5 01/10] virtio_ring: introduce vring_need_unmap_buffer Xuan Zhuo
2024-03-25  8:54 ` [PATCH vhost v5 02/10] virtio_ring: packed: remove double check of the unmap ops Xuan Zhuo
2024-03-25  8:54 ` [PATCH vhost v5 03/10] virtio_ring: packed: structure the indirect desc table Xuan Zhuo
2024-03-25  8:54 ` [PATCH vhost v5 04/10] virtio_ring: split: remove double check of the unmap ops Xuan Zhuo
2024-03-25  8:54 ` [PATCH vhost v5 05/10] virtio_ring: split: structure the indirect desc table Xuan Zhuo
2024-03-25  8:54 ` [PATCH vhost v5 06/10] virtio_ring: no store dma info when unmap is not needed Xuan Zhuo
2024-03-25  8:54 ` [PATCH vhost v5 07/10] virtio: find_vqs: add new parameter premapped Xuan Zhuo
2024-03-25  8:54 ` [PATCH vhost v5 08/10] virtio_ring: export premapped to driver by struct virtqueue Xuan Zhuo
2024-03-25  8:54 ` [PATCH vhost v5 09/10] virtio_net: set premapped mode by find_vqs() Xuan Zhuo
2024-03-25  8:54 ` [PATCH vhost v5 10/10] virtio_ring: virtqueue_set_dma_premapped support disable Xuan Zhuo
2024-03-26  6:35 ` [PATCH vhost v5 00/10] virtio: drivers maintain dma info for premapped vq Jason Wang
2024-03-27  7:14   ` Xuan Zhuo
2024-03-27  7:50     ` Jason Wang
2024-03-27  8:04       ` Xuan Zhuo
2024-03-27  8:47         ` Jason Wang [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='CACGkMEvEkq-LH3vkx1uRZ5fDASn0Q=apXbOTK4jSaA=YU6ttHw@mail.gmail.com' \
    --to=jasowang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).