Xuan Zhuo
2023-May-17 02:22 UTC
[PATCH vhost v9 04/12] virtio_ring: virtqueue_add() support premapped
virtuque_add() adds parameter premapped. Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com> --- drivers/virtio/virtio_ring.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 1ffab1eb40c0..e2fc50c05bec 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -2135,6 +2135,7 @@ static inline int virtqueue_add(struct virtqueue *_vq, unsigned int in_sgs, void *data, void *ctx, + bool premapped, gfp_t gfp) { struct vring_virtqueue *vq = to_vvq(_vq); @@ -2176,7 +2177,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, false, gfp); } EXPORT_SYMBOL_GPL(virtqueue_add_sgs); @@ -2198,7 +2199,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, false, gfp); } EXPORT_SYMBOL_GPL(virtqueue_add_outbuf); @@ -2220,7 +2221,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, false, gfp); } EXPORT_SYMBOL_GPL(virtqueue_add_inbuf); @@ -2244,7 +2245,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, false, gfp); } EXPORT_SYMBOL_GPL(virtqueue_add_inbuf_ctx); -- 2.32.0.3.g01195cf9f
Jason Wang
2023-May-18 06:51 UTC
[PATCH vhost v9 04/12] virtio_ring: virtqueue_add() support premapped
On Wed, May 17, 2023 at 10:23?AM Xuan Zhuo <xuanzhuo at linux.alibaba.com> wrote:> > virtuque_add() adds parameter premapped.I wonder if this patch is over simplified. Maybe it can be squashed with the patch that implements the premapped logic. Thanks> > Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com> > --- > drivers/virtio/virtio_ring.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index 1ffab1eb40c0..e2fc50c05bec 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -2135,6 +2135,7 @@ static inline int virtqueue_add(struct virtqueue *_vq, > unsigned int in_sgs, > void *data, > void *ctx, > + bool premapped, > gfp_t gfp) > { > struct vring_virtqueue *vq = to_vvq(_vq); > @@ -2176,7 +2177,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, false, gfp); > } > EXPORT_SYMBOL_GPL(virtqueue_add_sgs); > > @@ -2198,7 +2199,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, false, gfp); > } > EXPORT_SYMBOL_GPL(virtqueue_add_outbuf); > > @@ -2220,7 +2221,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, false, gfp); > } > EXPORT_SYMBOL_GPL(virtqueue_add_inbuf); > > @@ -2244,7 +2245,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, false, gfp); > } > EXPORT_SYMBOL_GPL(virtqueue_add_inbuf_ctx); > > -- > 2.32.0.3.g01195cf9f >
Possibly Parallel Threads
- [PATCH vhost v9 04/12] virtio_ring: virtqueue_add() support premapped
- [PATCH vhost v9 04/12] virtio_ring: virtqueue_add() support premapped
- [PATCH vhost v9 00/12] virtio core prepares for AF_XDP
- [PATCH vhost 04/10] virtio_ring: split: introduce virtqueue_add_split_premapped()
- [PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma