Re: [PATCH v1 4/6] virtio: virtqueue_add() support predma

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 23, 2022 at 11:01 AM Jason Wang <jasowang@xxxxxxxxxx> wrote:
>
>
> 在 2022/2/10 下午4:51, Xuan Zhuo 写道:
> > virtuque_add() adds parameter predma.
> >
> > Signed-off-by: Xuan Zhuo <xuanzhuo@xxxxxxxxxxxxxxxxx>
> > ---
> >   drivers/virtio/virtio_ring.c | 11 ++++++-----
> >   1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> > index cfb028ca238e..cf9d118668f1 100644
> > --- a/drivers/virtio/virtio_ring.c
> > +++ b/drivers/virtio/virtio_ring.c
> > @@ -1780,7 +1780,8 @@ static inline int virtqueue_add(struct virtqueue *_vq,
> >                               unsigned int in_sgs,
> >                               void *data,
> >                               void *ctx,
> > -                             gfp_t gfp)
> > +                             gfp_t gfp,
> > +                             bool predma)
>
>
> sg is assumed to use dma address, so I wonder whether "sg_is_phys" is a
> better name?

Speak too fast, I was wrong here, I think we should be consistent
here, so "premapped" should be better.

Thanks

>
> Thanks
>
>
> >   {
> >       struct vring_virtqueue *vq = to_vvq(_vq);
> >
> > @@ -1821,7 +1822,7 @@ int virtqueue_add_sgs(struct virtqueue *_vq,
> >                       total_sg++;
> >       }
> >       return virtqueue_add(_vq, sgs, total_sg, out_sgs, in_sgs,
> > -                          data, NULL, gfp);
> > +                          data, NULL, gfp, false);
> >   }
> >   EXPORT_SYMBOL_GPL(virtqueue_add_sgs);
> >
> > @@ -1843,7 +1844,7 @@ int virtqueue_add_outbuf(struct virtqueue *vq,
> >                        void *data,
> >                        gfp_t gfp)
> >   {
> > -     return virtqueue_add(vq, &sg, num, 1, 0, data, NULL, gfp);
> > +     return virtqueue_add(vq, &sg, num, 1, 0, data, NULL, gfp, false);
> >   }
> >   EXPORT_SYMBOL_GPL(virtqueue_add_outbuf);
> >
> > @@ -1865,7 +1866,7 @@ int virtqueue_add_inbuf(struct virtqueue *vq,
> >                       void *data,
> >                       gfp_t gfp)
> >   {
> > -     return virtqueue_add(vq, &sg, num, 0, 1, data, NULL, gfp);
> > +     return virtqueue_add(vq, &sg, num, 0, 1, data, NULL, gfp, false);
> >   }
> >   EXPORT_SYMBOL_GPL(virtqueue_add_inbuf);
> >
> > @@ -1889,7 +1890,7 @@ int virtqueue_add_inbuf_ctx(struct virtqueue *vq,
> >                       void *ctx,
> >                       gfp_t gfp)
> >   {
> > -     return virtqueue_add(vq, &sg, num, 0, 1, data, ctx, gfp);
> > +     return virtqueue_add(vq, &sg, num, 0, 1, data, ctx, gfp, false);
> >   }
> >   EXPORT_SYMBOL_GPL(virtqueue_add_inbuf_ctx);
> >

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux