[PATCH vhost 06/17] virtio_ring: no store dma info when unmap is not needed

Jason Wang jasowang at redhat.com
Thu Feb 1 19:04:17 PST 2024


On Thu, Feb 1, 2024 at 2:05 PM Xuan Zhuo <xuanzhuo at linux.alibaba.com> wrote:
>
> On Wed, 31 Jan 2024 17:12:29 +0800, Jason Wang <jasowang at redhat.com> wrote:
> > On Tue, Jan 30, 2024 at 7:42 PM Xuan Zhuo <xuanzhuo at linux.alibaba.com> wrote:
> > >
> > > As discussed:
> > > http://lore.kernel.org/all/CACGkMEug-=C+VQhkMYSgUKMC==04m7-uem_yC21bgGkKZh845w@mail.gmail.com
> > >
> > > When the vq is premapped mode, the driver manages the dma
> > > info is a good way.
> > >
> > > So this commit make the virtio core not to store the dma
> > > info and release the memory which is used to store the dma
> > > info.
> > >
> > > If the use_dma_api is false, the memory is also not allocated.
> > >
> > > Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com>
> > > ---

[...]

> > >
> > > @@ -1245,14 +1269,16 @@ static u16 packed_last_used(u16 last_used_idx)
> > >
> > >  /* caller must check vring_need_unmap_buffer() */
> > >  static void vring_unmap_extra_packed(const struct vring_virtqueue *vq,
> > > -                                    const struct vring_desc_extra *extra)
> > > +                                    unsigned int i)
> > >  {
> > > +       const struct vring_desc_extra *extra = &vq->packed.desc_extra[i];
> > > +       const struct vring_desc_dma *dma = &vq->packed.desc_dma[i];
> > >         u16 flags;
> > >
> > >         flags = extra->flags;
> >
> > I don't think this can be compiled.
>
> I do not find any error.
> Could you say more?

Sorry, I misread the code.

It should be fine.

Thanks

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




More information about the linux-um mailing list